Note that there are some explanatory texts on larger screens.

plurals
  1. POBGL: Example of isomorphism with vertex invariants
    primarykey
    data
    text
    <p>can someone show me an example of how to use the Boost Graph Library isomorphism function with vertex invariants? I'm looking at the example at <a href="http://www.boost.org/doc/libs/1_50_0/libs/graph/example/isomorphism.cpp" rel="nofollow">http://www.boost.org/doc/libs/1_50_0/libs/graph/example/isomorphism.cpp</a>, which uses degree_vertex_invariant(). However, I want to define my own invariant function and an example would really help me to understand how to do this.</p> <p>Here are some more details:</p> <p>I am defining a set of discrete attributes on vertices such that I can label each vertex with an integer. So I have a mapping from any vertex(g,v) to its invariant label, which is an unsigned int. These labels are not necessarily unique, i.e. several vertices in the same graph can share the same label. So suppose I define a function:</p> <pre><code>template &lt;typename Graph&gt; unsigned discrete_vertex_invariant(const typename boost::graph_traits&lt;Graph&gt;::vertex_descriptor &amp;v, const Graph &amp;g) </code></pre> <p>I want to call isomorphism like this:</p> <pre><code>typename property_map&lt;Graph, vertex_index_t&gt;::type v1_index_map = get(vertex_index, g1), v2_index_map = get(vertex_index, g2); vector&lt;typename graph_traits&lt;Graph&gt;::vertex_descriptor&gt; f(num_vertices(g1)); bool is_isomorphic = isomorphism(g1, g2, isomorphism_map(make_iterator_property_map(f.begin(), v1_index_map, f[0])), discrete_vertex_invariant, discrete_vertex_invariant )) </code></pre> <p>... but I get an error:</p> <pre><code>no matching function for call to ‘isomorphism( ... &lt;unresolved overloaded function type&gt;, &lt;unresolved overloaded function type&gt;)’ </code></pre> <p>What is the correct way to define discrete_vertex_invariant()?</p>
    singulars
    1. This table or related slice is empty.
    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