Weighted astar

And while you are at it, here is a patch that fixes the `x,y` vs `row,col` problem https://github.com/xtaci/algorithms/pull/19 and also add weight calculation to astar.