Note that there are some explanatory texts on larger screens.

plurals
  1. POUsing custom and built-in properties in Boost::Graph
    primarykey
    data
    text
    <p>I am building a graph class based on the following suggestion: <a href="https://stackoverflow.com/questions/671714/modifying-vertex-properties-in-a-boostgraph">Modifying vertex properties in a Boost::Graph</a></p> <p>Unfortunately, I realized an unexpected behavior. When using my own vertex-properties (for simplicity please ignore the edge properties), the built-in properties seem not to be used. So for example, when I have:</p> <pre><code>typedef adjacency_list&lt; setS, // disallow parallel edges listS, // vertex container undirectedS, // undirected graph property&lt;vertex_properties_t, VERTEXPROPERTIES&gt;, property&lt;edge_properties_t, EDGEPROPERTIES&gt; &gt; GraphContainer; </code></pre> <p>I can retrieve my custom properties without any problem, but when I want to retrieve the vertex_index-property I always get the same value for each vertex, meaning a value of 0. The nodes are distinct, which is confirmed by num_vertices(MyGraph). Then I thought that this might be due to missing the built-in properties, so I tried:</p> <pre><code>typedef adjacency_list&lt; setS, // disallow parallel edges listS, // vertex container undirectedS, // undirected graph property&lt;vertex_index_t, unsigned int , property&lt; vertex_properties_t, VERTEXPROPERTIES&gt; &gt;, property&lt;edge_properties_t, EDGEPROPERTIES&gt; &gt; GraphContainer; </code></pre> <p>Again, when wanting to retrieve the index of whatever vertex, I get a value of 0. Is this behavior normal? Does one have to set the built-in properties also, when using custom properties?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload