All Projects → afourmy → swap

afourmy / swap

Licence: MIT license
A Solver for the Wavelength Assignment Problem (RWA) in WDM networks

Programming Languages

CSS
56736 projects
python
139335 projects - #7 most used programming language
javascript
184084 projects - #8 most used programming language
HTML
75241 projects
TeX
3793 projects
Mako
254 projects
Dockerfile
14818 projects

Projects that are alternatives of or similar to swap

Leaflet Search
Search stuff in a Leaflet map
Stars: ✭ 536 (+1885.19%)
Mutual labels:  leaflet, gis
Inloco
A Geographic Information System (GIS) used by Ministério Público do Estado do Rio de Janeiro to show social, institutional and administrative data , based on React and Leaflet, interacting with a GeoServer back-end.
Stars: ✭ 51 (+88.89%)
Mutual labels:  leaflet, gis
Iclient Javascript
Modern GIS Web Client for JavaScript, based on Leaflet\OpenLayers\MapboxGL-JS\Classic(iClient8C), enhanced with ECharts\D3\MapV etc. Contributed by SuperMap & community.
Stars: ✭ 593 (+2096.3%)
Mutual labels:  leaflet, gis
mars2d
【Mars2D平台 】主仓库,包含所有开源仓库清单导航
Stars: ✭ 182 (+574.07%)
Mutual labels:  leaflet, gis
kaliningraph
🕸️ Graphs, finite fields and discrete dynamical systems in Kotlin
Stars: ✭ 62 (+129.63%)
Mutual labels:  graph-algorithms, graph-transformation
Mapview
Interactive viewing of spatial data in R
Stars: ✭ 341 (+1162.96%)
Mutual labels:  leaflet, gis
Mapboard
A framework for data-rich web mapping 🌎📊✨
Stars: ✭ 29 (+7.41%)
Mutual labels:  leaflet, gis
Ui Leaflet
AngularJS directive to embed an interact with maps managed by Leaflet library
Stars: ✭ 315 (+1066.67%)
Mutual labels:  leaflet, gis
Mapstore2
Modern webmapping with OpenLayers, Leaflet and React
Stars: ✭ 251 (+829.63%)
Mutual labels:  leaflet, gis
Leaflet Wfst
OGC WFS-T client layer for Leaflet.
Stars: ✭ 111 (+311.11%)
Mutual labels:  leaflet, gis
Agentmaps
Make social simulations on interactive maps with Javascript! Agent-based modeling for the web.
Stars: ✭ 822 (+2944.44%)
Mutual labels:  leaflet, gis
geog4572
Geovisual Analytics @ Oregon State University
Stars: ✭ 67 (+148.15%)
Mutual labels:  gis, geovisualization
Leaflet Geoman
🍂🗺️ The most powerful leaflet plugin for drawing and editing geometry layers
Stars: ✭ 1,088 (+3929.63%)
Mutual labels:  leaflet, gis
antaresViz
ANTARES Visualizations
Stars: ✭ 19 (-29.63%)
Mutual labels:  leaflet, linear-programming
georaster-layer-for-leaflet
Display GeoTIFFs and soon other types of raster on your Leaflet Map
Stars: ✭ 168 (+522.22%)
Mutual labels:  leaflet, gis
geoscript-py
A Python GeoScript Implementation
Stars: ✭ 52 (+92.59%)
Mutual labels:  gis
Microsoft.SqlServer.Types
a .NET Standard implementation of the spatial types in `Microsoft.SqlServer.Types`
Stars: ✭ 64 (+137.04%)
Mutual labels:  gis
OpenPlot
一款开源的地理信息标绘组件
Stars: ✭ 19 (-29.63%)
Mutual labels:  gis
whiteboxgui
An interactive GUI for WhiteboxTools in a Jupyter-based environment
Stars: ✭ 94 (+248.15%)
Mutual labels:  gis
Flask-Validator
Validator for SQLAlchemy Models
Stars: ✭ 27 (+0%)
Mutual labels:  sqlalchemy

Build Status Coverage Status

Swap

In optical networks, the Wavelength Divison Multiplexing (WDM) technology is used to increase the capacity of fibers to transmit information, by splitting a beam of light into different wavelengths, which travel simultaneously.

Wavelength Divison Multiplexing

In an all-optical network, a wavelength can cross an optical switch without Optical-Electrical-Optical (OEO) conversion. While this is a step forward towards cheaper and "greener" networks, a trade-off is that there has to be an end-to-end "wavelength continuity": a wavelength stays the same from the source edge to the destination edge, and it cannot be used by different lightpaths on the same optical fiber.

The wavelength allocation problem consists in finding the minimum number of wavelengths that are required, and how to allocate them to lightpaths.

Swap is a solver for the Routing and Wavelength Assignment Problem (RWA).

Swap: Europe

Two methods were implemented to solve the wavelength assignment problem:

  • Linear programming (optimal solution)
  • "Largest degree first" heuristic

You can find a demo of Swap applied to the BBN Planet backbone in the USA:

BBN Planet backbone

A first example

