Mapper let's users visualize datasets (problem instances) and solutions (routes) that are formatted according to the Vehicle Routing Problem REPository (VRP-REP) specifications.
More about VRP-REP and the specification can be found on our website.
In this readme:
- How to use Mapper if you don't have your own data
- How to use Mapper if you do have your own data
- Toggling route display
- The VRP-REP solution format
If you don't already have VRP-REP compliant datasets or solutions, select "Sample data".
From here, select "Plot sample dataset and solution" to view the Christofides et al. (1979) CMT01 instance and its solution.
You can also choose to download the source files for sample data using the "Download" button.
If you have your own VRP-REP compliant instances and solutions, then from the Mapper landing page, first select "Upload instance" to browse to and select a VRP-REP compliant dataset.
Once you have uploaded an instance, the upload solution functionality becomes available. Select "Upload solution."
From the modal that appears, you have two options to input a solution (a route or set of routes):
- You may select "Browse" to select a VRP-REP compliant solution, or
- You may simply input a sequence of integers into the text field. This sequence of integers should be separated either by commas or whitespace. After you input a sequence, hit the "Plot" button.
Note that whenever a new solution is uploaded or a new route is entered, the existing routes will be cleared.
If you have uploaded a solution file that contains more than one route, you can toggle the display of the routes by clicking on the routes' legend entries.
The XML schema defining the VRP-REP solution format is available here.
A description of the format:
-
The root element must be a
<solution>
element, and it must contain a string attribute identifying theinstance
(method
is optional). -
Within
<solution>
must be at least one<route>
element with a mandatory and uniqueid
attribute (integer).<route>
elements may also contain any other attributes you want to add. For example, if your file reports the solution to a VRP with a limited fleet, you can add an attributevehicle_id='X'
to the<route>
element, indicating that the route is serviced by vehicle 'X'. -
Within
<route>
must be at least 2<node>
s, each with a mandatoryid
attribute (integer).<node>
elements may contain any child elements you wish to add. For example, if your file reports the solution to a VRP with split delivery, you can add to the<node>
element a<quantity>X</quantity>
child, indicating that the route services X units of the node's demand.
A sample solution file:
<?xml version="1.0" encoding="UTF-8"?>
<solution instance="CMT01">
<route id="1">
<node id="51"/>
<node id="46"/>
<node id="5"/>
<node id="49"/>
<node id="10"/>
<node id="39"/>
<node id="33"/>
<node id="45"/>
<node id="15"/>
<node id="44"/>
<node id="37"/>
<node id="12"/>
<node id="51"/>
</route>
<route id="2">
<node id="51"/>
<node id="11"/>
<!-- other stops in route 2 -->
</route>
<!-- routes 3, 4, and 5 -->
</solution>