libboost, python, and dijkstra shortest path

Discussion in 'Python' started by Bytter, Nov 29, 2006.

  1. Bytter

    Bytter Guest

    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
     
    Bytter, Nov 29, 2006
    #1
    1. Advertising

  2. Bytter

    Bytter Guest

    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" <> wrote:
    > 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
     
    Bytter, Nov 29, 2006
    #2
    1. Advertising

  3. On 29 Nov 2006 11:35:52 -0800, Bytter <> wrote:
    > 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/
     
    Roman Yakovenko, Nov 29, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. ThanhVu Nguyen
    Replies:
    6
    Views:
    5,821
    Karl Heinz Buchegger
    Aug 24, 2004
  2. Webdad
    Replies:
    20
    Views:
    1,912
    Jochus
    Dec 9, 2004
  3. Replies:
    0
    Views:
    357
  4. Hugo Ferreira

    Python Dijkstra Shortest Path

    Hugo Ferreira, May 16, 2007, in forum: Python
    Replies:
    0
    Views:
    924
    Hugo Ferreira
    May 16, 2007
  5. Gabriel Genellina

    Re: Python Dijkstra Shortest Path

    Gabriel Genellina, May 16, 2007, in forum: Python
    Replies:
    0
    Views:
    585
    Gabriel Genellina
    May 16, 2007
Loading...

Share This Page