Let's consider a situation with 5 optical switch in a line, and 5 traffic paths:

Simple graph (image from Linear Programming and Algorithms for Communication Networks by Eiji Oki)

Naive strategy: assign wavelengths in increasing order of path index

We will assign wavelength sequentially in increasing order of the traffic paths indices, and always choose the smallest available wavelength index.

We write the n-th wavelength Ln (lambda x), and the n-th path Pn.

  • L1 is assigned to P1
  • We cannot reuse L1 for P2, because P1 and P2 have a link in common. Therefore, L2 is assigned to P2.
  • P3 uses all four fibers: we need a new wavelength L3.
  • P4 does not share any fiber with P1 or P2: we choose the smallest available wavelength index: L1.
  • Finally, P5 shares fibers with P2, P3 and P4: we need to use a new wavelength L4.

With this naive strategy, 4 wavelengths are required. The resulting assignment is the following:

Naive strategy (image from Linear Programming and Algorithms for Communication Networks by Eiji Oki)

Another strategy: assign wavelengths in decreasing order of overlapping fibers

Another strategy consists in assigning wavelengths sequentially in decreasing order of the number of other paths with overlapping fibers:

  • P3 shares fibers with all 4 paths
  • P2 and P5 share fibers with 3 paths.
  • P1 and P4 share fibers with 2 paths.

Therefore, we assign wavelengths sequentially in the following order of paths: P3, P2, P5, P1, P4:

  • L1 is assigned to P3
  • L2 is assigned to P2 (common fiber with P3)
  • L3 is assigned to P5 (common fiber with P3 and P2)
  • L3 can be reassigned to P1 (common fiber with P3 and P2, but not P5)
  • L2 can be reassigned to P4 (common fiber with P3 and P5, but not P2)

With this new strategy, 3 wavelengths are required. The resulting assignment is the following:

Improved strategy (image from Linear Programming and Algorithms for Communication Networks by Eiji Oki)

The number of wavelengths required depends on the order in which wavelengths are assigned to the traffic paths.

The Wavelength Assignment Problem aims at minimizing the number of wavelengths.

Algorithms

To solve the RWA, we consider that the traffic paths are known a priori, and that they all use the shortest distance path. This is called the Static Lightpath Establishment Routing and Wavelength Assignment problem (SLE RWA).

The SLE RWA is NP-complete, it can be reduced to a graph coloring problem with a simple graph transformation, as demonstrated below.

To solver the SLE RWA, we will go through the following steps:

  • Routing: for each path, we must find the shortest path. Instead of using Dijkstra algorithm, Swap uses the integer linear programming formulation of the shortest path problem for the routing process. The metric used to find the shortest path is the geographic distance, calculated with the Haversine formula.
  • Graph transformation: we create a new graph based on the optical network to turn the wavelength assignment process into a graph coloring problem.
  • Wavelength assignment: finally, we propose two algorithms to assign wavelengths: linear programming and the "Largest Degree First" heuristic.

Find the shortest path with linear programming

SP1

SP2

Reduction to a graph coloring problem

We can reduce the Wavelength Assignment Problem to a graph coloring problem with a simple graph transformation:

  • Each traffic path is considered a vertex
  • If two traffic paths share (at least) one fiber, they are connected with an edge.

Let's apply the graph transformation to our first example:

  • There are five vertices in the transformed graph
  • The following couples of paths share a fiber: (P1, P2), (P1, P3), (P2, P3), (P2, P5), (P3, P4), (P3, P5), (P4, P5). Their associated vertices are connected with an edge in the transformed.

We obtain the following result:

Find the optimal wavelength assignment with linear programming

LP1

LP2

LP graph

LP network

"Largest degree first" heuristic

The linear programming solution, while it always yields an optimal solution, is not scalable: it cannot be applied to large networks. The "Largest degree first" is a simple heuristic that assigns colors in decreasing order of vertex degree in the transformed graph:

  1. Find the uncolored vertex with largest degree
  2. Assign the minimum indexed color not yet used by adjacent vertices.
  3. Repeat step 1 and 2 until all vertices are colored.

LDF heuristic graph

LDF heuristic network

Similar projects you might be interested in:

Installation

(Optional) Set up a virtual environment

1. Get the code

git clone https://github.com/afourmy/swap.git
cd swap

2. Install requirements

pip install -r requirements.txt

3. Set the FLASK_APP environment variable

(Windows) set FLASK_APP=app.py
(Unix) export FLASK_APP=app.py

4. Run the application

flask run --host=0.0.0.0

5. Go the http://127.0.0.1:5000/

6. Create an account and log in

Run swap in a docker container

1. Download & run the container

docker run -d -p 5000:5000 --name swap --restart always afourmy/swap

2. Go to http://127.0.0.1:5000

3. Create an account and log in

Credits

Linear Programming and Algorithms for Communication Networks by Eiji Oki.

Leaflet: JavaScript library for mobile-friendly interactive maps.

Leaflet-polyline: A leaflet plugin to define patterns on Polylines.

Vis: A dynamic, browser based JavaScript visualization library.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].