[Soc] TDSP implementation for pgRouting Weekly Report

Jay Mahadeokar jai.mahadeokar at gmail.com
Fri Jun 10 13:28:01 EDT 2011


Hi,

Weekly Report #3:  (Also available at [1])
Date - 10th June 2011

According to project plan [2]:
-----------------------------------------------------------------------------------------------------------------------------------------
Finish the design of project, and the core-time dependent shortest path
implementation and test the code with dummy data till 15 June.


Current Progress:
------------------------------------------------------------------------------------------------------------------------------------------
I had coded and tested the core-tdsp algorithm such that it returns the
distance-map and predecessor-map for given source.
This week I wrote a wrapper function which does the following task:
- Takes edges, weight_map_elements, source and target vertices as
parameters.
- Generates boost adjacency graph, weight_map and passes it to the tdsp_core
function.
- tdsp_core returns the distance_map and predecessor_map corresponding to
source.
- The wrapper function now generates the path from source to destination,
and returns path_elements as result.


I tested this for different source-destination pairs and it seems to be
working for now. Bugs need to be discovered with more
rigorous testing and fixed in coming weeks.


------------------------------------------------------------------------------------------------------------------------------------
Next week goals:
Finalize the prototype for the postgreSQL query for tdsp.
How to formulate the query for retrieving data from the timeDependentCost
table (used to generate the weight_map) is still under debate
on pgRouting mailing list. We are considering various options like letting
the user provide the query, or form the query ourselves
and the pros and cons of both approaches.

We hope to find a viable solution for the same asap and start working
towards implementing the same.

[1]
https://github.com/jay-mahadeokar/GSoc-2011-Project-Docs/blob/master/weekly-reports/10-Jun-2011
[2]https://github.com/pgRouting/pgrouting/wiki/TDSP-Tentative-Project-Plan

Regards,

On Fri, Jun 3, 2011 at 10:40 PM, Jay Mahadeokar <jai.mahadeokar at gmail.com>wrote:

> Hi,
>
> Here is my weekly report #2. Also available at [1].
> Date - 3rd June 2011
>
> According to tentative project plan [3]:
>
> -----------------------------------------------------------------------------------------------------------------------------------------
> Finish the design of project, and the core-time dependent shortest path
> implementation and test the code with dummy data till 15 June.
>
>
> Current Progress:
>
> ------------------------------------------------------------------------------------------------------------------------------------------
> I had implemented initial draft of the core time-dependent algorithm in 1st
> week. I fixed a few bugs that were there in the initial draft.
>
> Organised the code into different header files - binary_heap.h,
> weight_map.h, edge_wrapper.h.
>
> Added a boost - dijkstra test function which calls
> boost::dijkstra_shortest_paths() so as to verify the result.
> Also, wrote a graph generator which can generate random graphs according to
> the parameters specified:
> - number of vertices
> - maximum outdegree of a vertex (I keep this 6 or 8 , since 6 is degree
> limit for planar graphs)
> - Number of time windows and the range of time windows.
>
> So, to see if the result returned by tdsp-dijkstra function is correct,  I
> generated random graphs with time window 1, which starts from 0, meaning
> that the same travel time will be there for any given start time. This is
> basically static dijkstra.
>
> I compared the results returned by tdsp-dijkstra and boost-dijkstra and I
> am getting same output. Tried for graphs with 20,100,500,1000 nodes with max
> outdegree 8. (generating graphs with nodes more than that was taking too
> much time and my CPU was getting overworked!)
>
> Only difference in boost-output and tdsp-output comes when there are more
> than one shortest paths of same length. The there might be difference of
> predecessors. I guess that is because of different implementations of
> priority queue (binary_heap in my case).
>
> I have updated the code in gsoc-tdsp branch: [2]. Please review, any
> comments are welcome.
>
> Also, the actual time-dependent functionality i.e multiple time windows
> needs to be tested for real world large graphs. To do this, we are planning
> to generate time dependent data ourselves corresponding to the static data
> available in pgRouting-workshop database, since such data is not freely
> available as far as our knowledge.
>
> Some of the options for this data generation (according to discussions in
> pgrouting-dev list)are:
>
> - Generate random data (That would take most extreme test cases into
> account)
> - If we think about "rush hour" around a major city, the highways (based on
> road class) flowing into the city in the morning would get reduced average
> speeds you could apply curve like average speed*percent based on 6am (90%),
> 7am(75%), 8am(45%), 9am(50%), 10am(85%) and do something similar in the
> evening rush. It might be too hard to figure on direction of flow in/out
> bound so apply the curve to all traffic. The assumption is that the highways
> are congested which will force traffic onto side streets. We can also reduce
> the lower class speeds by say a constant 80% during rush hour.
>
>
>
>
> ------------------------------------------------------------------------------------------------------------------------------------
> Next week goals:
>
> * Generate the time-dependent data corresponding to the data in
> pgRouting-workshop as planned above.
> * Start working on writing postgreSQL C function that will call the
> core-time dependent function.
> * Keep testing the core function, find bugs if any, and fix them.
>
> [1]
> https://github.com/pgRouting/pgrouting/wiki/Time-dependent---Dynamic-Shortest-Path
> [2] https://github.com/pgRouting/pgrouting/tree/gsoc-tdsp
> [3]
> https://github.com/pgRouting/pgrouting/wiki/TDSP-Tentative-Project-Plan
> --
> Regards,
> -Jay Mahadeokar
>
>


-- 
Regards,
-Jay Mahadeokar
II Year, MTech,
CSE, IIT Kanpur.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/soc/attachments/20110610/f6af7b06/attachment.html


More information about the SoC mailing list