New cost matrix computation implementation
Merge pull request #19 from hadim/new_cost

New cost matrix computation implementation