directed_graph.html 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <HTML>
  2. <!--
  3. Copyright (c) David Doria 2012
  4. Distributed under the Boost Software License, Version 1.0.
  5. (See accompanying file LICENSE_1_0.txt or copy at
  6. http://www.boost.org/LICENSE_1_0.txt)
  7. -->
  8. <Head>
  9. <Title>Boost Graph Library: Directed Graph</Title>
  10. <BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
  11. ALINK="#ff0000">
  12. <IMG SRC="../../../boost.png"
  13. ALT="C++ Boost" width="277" height="86">
  14. <BR Clear>
  15. <H1><A NAME="sec:directed-graph-class"></A>
  16. <pre>
  17. directed_graph&lt;VertexProp, EdgeProp, GraphProp&gt;
  18. </pre>
  19. </H1>
  20. <P>
  21. The <tt>directed_graph</tt> class template is a simplified version
  22. of the BGL adjacency list. This class is provided for ease of use, but
  23. may not perform as well as custom-defined adjacency list classes. Instances
  24. of this template model the BidirectionalGraph, VertexIndexGraph, and
  25. EdgeIndexGraph concepts.
  26. <H3>Example</H3>
  27. A simple examples of creating a directed_graph is available here <a href="../../../libs/graph/example/directed_graph.cpp"><tt>libs/graph/example/directed_graph.cpp</tt></a>.
  28. <P>
  29. <PRE>
  30. typedef boost::directed_graph&lt;&gt; Graph;
  31. Graph g;
  32. boost::graph_traits&lt;Graph&gt;::vertex_descriptor v0 = g.add_vertex();
  33. boost::graph_traits&lt;Graph&gt;::vertex_descriptor v1 = g.add_vertex();
  34. g.add_edge(v0, v1);
  35. </PRE>
  36. <H3>Template Parameters</H3>
  37. <P>
  38. <TABLE border>
  39. <TR>
  40. <th>Parameter</th><th>Description</th><th>Default</th>
  41. </tr>
  42. <TR><TD><TT>VertexProp</TT></TD>
  43. <TD>A property map for the graph vertices.</TD>
  44. <TD>&nbsp;</TD>
  45. </TR>
  46. <TR>
  47. <TD><TT>EdgeProp</TT></TD>
  48. <TD>A property map for the graph edges.</TD>
  49. <TD>&nbsp;</TD>
  50. </TR>
  51. <TR>
  52. <TD><TT>GraphProp</TT></TD>
  53. <TD>A property map for the graph itself.</TD>
  54. </TR>
  55. </TABLE>
  56. <P>
  57. <H3>Where Defined</H3>
  58. <P>
  59. <a href="../../../boost/graph/directed_graph.hpp"><TT>boost/graph/directed_graph.hpp</TT></a>
  60. <P>
  61. <br>
  62. <HR>
  63. <TABLE>
  64. <TR valign=top>
  65. <TD nowrap>Copyright &copy; 2000-2001</TD><TD>
  66. <A HREF="http://www.boost.org/people/jeremy_siek.htm">Jeremy Siek</A>,
  67. Indiana University (<A
  68. HREF="mailto:jsiek@osl.iu.edu">jsiek@osl.iu.edu</A>)<br>
  69. <A HREF="http://www.boost.org/people/liequan_lee.htm">Lie-Quan Lee</A>, Indiana University (<A HREF="mailto:llee@cs.indiana.edu">llee@cs.indiana.edu</A>)<br>
  70. <A HREF="https://homes.cs.washington.edu/~al75">Andrew Lumsdaine</A>,
  71. Indiana University (<A
  72. HREF="mailto:lums@osl.iu.edu">lums@osl.iu.edu</A>)
  73. </TD></TR></TABLE>
  74. </BODY>
  75. </HTML>