- Unzip the zipped file RouteOptimizer.zip
- Open the file RouteOptimizer as a project in Intellij
- In Intellij, Build > Build Project
- Select the Dockerfile
- Click the green arrows Run On Docker
You may specify the source, query and output file names as command line arguments.
The application takes in two files named queries.txt and source.txt.
source.txt is the source file and should contain a single line denoting the list of routes between two towns delimited by spaces
e.g. AB5 BC4 CD8 DC8 DE6 AD5 CE2 EB3 AE7
queries.txt is the query file and should contain one or more lines denoting a query. A query is composed of a command, a list of town names and depending on the command, a number.
e.g. dst A B C D
This query returns the distance of a route that spans the given list of towns.
Graph: AB5 BC4 CD8 DC8 DE6 AD5 CE2 EB3 AE7
Route: A E B C D
Query: dst A E B C D
Returns: 22
This query returns the number of routes that start at one town and end at another with a maximum of k stops.
Graph: AB5 BC4 CD8 DC8 DE6 AD5 CE2 EB3 AE7
Start Town: C
End Town: C
k: 3
Query: rcs C C 3
Returns: 2
This query returns the number of routes that start at one town and end at another with exactly k stops.
Graph: AB5 BC4 CD8 DC8 DE6 AD5 CE2 EB3 AE7
Start Town: A
End Town: C
k: 4
Query: rce A C 4
Returns: 3
This query returns the shortest route between two towns.
Graph: AB5 BC4 CD8 DC8 DE6 AD5 CE2 EB3 AE7
Start Town: A
End Town: C
Query: src A C
Returns: 9
This query returns the number of different routes from one town to another with a distance of less than k.
Graph: AB5 BC4 CD8 DC8 DE6 AD5 CE2 EB3 AE7
Start Town: C
End Town: C
k: 30
Query: rcd C C 30
Returns: 7