PLEASE KEEP THIS THREAD ON-TOPIC
---
Let's make some definitions first so we know what we're talking about.
- Route: Two connected stations. (i.e. two railway stations with track between them or two harbours which are reachable over water. All airports are connected.)
- Connected: Two stations s and t are directly connected, if there is a piece of track between them on which vehicles can get from the one station to the other. Two stations s and t are indirectly connected if there is a station r for which the following holds:
- s is connected (directly or indirectly) to r and r is connected to t.
- Service: A route on which some type of cargo is transported. (e.g. a passenger service between two busstops in a city.)
Strange people in Locomotion. Eventhough there is nothing in the catchment area's of the stations, people manage to find them.
In the picture:
- There is a route from A to B.
- A is directly connected to B.
- B is directly connected to C.
- C is directly connected to D.
- A is indirectly connected to C and D. (and vice-versa)
- There is a passenger service from B to C and there is a passenger service from C to D.
Obviously, we could search for routes or for services. I propose the setup given in the following subsections. Feel free to give comments.
Finding services
I chose this one first, because it's the most obvious. Consider a graph G=(V,E,L), where V is a set of vertices, which will be all stations. E is the set of edges, where an edge e=(v1,v2), a directed connection between two stations. L is a labelling function over the set E of edges where L(e) is a subset of all track types.
The following image shows an example:
There is a piece of bidirectional railroad track with two stations, "A" and "B". Then, we have:
- V = {A, B}
V is the set of vertices, vertices represent the stations. - E = {(A, B), (B, A)}
E is the set of edges, edges represent routes. Because the piece of track is bidirectional, there are two edges: one from A to B and one from B to A. - L(A, B) = {Rail}, L(B, A) = {Rail}
L assigns a set of labels to each edge. Each label represents a track type. In this case, both edges represent a piece of railroad track.
- S(A, B) = {Coal}, S(B, A) = {Coal}
So now we have a list of reachable stations using the current services. This way, cargo can be offered for destinations that do not have direct services, but do have services with several transfers.
Finding routes
Consider the same graph G=(V,E,L) as in the Finding services section.
An industry x wants to transport cargo to another industry y.
In addition to stations connected with services, we now also consider stations that are connected, but do not have a service for the desired cargo type between them.
In the same way as described for services, a route can be found between two stations or a list of all reachable stations for a given station. Now, suppose industry x is in the catchmentarea of station A and industry y is in the catchmentarea of station B. Industry x will check the list of station A and notice that there is a route to station B, which has industry y in its catchment area. However, there is no service for the desired cargo type between them.
Perhaps Finding routes should be an optional feature, but what if industry a asks the player to provide a service of the desired cargo type between A and B? This can lead to more subsidies/contracts which are more interesting.