VertexMutableGraph.html 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <HTML>
  2. <!--
  3. Copyright (c) Jeremy Siek 2001
  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>Vertex Mutable 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. <H2><A NAME="concept:VertexMutableGraph">
  16. Vertex Mutable Graph
  17. </H2>
  18. A vertex mutable graph can be changed by adding or removing
  19. vertices. The memory management is the responsibility of the graph
  20. implementation. The graph user need only make calls to
  21. <TT>add_vertex</TT> and <TT>remove_vertex</TT> and the graph
  22. implementation does the rest.
  23. <H3>Refinement of</H3>
  24. <a href="./Graph.html">Graph</a> and <a
  25. href="http://www.boost.org/sgi/stl/DefaultConstructible.html">DefaultConstructible</a>
  26. <H3>Associated Types</H3>
  27. No additional associated types.
  28. <h3>Valid Expressions</h3>
  29. <ul>
  30. <li><a name="sec:add_vertex"><TT>add_vertex(g)</TT></a>
  31. <b>returns</b> <TT>vertex_descriptor</TT>
  32. <br><br>
  33. <b>Semantics:</b> Add a new vertex to the graph. The
  34. <TT>vertex_descriptor</TT> for the new vertex is returned.<br>
  35. </li>
  36. <li><a name="sec:remove_vertex"><tt>remove_vertex(u, g)</tt></a>
  37. <b>returns</b> <tt>void</tt><br><br>
  38. <b> Semantics:</b> Remove <i>u</i> from the vertex set of the graph.
  39. <br>
  40. <b> Preconditions:</b> <i>u</i> is a valid vertex descriptor of graph <i>g</i>
  41. and there are no edges incident to vertex <i>u</i>. The function
  42. <TT>clear_vertex</TT> can be used to remove all incident edges.
  43. <br>
  44. <b> Postconditions: </b> <TT>num_vertices(g)</TT> is one less; <i>u</i>
  45. no longer appears in the vertex set of the graph and it
  46. is no longer a valid vertex descriptor.
  47. </li>
  48. </ul>
  49. <H3>Complexity guarantees</H3>
  50. <ul>
  51. <li> Vertex insertion is guaranteed to be amortized constant time.
  52. <li> Vertex removal is at most <TT>O(|E| + |V|)</TT>.
  53. </ul>
  54. <br>
  55. <HR>
  56. <TABLE>
  57. <TR valign=top>
  58. <TD nowrap>Copyright &copy; 2000-2001</TD><TD>
  59. <A HREF="http://www.boost.org/people/jeremy_siek.htm">Jeremy Siek</A>, Indiana University (<A HREF="mailto:jsiek@osl.iu.edu">jsiek@osl.iu.edu</A>)
  60. <A HREF="http://www.boost.org/people/jeremy_siek.htm">Lie-Quan Lee</A>, Indiana University (<A HREF="mailto:llee@cs.indiana.edu">llee@cs.indiana.edu</A>)
  61. </TD></TR></TABLE>
  62. </BODY>
  63. </HTML>