Boost logo

Boost Users :

From: Alejandro Marcos Aragón (aaragon2_at_[hidden])
Date: 2007-04-25 15:40:59


I was wondering if someone could give me a tip on how to construct the
following graph. The problem is that the queue type definition does not
know what "edge" is until the type definition for the graph is created.
Is there a way to get around this?

Thank you

#include <boost/graph/adjacency_list.hpp>
#include <queue>

// Type definition for a priority queue of (double,edge) pairs
typedef std::priority_queue<std::pair<double,int> > edge_queue;

struct vertex_edge_priority_t {
    typedef vertex_property_tag kind;
};

// Vertex properties:
typedef property < vertex_edge_priority_t, edge_queue
> domainVertexProperty;

// Edge propeties:
typedef property < edge_index_t, int,
        property < edge_weight_t, double > > domainEdgeProperty;

// Graph used to represent possible vertices and edges within the domain.
typedef adjacency_list<
    setS,
    vecS,
    undirectedS,
    domainVertexProperty,
    domainEdgeProperty
> domainGraph;

typedef graph_traits<domainGraph>::edge_descriptor edge;


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net