Request for QuickGraph Routing Help

Topics: algorithm, graph
Oct 27, 2009 at 10:33 AM


I am new in QuickGraph i got a task to implement Shortest Path Algorithm. I search the net for code help but i did not found anything.

I really do not know how QuickGraph work I need to calculate Shortest path from SHP file.

I really be grateful if any one help me.

Thanks in advance...

Oct 29, 2009 at 6:42 AM

Please Help !!!!!


Oct 29, 2009 at 7:37 PM

  Dear barman,

You do not provide a very exact description of your problem.

I have Googled for the term "SHP file" and found several different meanings.

Apparently it is a file format for geographical data (maps).

QuickGraph does not support such a file format.

It does contain a shortest path algorithm that may be useful to you.

You'd have to write code to import an SHP file.

What makes you think using QuickGraph is a good approach to your problem?



Nov 29, 2009 at 12:50 AM

Hi barman,  as rp mentionned, please provide a link that describes the SHP file format.


Jan 8, 2010 at 9:30 PM

Hello barman,

i had similar thing to do in the past and i have implement it with Quickgraph, a very simple way to manage your shapefile is to insert it in a spatial database (so youll keep all the geometry and youll be able to do operation on them later if needed), Then just use the database entries to initialize you dijkstra algorith. The advantage of doing this is probably that all operations that youll do on geometry will be lot easier and also youll be able to add/correct/specialize/update the shapefile as you want. Be sure to keep your sql script or dump that generate your database from the shapefile since it is very usefull when they update the data. If you dont see the utilities of the spatial database youll change your mind when youll have to compute the weight of the edge, reverse edge geometry or do operation on them.

these a lot of database that got spatial database, as a free example PostGis can be use as spatial module of PostGre.

have a nice day

Jan 14, 2010 at 3:43 AM

Hi graphTest,

            Thank you for your response. You are right this problem can easily handle with Spatial Database but my requirement is to do the job with SHP files I can not use the spatial database.

            Now present status is the shortest path is implemented using SHP files. But now I am stuck in serialization problem the detail is posted in the discussion forum with a sample file below is the link.


Thanks you again and I am awaiting for your response.