mirror of
https://github.com/boostorg/graph.git
synced 2025-05-10 07:23:58 +00:00
new file
[SVN r10803]
This commit is contained in:
parent
f0b9143ff4
commit
fca2523c70
13
example/tc.dot
Normal file
13
example/tc.dot
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
digraph TC {
|
||||||
|
node[shape=circle];
|
||||||
|
a
|
||||||
|
b
|
||||||
|
c
|
||||||
|
d
|
||||||
|
|
||||||
|
b -> c
|
||||||
|
b -> d
|
||||||
|
c -> b
|
||||||
|
d -> c
|
||||||
|
d -> a
|
||||||
|
}
|
33
example/transitive_closure.cpp
Normal file
33
example/transitive_closure.cpp
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
// Copyright (c) Jeremy Siek 2001
|
||||||
|
//
|
||||||
|
// Permission to use, copy, modify, distribute and sell this software
|
||||||
|
// and its documentation for any purpose is hereby granted without fee,
|
||||||
|
// provided that the above copyright notice appears in all copies and
|
||||||
|
// that both that copyright notice and this permission notice appear
|
||||||
|
// in supporting documentation. Silicon Graphics makes no
|
||||||
|
// representations about the suitability of this software for any
|
||||||
|
// purpose. It is provided "as is" without express or implied warranty.
|
||||||
|
|
||||||
|
#include <boost/graph/transitive_closure.hpp>
|
||||||
|
#include <boost/graph/graphviz.hpp>
|
||||||
|
|
||||||
|
int main(int, char*[])
|
||||||
|
{
|
||||||
|
using namespace boost;
|
||||||
|
char name[] = "abcd";
|
||||||
|
GraphvizDigraph G;
|
||||||
|
read_graphviz("tc.dot", G);
|
||||||
|
|
||||||
|
std::cout << "Graph G:" << std::endl;
|
||||||
|
print_graph(G, name);
|
||||||
|
|
||||||
|
transitive_closure(G);
|
||||||
|
|
||||||
|
std::cout << std::endl << "Graph G*:" << std::endl;
|
||||||
|
print_graph(G, name);
|
||||||
|
std::cout << std::endl;
|
||||||
|
|
||||||
|
write_graphviz("tc-out.dot", G);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user