edge_coloring.html 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. <HTML>
  2. <!--
  3. ~~ Copyright (c) Maciej Piechotka 2013
  4. ~~
  5. Distributed under the Boost Software License, Version 1.0.
  6. (See accompanying file LICENSE_1_0.txt or copy at
  7. http://www.boost.org/LICENSE_1_0.txt)
  8. -->
  9. <Head>
  10. <Title>Boost Graph Library: Edge Coloring</Title>
  11. <BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
  12. ALINK="#ff0000">
  13. <IMG SRC="../../../boost.png"
  14. ALT="C++ Boost" width="277" height="86">
  15. <BR Clear>
  16. <H1>
  17. <!-- <img src="figs/python.gif" alt="(Python)"/> -->
  18. <TT>edge_coloring</TT>
  19. </H1>
  20. <P>
  21. <DIV ALIGN="LEFT">
  22. <TABLE CELLPADDING=3 border>
  23. <TR><TH ALIGN="LEFT"><B>Graphs:</B></TH>
  24. <TD ALIGN="LEFT">undirected, loop-free</TD>
  25. </TR>
  26. <TR><TH ALIGN="LEFT"><B>Properties:</B></TH>
  27. <TD ALIGN="LEFT">color</TD>
  28. </TR>
  29. <TR><TH ALIGN="LEFT"><B>Complexity:</B></TH>
  30. <TD ALIGN="LEFT">time: <i>O(|E| |V|)</i> </TD>
  31. </TR>
  32. </TABLE>
  33. </DIV>
  34. <pre>
  35. template &lt;class Graph, class ColorMap&gt;
  36. typename boost::property_traits<ColorMap>::value_type
  37. edge_coloring(const Graph &amp;g, ColorMap color);
  38. </pre>
  39. <p>Computes an edge coloring for the vertices in the graph, using
  40. an algorithm proposed by Misra et al. []. Given edges ordered
  41. e<sub>1</sub>, e<sub>2</sub>, ..., e<sub>n</sub> it assignes a
  42. colors c<sub>1</sub>, c<sub>2</sub>, ..., c<sub>n</sub> in a way
  43. that no vertex connects with 2 edges of the same color. Furthermore
  44. at most m + 1 colors are used.
  45. <!-- King, I.P. An automatic reordering scheme for simultaneous equations derived from network analysis. Int. J. Numer. Methods Engrg. 2 (1970), 523-533 -->
  46. <h3>Where defined</h3>
  47. <a href="../../../boost/graph/edge_coloring.hpp"><tt>boost/graph/edge_coloring.hpp</tt></a>
  48. <h3>Parameters</h3>
  49. IN: <tt>const Graph&amp; g</tt>
  50. <blockquote>
  51. The graph object on which the algorithm will be applied. The type
  52. <tt>Graph</tt> must be a model of <a href="EdgeListGraph.html">
  53. Edge List Graph</a> and <a href="IncidenceGraph.html">Incidence
  54. Graph</a>.
  55. </blockquote>
  56. OUT: <tt>ColorMap color</tt>
  57. <blockquote>
  58. This property map records the colors of each edges. It must be a
  59. model of <A HREF="../../property_map/doc/ReadWritePropertyMap.html">
  60. Read/Write Property Map</A> whose key type is the same as the edge
  61. descriptor type of the graph and whose value type is an integral type
  62. that can store all values smaller or equal to m.
  63. </blockquote>
  64. <h3>Example</h3>
  65. See <A
  66. href="../example/edge_coloring.cpp"><tt>example/king_ordering.cpp</tt></A>.
  67. <h3>See Also</h3>
  68. <A href="./sequential_vertex_coloring.html">sequential vertex ordering</tt></A>.
  69. <br>
  70. <HR>
  71. <TABLE>
  72. <TR valign=top>
  73. <TD nowrap>Copyright &copy; 2013</TD><TD>
  74. Maciej Piechotka (<A HREF="mailto:uzytkownik2@gmail.com">uzytkownik2@gmail.com</A>)
  75. </TD></TR></TABLE>
  76. </BODY>
  77. </HTML>