Graph Building OTP 2 vs OTP 1

161 views
Skip to first unread message

Alphounet

unread,
Nov 14, 2021, 4:06:15 PM11/14/21
to OpenTripPlanner Users
Hi,  after several researches I found some indication regarding the graph building in OpenTripPlanner 1. 


But in preparation for a project at my university , i would like to know if there are differences between the graph building ( street network, transit network) from OTP 1 to OTP 2 .
If yes, a link pointing to the informations or an explanation about graph building in OTP 2 below would be welcomed

Alphounet

unread,
Nov 30, 2021, 8:59:49 AM11/30/21
to OpenTripPlanner Users
Little updates about my questions.
I found out OTP 2 differs from OTP1 especially on transit network. So I suppose that the street network is essentially the same between both versions.
Moreover Raptor algorithm used to transit network is not Dijkstra-based. It doensn't need a graph representation to find best journey. Finally I do not find specific edges ( except pre-aboard ) on the source code ( OTP 2)

My question is the following :  Is there a transit graph on OTP 2 ?

Andrew Byrd

unread,
Dec 6, 2021, 3:49:07 AM12/6/21
to Alphounet, opentrippl...@googlegroups.com
Hello,

I just wanted to confirm that your conclusions are correct: OTP2 uses the same street network representation as OTP1, but the scheduled transit network representation (and the router that uses it) have been changed. In OTP1 both the street and transit networks use a graph representation materialized as an object graph in memory: each street intersection, as well as various states of being on transit are represented as node objects connected together with edge objects.

In OTP2 this is still the case for the streets, but the transit data is stored in a much more compact tabular format appropriate for the Raptor algorithm. This is reusing some table data structures that already existed in OTP1 but were attached to graph nodes and edges. Now those tables are used directly, viewed through an interface that is appropriate for Raptor. You should no longer see any of the on-board-transit edges in graphs produced by OTP2.

The literature on the Raptor algorithm makes some strong statements about it not being a graph algorithm - this is true in the sense that it does not operate on a materialized object graph. But it's reasonable to say it's still a graph algorithm (different than Dijkstra's), it's just using a very compact and cache-efficient graph representation that is made possible by the fact that each transit stop on a route has at most one incoming edge and one outgoing edge to the previous and next stops on the route, so memory address adjacency can be used to imply graph adjacency.

Hope this helps,
Andrew

-- 
You received this message because you are subscribed to the Google Groups "OpenTripPlanner Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to opentripplanner-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/opentripplanner-users/ae15deb2-ae9c-49ab-9cfc-8c0f8dfbfc23n%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages