'Which OpenAI gym environment should be used for solve the shortest route problem?
I am trying to fine the shortest route between two nodes using reinforcement learning. I am not sure what environment to use. I have found this particular environment and am not sure if I am going in the right direction. Can anybody please help. Can anybody please suggest a few python OpenAI gym environments I can use.
Solution 1:[1]
I am trying to do the same things too. But currently, none of open-sourced OpenAI gym environments is applicable. So I suggest you create your own environment (it is not too hard). Here is what I found:
- https://github.com/hubbs5/or-gym They have multiple environments for combinatorial optimization, but all environments have fixed formats. So if you want to use your own graph this might not be suitable.
- https://github.com/Velythyl/route-gym It can use your own network graph as an environment and the graph can be weighted. But it will take a long time to initialize the graph since they are trying to find out all possible paths to build a reward function metric. So a large graph is not able to use in this env. Also,
check_env
in stablebaseline3 for this environment will warn you thestate
/observation_space
forstep()
andreset()
are not work well. - https://github.com/pmarszal/AIRouting This environment can work for most of the simple graphs. But it did not consider the weights of each edge in the graph.
- https://core.ac.uk/download/pdf/334949709.pdf The OpenGraphGym. It seems to be an ideal solution for our problem, but I can't find its open-source code.
- https://github.com/dnoursi/gym-graph-search It can only give you randomly generated graph with no weights.
- https://github.com/dyllanwli/GraphRouteOptimizationRL/tree/master/src/gym_graph_map Here is what I am trying to do: use a real-world map provider Osmnx (in a network format) to generate an environment to let the agent find the best route with custom weights (not finish yet)
Solution 2:[2]
I'm trying to implement a Graph env, too, and in particular I'd like to use RLLib + Pytorch Geometric to learn generic problems on graphs. So far, I found exactly the same repos mentioned by @Dylan in their answer, but I also found a fork of the OpenGraphGym (removed by authors) at https://github.com/NJannasch/OpenGraphGym.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Dylan |
Solution 2 | richardec |