graphlib icon indicating copy to clipboard operation
graphlib copied to clipboard

Rationale behind custom edge functions

Open dionyziz opened this issue 7 years ago • 1 comments

I would like to ask what the rationale for custom edge functions is. It seems to me that edges are an inherent part of a graph's topology and would be better handled by the library if they were always built into the graph. As we can see in the implementation of dijkstra and Bellman-Ford, this introduces some more convoluted implementation.

What are the benefits for allowing custom edge functions? Why not ask the user to create a new graph with their custom edges embedded?

Thanks!

dionyziz avatar Aug 25 '18 10:08 dionyziz

I had to use the custom edge functions recently. I needed to simulate how removing an edge could affect the graph. With my own edge function, I was able to get shortest path between nodes without actually modifying or recreating the graph.

gaganpreet avatar Nov 20 '18 14:11 gaganpreet

I'm not the original creator and don't know the reason behind the decision, so I'm going to close this. If it's an problem, reopen the issue and let me know what the problem is.

rustedgrail avatar Mar 03 '23 14:03 rustedgrail