The Boost Graph Library by Jeremy Siek & Lie-Quan Lee & Andrew Lumsdaine

The Boost Graph Library by Jeremy Siek & Lie-Quan Lee & Andrew Lumsdaine

Author:Jeremy Siek & Lie-Quan Lee & Andrew Lumsdaine
Language: eng
Format: epub
Publisher: Addison-Wesley
Published: 2010-03-14T16:00:00+00:00


u = vertex(0, digraph);

v = vertex(1, digraph);

add_edge(u, v, Weight(1.2), digraph);

add_edge(v, u, Weight(2.4), digraph);

tie(e1, found) = edge(u, v, digraph);

tie(e2, found) = edge(v, u, digraph);

std::cout << "in a directed graph is ";

std::cout << "(u,v) == (v,u) ? "

<< std::boolalpha << (e1 == e2) << std::endl;

std::cout << "weight[(u,v)] = " << get(weight, e1) << std::endl;

std::cout << "weight[(v,u)] = " << get(weight, e2) << std::endl;

}

The output is

in a directed graph is (u,v) == (v,u) ? false

weight[(u,v)] = 1.2

weight[(v,u)] = 2.4



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.