The skimage.graph documentation states that the goal_reached method can be
overloaded to introduce additional constraints on finding the minimum cost
path. I'm having some trouble implementing this but I can't find any useful
examples to follow online. I'm hoping someone can provide some guidance.

I need to implement a minimum cost path through an array of costs. The
added twist is that I need to ensure the path does not exceed some maximum
geometric distance (represented as a total number of traversed cells). So I
need my goal_reached() method to check whether the current path has
exceeded the maximum number of cells and return 1 if true (which tells MCP
to stop checking neighbors).

Is there a good example implementation somewhere that I can refer to for
some guidance? I've sketched out a rough outline but I'm not sure I'm on
the right track:

graph = MCP(costSurfaceArray,fully_connected=False)

def goal_reached(index, cumcost):
   '''code to check total distance'''

graph.goal_reached = goal_reached

Thanks for any help!

PS I posted this also on a Google Group that appears to be defunct.
Apologies if that list is actually active and you got a double post from me.
_______________________________________________
scikit-image mailing list
scikit-image@python.org
https://mail.python.org/mailman/listinfo/scikit-image

Reply via email to