/rl-routing

Primary LanguageJupyter Notebook

RL Routing Env

Open In Colab

RL-routing provides a bandit style environment for routing problems. The environment relies on an underlying networkx graph. This is passed to the environment during construction under the keyword argument graph.
It is recommended to set pos for the nodes to ensure consistent rendering. spring_layout provides a simple api to do this.

e.x.

G=nx.random_internet_as_graph(100)
pos = nx.spring_layout(G)
nx.set_node_attributes(G, pos, "pos")
env = NetworkEnv(graph=G)

The environment follows a simple set of rules:

  • reward is the number of packets to reach their destination during a setp
  • edges are treated as wires
  • one packet may occupy a wire per step

The environment renders to an rgb array. This allows it to be rendered to a matplotlib.pyplot plot, an output gif, or any other format desired. The visualization uses red to indicate that a node or edge is occupied by a packet, blue to show that an edge or node is vacant, or green to show that a packet was successfully routed.

Roadmap

  • implement preprocessing for multi-agent
  • notebook for simple bayesian model on tiny hand crafted network
  • implement preprocessing for SDN routing

Quickstart

The easiest way to get started using rl-routing is to open up the Shortest Path Base Case in Colab. This base case runs you through processing observations, setting up the environment, and creating a shortest path agent.

Citation

Please cite any usage of this repo in research.

bibtex entry:

@misc{lukewood_2020, 
  title={RL Routing},
  url={https://github.com/lukewood/rl-routing},
  publisher={Github},
  author={LukeWood},
  year={2020},
  month={Oct}
}