Instance files
This is the standard file format for PathWyse instances.
They can also be built programmatically, in both C++ and Python. See Creating an instance programmatically for a Python example.
Properties of instances can be described by defining the problem and the network with either atomic values, sequences or lists.
Only integer values are accepted, that is, if an instance has decimal values, we suggest to scale data beforehand.
Note that there is a strict order in the instance file:
- Problem setup needs to be defined first
- Network setup is defined second
Please refer to the instances provided in the instance folder for examples.
The format for atomic values and sequences is the following:
The format for lists is instead:Problem Setup
| Keyword | Description | Value Type | Example |
|---|---|---|---|
| NAME | instance name | text | An-54 |
| COMMENT | comment | text | example |
| SIZE | number of nodes | integer | 50 |
| DIRECTED | graph is directed | 0 or 1 | 1 |
| CYCLIC | graph presents cycles | 0 or 1 | 0 |
| ORIGIN | source node | integers | 0 |
| DESTINATION | destination node | integers | 17 |
| RESOURCES | number of resources (R) | integers | 3 |
| RES_NAMES | sequence of numerical ids (RES_ID) for each resource. From 0 to R-1 | integers | 0 1 2 |
Note that origin and destination are optional.
If no origin is specified, the solver will assume that node 0 is the origin.
If no destination is reported, PathWyse will duplicate the origin node.
Note that Resource 0 will always be the critical one in bi-directional search.
Example:
NAME : NY
SIZE : 264346
DIRECTED : 1
CYCLIC : 0
ORIGIN : 0
DESTINATION : 17
RESOURCES : 1
RES_NAMES : 0
Network setup
Resources definition
Resource types
This section describes the resource types
Accepted RES_ID values are specified by RES_NAMES.Accepted RES_TYPE values:
| Keyword | Resource | Info |
|---|---|---|
| CAP | Capacity | Demand is collected on nodes only |
| TIME | Time | Can include travel time (arcs) and service time (nodes) |
| NODELIM | Node limit | Limits the length of Paths |
| TW | Time Windows |
Example:
That is:- Resource 0 is of type capacity
- Resource 1 is also a capacity resource
- Resource 2 is a node limit
- Resource 3 enforces time windows
Resource bounds
This section describes the lower and upper bounds for each resource:
Example:This means that:
- Resource 0 has 0 as a lower bound and 25 as an upper bound
- Resource 1 has 0 as a lower bound and 28 as an upper bound
- Resource 2 has 0 as a lower bound and 8 as an upper bound
- Resource 3 has no lower and upper bounds
Resource bounds on nodes
This section describes the lower and upper bounds on each nodes for resources. This is mostly useful for specifying arrival and departure times for time windows:
Example:This means that we are setting node bounds for Resource 3 (time windows, in this example). For example, node 1 expects an arrival time equal or greater than 189 and a departure time of 579.
Edges
Edge cost
Describe the objective function cost for the arc connecting node i to node j:
Example: This means that the arc that goes from node 0 to node 1 (and vice versa, if the network is undirected) costs 43000, whilst arc 0-5 costs 54000, and so on.Edge consumption
This list describes, for each resource, the resource consumption when traveling along the arc from node i to node j:
Example:
This means that travelling from node 2 to node 1, consumes 35 units of Resource 3.
Nodes
Node cost
This list describes the objective function cost for each node:
Example: Meaning that node 1 will cost 12000, whilst node 3 will cost -48402.Node consumption
This list describes, for each resource, the resource consumption at each node:
Example:
This means that:
- Visiting node 1 consumes 5 units of Resource 0, 5 units of Resource 1 and 10 units of Resource 3.
- Visiting node 2 consumes 5 units of Resource 0, 1 unit of Resource 1 and 40 units of Resource 3.
and so on.