-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Min-Cost Flow Problem #39
Conversation
@stevedwards, @simonbowly I've found that we can use networkx.convert_matrix.to_scipy_sparse_array to get multiple edge attributes out (as independent matrices): >>> import networkx as nx
>>> G = nx.DiGraph()
>>> G.add_edge(0, 1, weight=1.0, capacity=2.0)
>>> G.add_edge(1, 2, weight=3.0, capacity=4.0)
>>> print(nx.to_scipy_sparse_array(G, weight="weight"))
(0, 1) 1.0
(1, 2) 3.0
>>> print(nx.to_scipy_sparse_array(G, weight="capacity"))
(0, 1) 2.0
(1, 2) 4.0 Alternatively, we can add networkx directly (or use pandas), I don't mind, but it would be good to have an agreement between optiflowmods. |
Hey @simonbowly could you please check if the idea of d994dd4 is OK? The other ones I will write in the same vein as your matching problem (a single entry point with hidden functions for different interfaces). |
This looks good to me. In the docs for min cost flow, the networkx example is very cluttered. You could make this a bit easier to read by:
It also might make sense to change the doc structure a bit. You don't have to stick to specification -> code -> solution exactly. In this case it might make more sense to have separate sections for each input format, or you could use synced tabs to switch all examples/output to be relevant to the input format the user wants. |
@torressa this is looking great! I added a few specific comments. Overall I think the documentation looks a little sparse - do you think it needs a bit more detail? |
I think I've addressed all the comments (not sure if marking them as resolved is what one does?). I've fleshed out the formulation explanation a bit more. Would you like to see more content in the |
Nice one, thanks for the great work! Yeah I know the feeling, let's merge this and wait to see if inspiration strikes later :-) |
Description
Implements min-cost flow from #11.
Checklist
gurobi_optimods
installable packagetests/
gurobi_optimods.datasets
for loading data)Have a nice day!