Conquering all metro stations using Pyomo
Alireza Soroudi, PhD
Lead Data Scientist @ bluecrux || SMIEEE || Optimization expert || Healthcare management || Lab Digitalization || Power and Energy systems || Developer || Author / Speaker || (views are mine)
Metro-hopping refers to the act of traveling on a metro system, visiting different stations in a quick and efficient manner. It is like a game or challenge where the goal is to visit as many stations as possible in a short amount of time. Metro-hopping can be seen as an adventure or a way to explore different parts of a city. It is a fun and exciting activity for those who enjoy public transportation and want to experience the thrill of navigating through a metro network.
I was thinking about how to use mathematical optimization to do this as fast as possible. For this reason, I chose Budapest's metro network (not hard to guess why).
The idea is to start from one station and visit all stations in a continious tour (no need to return to the starting station).
Mathematical formulation
领英推荐
Pyomo Code
Results
There are several observations in this problem :
The Pyomo code is available on the?Github?, you can support this newsletter by giving a star to it.
Electrical Engineer at IGTC
1 年PyomoChannel
Optimal Decision Analytics Expert
1 年The high level objective description seems to be based on overall time, but the MILP formulation is based on distance. Overall time may have a large component of waiting time, which may be stochastic, and dynamic (probability distribution depending on time of day), with the travel tmes on various parts of the network being probabiilisticlaly dependent. The data gathering and problem formulation will be more challenging than for distance objective, but more meaningful to the problem nominally being addressed. if your route saves some distance, but incurs large waiting times between legs, that might not be "optimal".
PHD Candidate at univercity of kurdistan
1 年PyomoChannel
Dipl.Math., Data Scientist at Garmin Würzburg GmbH, Germany
1 年I always appreciate your nice stories related tosolving combinatorial problems with pyomo. Just as a remark: the current problem can be reduced to the TSP essentially by using directed connections between subsequent stations, e.g. connecting station A to station B, as nodes (AB in a different graph; the edges in that graph corespond to triplets of stations (AB,BC); if B is a dead end station, then we add (AB,BA) as an edge.
PhD candidate at TU Delft
1 年Absolutely interesting! I would love to see you implement an example of GDP in pyomo (e.g., Unit commitment problem of generators)