JuliaAttic / OldGraphs.jl

Working with graphs in Julia
Other
205 stars 81 forks source link

Max flow contribution #202

Open pranavtbhat opened 8 years ago

pranavtbhat commented 8 years ago

I wanted to contribute to the package's flow algorithms. I could start off with an implementation of Edmond Carp's Maximum flow algorithm. I'm planning to use networkx's implementation as reference.

Edmond Carp's algorithm requires the input graph to be directed, and have a flow capacity parameter defined on each edge. The flow capacity parameter can be passed into the function using a field of type ConstantEdgePropertyInspector{Number}. But what should the input graph's type be? Will AbstractGraph do or should I use something more specific?

Also, should I create a new file or include the max flow function in an existing file?

mlubin commented 8 years ago

@pranavtbhat, if you'd like to keep your code easy to maintain and general, I'd recommend implementing this in a separate package. The abstractions in this package are difficult to work with. You can define your own input structure as it's most convenient for the algorithm, and then provide an additional routine which converts a graph from this package or from https://github.com/JuliaGraphs/LightGraphs.jl into your input format. Any cost of converting data structures should be much less than solving the flow problem.

pranavtbhat commented 8 years ago

:+1:

sbromberger commented 8 years ago

@pranavtbhat if you'd like to discuss how to integrate this into LightGraphs, please feel free to open up an issue there. Thanks!