Max Flow and Min-Cut in GurobiOptimods
AnsweredHey guys,
during the Optimization 201 - Training i got aware of the gurobi-optimods module and saw in the documentation, that there were functions mentioned to determine the maximum flow via the min-cut approach. Upon installation of the package I noticed, that there isn't any function defined in this regard.
Am I doing something wrong?
Thank you in advance for your help.
Kind regards,
Martin
-
Hi Martin,
Currently, these are the available OptiMods: The OptiMods Gallery — Gurobi OptiMods 1.1.1dev0 documentation (readthedocs-hosted.com)
There is a Mod implementing the Minimum-Cost Flow.
I hope this answers your question.
Cheers,
Matthias1 -
Hey Matthias,
thank you very much for your reply. That answers my question.
I just have one further question. In which format the input is requested for the minimum-cost flow. I tried to read a csv in the format of the dataframe in the documentation, but the function reads the information as 10 nodes, while I just have 5 defined. I would have loved to provide a screenshot but the file size is too big.
input_df=pd.read_csv("input_data_8.csv",keep_default_na=False).set_index(['source', 'target'])
Is there any specific requirement how the data has to be defined?
Kind regards
Martin
0 -
Hi Martin,
You can check out the input format in three different flavors (scipy, networkx, and pandas). I suggest you inspect the dataframe generated by your CSV data and adapt it according to our pandas example. This is something you would have to do by yourself, I'm afraid.
Cheers,
Matthias0
Please sign in to leave a comment.
Comments
3 comments