
Untitled
By: a guest on
May 2nd, 2012 | syntax:
None | size: 0.45 KB | hits: 25 | expires: Never
EVALUATING: set(dg, directed_graph(map(range(9), [value/3,value%3]), filter(links(v), inside_bounds(value)))) where links = def(v) [[v[0]-1,v[1]], [v[0]+1,v[1]], [v[0],v[1]-1], [v[0],v[1]+1]], inside_bounds = def(v) v[0]>=0 and v[1]>=0 and v[0]<3 and v[1]<3
OUTPUT: (0D1A8540){}
EVALUATING: set(wg, weighted_graph(dg, 10))
OUTPUT: (0D1AA208){}
EVALUATING: a_star_search(wg, [0,0], [2,2], distance(a,b))
OUTPUT: [[0, 0], [1, 0], [2, 0], [2, 1], [2, 2]]