]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/graph/example/adjacency_matrix.cpp
1 //=======================================================================
2 // Copyright 1997, 1998, 1999, 2000 University of Notre Dame.
3 // Author: Jeremy G. Siek
5 // Distributed under the Boost Software License, Version 1.0. (See
6 // accompanying file LICENSE_1_0.txt or copy at
7 // http://www.boost.org/LICENSE_1_0.txt)
8 //=======================================================================
9 #include <boost/config.hpp>
11 #include <boost/graph/adjacency_matrix.hpp>
12 #include <boost/graph/graph_utility.hpp>
16 using namespace boost
;
27 const char* name
= "ABCDEF";
31 typedef adjacency_matrix
< directedS
> Graph
;
41 std::cout
<< "vertex set: ";
42 print_vertices(g
, name
);
43 std::cout
<< std::endl
;
45 std::cout
<< "edge set: ";
47 std::cout
<< std::endl
;
49 std::cout
<< "out-edges: " << std::endl
;
51 std::cout
<< std::endl
;
53 // An undirected graph
55 typedef adjacency_matrix
< undirectedS
> UGraph
;
63 std::cout
<< "vertex set: ";
64 print_vertices(ug
, name
);
65 std::cout
<< std::endl
;
67 std::cout
<< "edge set: ";
68 print_edges(ug
, name
);
69 std::cout
<< std::endl
;
71 std::cout
<< "incident edges: " << std::endl
;
72 print_graph(ug
, name
);
73 std::cout
<< std::endl
;