<emclass="property"><spanclass="pre">exception</span><spanclass="w"></span></em><spanclass="sig-prename descclassname"><spanclass="pre">Lib.Graphes.</span></span><spanclass="sig-name descname"><spanclass="pre">GraphError</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">message</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><spanclass="pre">str</span></span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/Lib/Graphes.html#GraphError"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#Lib.Graphes.GraphError"title="Permalink to this definition"></a></dt>
<spanclass="sig-name descname"><spanclass="pre">message</span></span><emclass="property"><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="pre">str</span></em><aclass="headerlink"href="#Lib.Graphes.GraphError.message"title="Permalink to this definition"></a></dt>
<emclass="property"><spanclass="pre">class</span><spanclass="w"></span></em><spanclass="sig-prename descclassname"><spanclass="pre">Lib.Graphes.</span></span><spanclass="sig-name descname"><spanclass="pre">GeneralGraph</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">graph_dict</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">None</span></span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/Lib/Graphes.html#GeneralGraph"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#Lib.Graphes.GeneralGraph"title="Permalink to this definition"></a></dt>
<spanclass="sig-name descname"><spanclass="pre">graph_dict</span></span><emclass="property"><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="pre">Dict</span><spanclass="p"><spanclass="pre">[</span></span><spanclass="pre">Any</span><spanclass="p"><spanclass="pre">,</span></span><spanclass="w"></span><spanclass="pre">Set</span><spanclass="p"><spanclass="pre">]</span></span></em><aclass="headerlink"href="#Lib.Graphes.GeneralGraph.graph_dict"title="Permalink to this definition"></a></dt>
<spanclass="sig-name descname"><spanclass="pre">vertices</span></span><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><spanclass="sig-return"><spanclass="sig-return-icon">→</span><spanclass="sig-return-typehint"><spanclass="pre">List</span><spanclass="p"><spanclass="pre">[</span></span><spanclass="pre">Any</span><spanclass="p"><spanclass="pre">]</span></span></span></span><aclass="reference internal"href="../_modules/Lib/Graphes.html#GeneralGraph.vertices"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#Lib.Graphes.GeneralGraph.vertices"title="Permalink to this definition"></a></dt>
<spanclass="sig-name descname"><spanclass="pre">add_vertex</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">vertex</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><spanclass="pre">Any</span></span></em><spanclass="sig-paren">)</span><spanclass="sig-return"><spanclass="sig-return-icon">→</span><spanclass="sig-return-typehint"><spanclass="pre">None</span></span></span><aclass="reference internal"href="../_modules/Lib/Graphes.html#GeneralGraph.add_vertex"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#Lib.Graphes.GeneralGraph.add_vertex"title="Permalink to this definition"></a></dt>
<spanclass="sig-name descname"><spanclass="pre">edges</span></span><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><spanclass="sig-return"><spanclass="sig-return-icon">→</span><spanclass="sig-return-typehint"><spanclass="pre">List</span><spanclass="p"><spanclass="pre">[</span></span><spanclass="pre">Set</span><spanclass="p"><spanclass="pre">]</span></span></span></span><aclass="reference internal"href="../_modules/Lib/Graphes.html#GeneralGraph.edges"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#Lib.Graphes.GeneralGraph.edges"title="Permalink to this definition"></a></dt>
<spanclass="sig-name descname"><spanclass="pre">dfs_traversal</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">root</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><spanclass="pre">Any</span></span></em><spanclass="sig-paren">)</span><spanclass="sig-return"><spanclass="sig-return-icon">→</span><spanclass="sig-return-typehint"><spanclass="pre">List</span><spanclass="p"><spanclass="pre">[</span></span><spanclass="pre">Any</span><spanclass="p"><spanclass="pre">]</span></span></span></span><aclass="reference internal"href="../_modules/Lib/Graphes.html#GeneralGraph.dfs_traversal"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#Lib.Graphes.GeneralGraph.dfs_traversal"title="Permalink to this definition"></a></dt>
<spanclass="sig-name descname"><spanclass="pre">is_reachable_from</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">v1</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><spanclass="pre">Any</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">v2</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><spanclass="pre">Any</span></span></em><spanclass="sig-paren">)</span><spanclass="sig-return"><spanclass="sig-return-icon">→</span><spanclass="sig-return-typehint"><spanclass="pre">bool</span></span></span><aclass="reference internal"href="../_modules/Lib/Graphes.html#GeneralGraph.is_reachable_from"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#Lib.Graphes.GeneralGraph.is_reachable_from"title="Permalink to this definition"></a></dt>
<spanclass="sig-name descname"><spanclass="pre">connected_components</span></span><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><spanclass="sig-return"><spanclass="sig-return-icon">→</span><spanclass="sig-return-typehint"><spanclass="pre">List</span><spanclass="p"><spanclass="pre">[</span></span><spanclass="pre">List</span><spanclass="p"><spanclass="pre">[</span></span><spanclass="pre">Any</span><spanclass="p"><spanclass="pre">]</span></span><spanclass="p"><spanclass="pre">]</span></span></span></span><aclass="reference internal"href="../_modules/Lib/Graphes.html#GeneralGraph.connected_components"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#Lib.Graphes.GeneralGraph.connected_components"title="Permalink to this definition"></a></dt>
<dd><p>Compute the list of all connected components of the graph,
<spanclass="sig-name descname"><spanclass="pre">bfs_traversal</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">root</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><spanclass="pre">Any</span></span></em><spanclass="sig-paren">)</span><spanclass="sig-return"><spanclass="sig-return-icon">→</span><spanclass="sig-return-typehint"><spanclass="pre">List</span><spanclass="p"><spanclass="pre">[</span></span><spanclass="pre">Any</span><spanclass="p"><spanclass="pre">]</span></span></span></span><aclass="reference internal"href="../_modules/Lib/Graphes.html#GeneralGraph.bfs_traversal"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#Lib.Graphes.GeneralGraph.bfs_traversal"title="Permalink to this definition"></a></dt>
<dd><p>Compute a breadth first search of the graph,
<emclass="property"><spanclass="pre">class</span><spanclass="w"></span></em><spanclass="sig-prename descclassname"><spanclass="pre">Lib.Graphes.</span></span><spanclass="sig-name descname"><spanclass="pre">Graph</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">graph_dict</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">None</span></span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/Lib/Graphes.html#Graph"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#Lib.Graphes.Graph"title="Permalink to this definition"></a></dt>
<spanclass="sig-name descname"><spanclass="pre">edges</span></span><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><spanclass="sig-return"><spanclass="sig-return-icon">→</span><spanclass="sig-return-typehint"><spanclass="pre">List</span><spanclass="p"><spanclass="pre">[</span></span><spanclass="pre">Set</span><spanclass="p"><spanclass="pre">]</span></span></span></span><aclass="reference internal"href="../_modules/Lib/Graphes.html#Graph.edges"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#Lib.Graphes.Graph.edges"title="Permalink to this definition"></a></dt>
<dd><p>A static method generating the set of edges
<spanclass="sig-name descname"><spanclass="pre">add_edge</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">edge</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><spanclass="pre">Tuple</span><spanclass="p"><spanclass="pre">[</span></span><spanclass="pre">Any</span><spanclass="p"><spanclass="pre">,</span></span><spanclass="w"></span><spanclass="pre">Any</span><spanclass="p"><spanclass="pre">]</span></span></span></em><spanclass="sig-paren">)</span><spanclass="sig-return"><spanclass="sig-return-icon">→</span><spanclass="sig-return-typehint"><spanclass="pre">None</span></span></span><aclass="reference internal"href="../_modules/Lib/Graphes.html#Graph.add_edge"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#Lib.Graphes.Graph.add_edge"title="Permalink to this definition"></a></dt>
<spanclass="sig-name descname"><spanclass="pre">print_dot</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">name</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><spanclass="pre">str</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">colors</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">{}</span></span></em><spanclass="sig-paren">)</span><spanclass="sig-return"><spanclass="sig-return-icon">→</span><spanclass="sig-return-typehint"><spanclass="pre">None</span></span></span><aclass="reference internal"href="../_modules/Lib/Graphes.html#Graph.print_dot"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#Lib.Graphes.Graph.print_dot"title="Permalink to this definition"></a></dt>
<spanclass="sig-name descname"><spanclass="pre">delete_vertex</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">vertex</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><spanclass="pre">Any</span></span></em><spanclass="sig-paren">)</span><spanclass="sig-return"><spanclass="sig-return-icon">→</span><spanclass="sig-return-typehint"><spanclass="pre">None</span></span></span><aclass="reference internal"href="../_modules/Lib/Graphes.html#Graph.delete_vertex"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#Lib.Graphes.Graph.delete_vertex"title="Permalink to this definition"></a></dt>
<dd><p>Delete a vertex and all the adjacent edges.</p>
<spanclass="sig-name descname"><spanclass="pre">delete_edge</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">edge</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><spanclass="pre">Tuple</span><spanclass="p"><spanclass="pre">[</span></span><spanclass="pre">Any</span><spanclass="p"><spanclass="pre">,</span></span><spanclass="w"></span><spanclass="pre">Any</span><spanclass="p"><spanclass="pre">]</span></span></span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/Lib/Graphes.html#Graph.delete_edge"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#Lib.Graphes.Graph.delete_edge"title="Permalink to this definition"></a></dt>
<spanclass="sig-name descname"><spanclass="pre">color</span></span><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><spanclass="sig-return"><spanclass="sig-return-icon">→</span><spanclass="sig-return-typehint"><spanclass="pre">Dict</span><spanclass="p"><spanclass="pre">[</span></span><spanclass="pre">Any</span><spanclass="p"><spanclass="pre">,</span></span><spanclass="w"></span><spanclass="pre">int</span><spanclass="p"><spanclass="pre">]</span></span></span></span><aclass="reference internal"href="../_modules/Lib/Graphes.html#Graph.color"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#Lib.Graphes.Graph.color"title="Permalink to this definition"></a></dt>
<dd><p>Color the graph with an unlimited number of colors.
Return a dict vertex -> color, where color is an integer (0, 1, …).</p>
<spanclass="sig-name descname"><spanclass="pre">color_with_k_colors</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">K</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">None</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">avoidingnodes</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">()</span></span></em><spanclass="sig-paren">)</span><spanclass="sig-return"><spanclass="sig-return-icon">→</span><spanclass="sig-return-typehint"><spanclass="pre">Tuple</span><spanclass="p"><spanclass="pre">[</span></span><spanclass="pre">Dict</span><spanclass="p"><spanclass="pre">[</span></span><spanclass="pre">Any</span><spanclass="p"><spanclass="pre">,</span></span><spanclass="w"></span><spanclass="pre">int</span><spanclass="p"><spanclass="pre">]</span></span><spanclass="p"><spanclass="pre">,</span></span><spanclass="w"></span><spanclass="pre">bool</span><spanclass="p"><spanclass="pre">,</span></span><spanclass="w"></span><spanclass="pre">List</span><spanclass="p"><spanclass="pre">]</span></span></span></span><aclass="reference internal"href="../_modules/Lib/Graphes.html#Graph.color_with_k_colors"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#Lib.Graphes.Graph.color_with_k_colors"title="Permalink to this definition"></a></dt>
<dd><p>Color with <= K colors (if K is unspecified, use unlimited colors).</p>
<p>Return 3 values:</p>
<ulclass="simple">
<li><p>a dict vertex -> color</p></li>
<li><p>a Boolean, True if the coloring succeeded</p></li>
<li><p>the set of nodes actually colored</p></li>
</ul>
<p>Do not color vertices belonging to avoidingnodes.</p>
<emclass="property"><spanclass="pre">class</span><spanclass="w"></span></em><spanclass="sig-prename descclassname"><spanclass="pre">Lib.Graphes.</span></span><spanclass="sig-name descname"><spanclass="pre">DiGraph</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">graph_dict</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">None</span></span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/Lib/Graphes.html#DiGraph"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#Lib.Graphes.DiGraph"title="Permalink to this definition"></a></dt>
<spanclass="sig-name descname"><spanclass="pre">pred</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">v</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><spanclass="pre">Any</span></span></em><spanclass="sig-paren">)</span><spanclass="sig-return"><spanclass="sig-return-icon">→</span><spanclass="sig-return-typehint"><spanclass="pre">Set</span></span></span><aclass="reference internal"href="../_modules/Lib/Graphes.html#DiGraph.pred"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#Lib.Graphes.DiGraph.pred"title="Permalink to this definition"></a></dt>
<dd><p>Return all predecessors of the vertex <cite>v</cite> in the graph.</p>
<spanclass="sig-name descname"><spanclass="pre">neighbourhoods</span></span><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><spanclass="sig-return"><spanclass="sig-return-icon">→</span><spanclass="sig-return-typehint"><spanclass="pre">List</span><spanclass="p"><spanclass="pre">[</span></span><spanclass="pre">Tuple</span><spanclass="p"><spanclass="pre">[</span></span><spanclass="pre">Any</span><spanclass="p"><spanclass="pre">,</span></span><spanclass="w"></span><spanclass="pre">Set</span><spanclass="p"><spanclass="pre">]</span></span><spanclass="p"><spanclass="pre">]</span></span></span></span><aclass="reference internal"href="../_modules/Lib/Graphes.html#DiGraph.neighbourhoods"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#Lib.Graphes.DiGraph.neighbourhoods"title="Permalink to this definition"></a></dt>
<dd><p>Return all neighbourhoods in the graph.</p>
<spanclass="sig-name descname"><spanclass="pre">edges</span></span><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><spanclass="sig-return"><spanclass="sig-return-icon">→</span><spanclass="sig-return-typehint"><spanclass="pre">List</span><spanclass="p"><spanclass="pre">[</span></span><spanclass="pre">Set</span><spanclass="p"><spanclass="pre">]</span></span></span></span><aclass="reference internal"href="../_modules/Lib/Graphes.html#DiGraph.edges"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#Lib.Graphes.DiGraph.edges"title="Permalink to this definition"></a></dt>
<dd><p>A static method generating the set of edges</p>
<spanclass="sig-name descname"><spanclass="pre">add_edge</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">edge</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><spanclass="pre">Tuple</span><spanclass="p"><spanclass="pre">[</span></span><spanclass="pre">Any</span><spanclass="p"><spanclass="pre">,</span></span><spanclass="w"></span><spanclass="pre">Any</span><spanclass="p"><spanclass="pre">]</span></span></span></em><spanclass="sig-paren">)</span><spanclass="sig-return"><spanclass="sig-return-icon">→</span><spanclass="sig-return-typehint"><spanclass="pre">None</span></span></span><aclass="reference internal"href="../_modules/Lib/Graphes.html#DiGraph.add_edge"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#Lib.Graphes.DiGraph.add_edge"title="Permalink to this definition"></a></dt>
<spanclass="sig-name descname"><spanclass="pre">print_dot</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">name</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><spanclass="pre">str</span></span></em><spanclass="sig-paren">)</span><spanclass="sig-return"><spanclass="sig-return-icon">→</span><spanclass="sig-return-typehint"><spanclass="pre">None</span></span></span><aclass="reference internal"href="../_modules/Lib/Graphes.html#DiGraph.print_dot"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#Lib.Graphes.DiGraph.print_dot"title="Permalink to this definition"></a></dt>
<spanclass="sig-name descname"><spanclass="pre">delete_vertex</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">vertex</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><spanclass="pre">Any</span></span></em><spanclass="sig-paren">)</span><spanclass="sig-return"><spanclass="sig-return-icon">→</span><spanclass="sig-return-typehint"><spanclass="pre">None</span></span></span><aclass="reference internal"href="../_modules/Lib/Graphes.html#DiGraph.delete_vertex"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#Lib.Graphes.DiGraph.delete_vertex"title="Permalink to this definition"></a></dt>
<dd><p>Delete a vertex and all the adjacent edges.</p>
<spanclass="sig-name descname"><spanclass="pre">delete_edge</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">edge</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><spanclass="pre">Tuple</span><spanclass="p"><spanclass="pre">[</span></span><spanclass="pre">Any</span><spanclass="p"><spanclass="pre">,</span></span><spanclass="w"></span><spanclass="pre">Any</span><spanclass="p"><spanclass="pre">]</span></span></span></em><spanclass="sig-paren">)</span><spanclass="sig-return"><spanclass="sig-return-icon">→</span><spanclass="sig-return-typehint"><spanclass="pre">None</span></span></span><aclass="reference internal"href="../_modules/Lib/Graphes.html#DiGraph.delete_edge"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#Lib.Graphes.DiGraph.delete_edge"title="Permalink to this definition"></a></dt>