diff --git a/example/tc.dot b/example/tc.dot new file mode 100644 index 00000000..39c42941 --- /dev/null +++ b/example/tc.dot @@ -0,0 +1,13 @@ +digraph TC { + node[shape=circle]; + a + b + c + d + + b -> c + b -> d + c -> b + d -> c + d -> a +} diff --git a/example/transitive_closure.cpp b/example/transitive_closure.cpp new file mode 100644 index 00000000..4e553218 --- /dev/null +++ b/example/transitive_closure.cpp @@ -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 +#include + +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; +}