473,233 Members | 3,722 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,233 software developers and data experts.

libboost, python, and dijkstra shortest path

Hi everyone,

I need to implement a very quick (performance-wise) Dijkstra shortest
path in python, and found that libboost already has such thing. Problem
is: I cannot find the installation package for my Python 2.4 under
windows. Can someone please provide me instructions for installing
libboost for python?

In alternative, if someone can point out to a fast Dijkstra shortest
path in python (the network is over 1 million vertexes), I would
appreciate.

Thanks in advance,

Hugo Ferreira

Nov 29 '06 #1
2 3082
Ok, found the solution here: http://www.osl.iu.edu/~dgregor/bgl-python/

But still cannot make anything that works... Anyone who has experience
in this area can help me with the following code:

import boost as bgl

graph = bgl.Graph()
a = graph.add_vertex()
b = graph.add_vertex()
e = graph.add_edge(a, b)

weights = graph.edge_property_map('integer')
weights[e] = 5
graph.edge_properties['weight'] = weights

boost.dijkstra_shortest_paths(graph, a)
On Nov 29, 5:51 pm, "Bytter" <byt...@gmail.comwrote:
Hi everyone,

I need to implement a very quick (performance-wise) Dijkstra shortest
path in python, and found that libboost already has such thing. Problem
is: I cannot find the installation package for my Python 2.4 under
windows. Can someone please provide me instructions for installing
libboost for python?

In alternative, if someone can point out to a fast Dijkstra shortest
path in python (the network is over 1 million vertexes), I would
appreciate.

Thanks in advance,

Hugo Ferreira
Nov 29 '06 #2
On 29 Nov 2006 11:35:52 -0800, Bytter <by****@gmail.comwrote:
Ok, found the solution here: http://www.osl.iu.edu/~dgregor/bgl-python/

But still cannot make anything that works... Anyone who has experience
in this area can help me with the following code:

import boost as bgl

graph = bgl.Graph()
a = graph.add_vertex()
b = graph.add_vertex()
e = graph.add_edge(a, b)

weights = graph.edge_property_map('integer')
weights[e] = 5
graph.edge_properties['weight'] = weights

boost.dijkstra_shortest_paths(graph, a)
You'd better ask the question on boost.python or boost-users mailing lists:
http://boost.org/more/mailing_lists.htm

--
Roman Yakovenko
C++ Python language binding
http://www.language-binding.net/
Nov 29 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

17
by: Tim Daneliuk | last post by:
Is anyone aware of freely available Python modules that can do any of the following tasks: 1) Given the latitude/longitude of two locations, compute the distance between them. "Distance" in...
6
by: ThanhVu Nguyen | last post by:
Hi all, I need recommendation for a very fast shortest path algorithm. The edges are all directed, positive weights. Dijkstra shortest path will solve it just fine but the if the graph is not...
3
by: A_StClaire_ | last post by:
implemented Dijkstra's algorithm as follows. plz pour on the negative criticism cuz I know I have a ton to learn. oh, before you flame me regarding the language, my class was told to do this in...
3
by: Ook | last post by:
This is probably a bit OT, as I'm not looking for a c++ implementaiton of Dijkstra's algorithm, rather I'm just trying to understand it (is there a better place then here to ask this question?)....
1
by: arlef | last post by:
Can somebody please explain and provide pseudocode for the Dijkstra algorithm? I'm trying to implement the Dijkstra shortest path algorithm. However, I'm finding it extremely difficult to...
8
by: abhradwip | last post by:
I want to write a program which will find the shortest path between n no. of cities using dijkstra's algorithm ...... but could not do it..... i have written a program which will give the shortest...
2
by: Gurpreet Singh | last post by:
Hello everyone can anybody give me the c-code of dijkstra algorithm which is a method of finding the shortest path in a graph
0
by: Hugo Ferreira | last post by:
While trying to optimize this: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/119466 .... and still have a fast edge lookup, I've done the following tweaks: class PathFind(object):...
1
Ganon11
by: Ganon11 | last post by:
Hey guys, I'm back, and with another FUN question! My latest homework asks this question: "Suppose all the edge weights in a graph are integers between 1 and |E|. How fast can Dijkstra's...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.