libboost, python, and dijkstra shortest path

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Bytter

    #1

    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

  • Bytter

    #2
    Re: libboost, python, and dijkstra shortest path

    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_verte x()
    b = graph.add_verte x()
    e = graph.add_edge( a, b)

    weights = graph.edge_prop erty_map('integ er')
    weights[e] = 5
    graph.edge_prop erties['weight'] = weights

    boost.dijkstra_ shortest_paths( graph, a)


    On Nov 29, 5:51 pm, "Bytter" <byt...@gmail.c omwrote:
    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

    Comment

    • Roman Yakovenko

      #3
      Re: libboost, python, and dijkstra shortest path

      On 29 Nov 2006 11:35:52 -0800, Bytter <bytter@gmail.c omwrote:
      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_verte x()
      b = graph.add_verte x()
      e = graph.add_edge( a, b)
      >
      weights = graph.edge_prop erty_map('integ er')
      weights[e] = 5
      graph.edge_prop erties['weight'] = weights
      >
      boost.dijkstra_ shortest_paths( graph, a)
      You'd better ask the question on boost.python or boost-users mailing lists:


      --
      Roman Yakovenko
      C++ Python language binding

      Comment

      Working...