By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,713 Members | 764 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,713 IT Pros & Developers. It's quick & easy.

libboost, python, and dijkstra shortest path

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.