[SVN r10803]
This commit is contained in:
Jeremy Siek 2001-08-07 20:12:44 +00:00
parent f0b9143ff4
commit fca2523c70
2 changed files with 46 additions and 0 deletions

13
example/tc.dot Normal file
View File

@ -0,0 +1,13 @@
digraph TC {
node[shape=circle];
a
b
c
d
b -> c
b -> d
c -> b
d -> c
d -> a
}

View 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;
}