Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_34_1/libs/graph/example/leda-graph-eg.cpp @ 30

Last change on this file since 30 was 29, checked in by landauf, 17 years ago

updated boost from 1_33_1 to 1_34_1

File size: 1016 bytes
Line 
1//=======================================================================
2// Copyright 2001 Jeremy G. Siek, Andrew Lumsdaine, Lie-Quan Lee,
3//
4// Distributed under the Boost Software License, Version 1.0. (See
5// accompanying file LICENSE_1_0.txt or copy at
6// http://www.boost.org/LICENSE_1_0.txt)
7//=======================================================================
8#include <boost/graph/leda_graph.hpp>
9#include <iostream>
10#undef string                   // LEDA macro!
11int
12main()
13{
14  using namespace boost;
15  typedef leda::GRAPH < std::string, int >graph_t;
16  graph_t g;
17  g.new_node("Philoctetes");
18  g.new_node("Heracles");
19  g.new_node("Alcmena");
20  g.new_node("Eurystheus");
21  g.new_node("Amphitryon");
22  typedef property_map < graph_t, vertex_all_t >::type NodeMap;
23  NodeMap node_name_map = get(vertex_all, g);
24  graph_traits < graph_t >::vertex_iterator vi, vi_end;
25  for (tie(vi, vi_end) = vertices(g); vi != vi_end; ++vi)
26    std::cout << node_name_map[*vi] << std::endl;
27  return EXIT_SUCCESS;
28}
Note: See TracBrowser for help on using the repository browser.