473,387 Members | 1,535 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,387 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 3087
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.