-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 4f188c4
Showing
906 changed files
with
398,507 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Sphinx build info version 1 | ||
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. | ||
config: 4bdfe43095fd98bf770901085220bd84 | ||
tags: 645f666f9bcd5a90fca523b33c5a78b7 |
Empty file.
635 changes: 635 additions & 0 deletions
635
0.3.0/_modules/discrete_optimization/coloring/coloring_model.html
Large diffs are not rendered by default.
Oops, something went wrong.
207 changes: 207 additions & 0 deletions
207
0.3.0/_modules/discrete_optimization/coloring/coloring_parser.html
Large diffs are not rendered by default.
Oops, something went wrong.
155 changes: 155 additions & 0 deletions
155
0.3.0/_modules/discrete_optimization/coloring/coloring_plot.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,155 @@ | ||
<!DOCTYPE html> | ||
<html class="writer-html5" lang="en" data-content_root="../../../"> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>discrete_optimization.coloring.coloring_plot — discrete-optimization 0.3.0 documentation</title> | ||
<link rel="stylesheet" type="text/css" href="../../../_static/pygments.css?v=80d5e7a1" /> | ||
<link rel="stylesheet" type="text/css" href="../../../_static/css/theme.css?v=19f00094" /> | ||
|
||
|
||
<!--[if lt IE 9]> | ||
<script src="../../../_static/js/html5shiv.min.js"></script> | ||
<![endif]--> | ||
|
||
<script src="../../../_static/jquery.js?v=5d32c60e"></script> | ||
<script src="../../../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script> | ||
<script src="../../../_static/documentation_options.js?v=e259d695"></script> | ||
<script src="../../../_static/doctools.js?v=9a2dae69"></script> | ||
<script src="../../../_static/sphinx_highlight.js?v=dc90522c"></script> | ||
<script src="../../../_static/versions.js?v=dd1a30db"></script> | ||
<script src="../../../_static/js/theme.js"></script> | ||
<link rel="index" title="Index" href="../../../genindex.html" /> | ||
<link rel="search" title="Search" href="../../../search.html" /> | ||
</head> | ||
|
||
<body class="wy-body-for-nav"> | ||
<div class="wy-grid-for-nav"> | ||
<nav data-toggle="wy-nav-shift" class="wy-nav-side"> | ||
<div class="wy-side-scroll"> | ||
<div class="wy-side-nav-search" > | ||
|
||
|
||
|
||
<a href="../../../index.html" class="icon icon-home"> | ||
discrete-optimization | ||
</a> | ||
<div class="version"> | ||
0.3.0 | ||
</div> | ||
<div role="search"> | ||
<form id="rtd-search-form" class="wy-form" action="../../../search.html" method="get"> | ||
<input type="text" name="q" placeholder="Search docs" aria-label="Search docs" /> | ||
<input type="hidden" name="check_keywords" value="yes" /> | ||
<input type="hidden" name="area" value="default" /> | ||
</form> | ||
</div> | ||
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu"> | ||
<p class="caption" role="heading"><span class="caption-text">Contents</span></p> | ||
<ul> | ||
<li class="toctree-l1"><a class="reference internal" href="../../../install.html">Installation</a></li> | ||
<li class="toctree-l1"><a class="reference internal" href="../../../getting_started.html">Getting started</a></li> | ||
<li class="toctree-l1"><a class="reference internal" href="../../../notebooks.html">Notebooks</a></li> | ||
<li class="toctree-l1"><a class="reference internal" href="../../../api/modules.html">API Reference</a></li> | ||
<li class="toctree-l1"><a class="reference internal" href="../../../contribute.html">Contributing</a></li> | ||
<li class="toctree-l1"><a class="reference external" href="https://github.com/airbus/discrete-optimization">Github</a></li> | ||
</ul> | ||
|
||
</div> | ||
</div> | ||
</nav> | ||
|
||
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" > | ||
<i data-toggle="wy-nav-top" class="fa fa-bars"></i> | ||
<a href="../../../index.html">discrete-optimization</a> | ||
</nav> | ||
|
||
<div class="wy-nav-content"> | ||
<div class="rst-content style-external-links"> | ||
<div role="navigation" aria-label="Page navigation"> | ||
<ul class="wy-breadcrumbs"> | ||
<li><a href="../../../index.html" class="icon icon-home" aria-label="Home"></a></li> | ||
<li class="breadcrumb-item"><a href="../../index.html">Module code</a></li> | ||
<li class="breadcrumb-item active">discrete_optimization.coloring.coloring_plot</li> | ||
<li class="wy-breadcrumbs-aside"> | ||
</li> | ||
</ul> | ||
<hr/> | ||
</div> | ||
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> | ||
<div itemprop="articleBody"> | ||
|
||
<h1>Source code for discrete_optimization.coloring.coloring_plot</h1><div class="highlight"><pre> | ||
<span></span><span class="c1"># Copyright (c) 2023 AIRBUS and its affiliates.</span> | ||
<span class="c1"># This source code is licensed under the MIT license found in the</span> | ||
<span class="c1"># LICENSE file in the root directory of this source tree.</span> | ||
|
||
<span class="kn">import</span> <span class="nn">matplotlib.pyplot</span> <span class="k">as</span> <span class="nn">plt</span> | ||
<span class="kn">import</span> <span class="nn">networkx</span> <span class="k">as</span> <span class="nn">nx</span> | ||
|
||
<span class="kn">from</span> <span class="nn">discrete_optimization.coloring.coloring_model</span> <span class="kn">import</span> <span class="p">(</span> | ||
<span class="n">ColoringProblem</span><span class="p">,</span> | ||
<span class="n">ColoringSolution</span><span class="p">,</span> | ||
<span class="p">)</span> | ||
|
||
|
||
<div class="viewcode-block" id="plot_coloring_solution"> | ||
<a class="viewcode-back" href="../../../api/discrete_optimization.coloring.html#discrete_optimization.coloring.coloring_plot.plot_coloring_solution">[docs]</a> | ||
<span class="k">def</span> <span class="nf">plot_coloring_solution</span><span class="p">(</span><span class="n">solution</span><span class="p">:</span> <span class="n">ColoringSolution</span><span class="p">,</span> <span class="n">name_figure</span><span class="p">:</span> <span class="nb">str</span> <span class="o">=</span> <span class="s2">""</span><span class="p">):</span> | ||
<span class="n">problem</span><span class="p">:</span> <span class="n">ColoringProblem</span> <span class="o">=</span> <span class="n">solution</span><span class="o">.</span><span class="n">problem</span> | ||
<span class="n">graph_nx</span> <span class="o">=</span> <span class="n">problem</span><span class="o">.</span><span class="n">graph</span><span class="o">.</span><span class="n">graph_nx</span> | ||
<span class="n">pos</span> <span class="o">=</span> <span class="n">nx</span><span class="o">.</span><span class="n">kamada_kawai_layout</span><span class="p">(</span><span class="n">graph_nx</span><span class="p">)</span> | ||
<span class="n">fig</span><span class="p">,</span> <span class="n">ax</span> <span class="o">=</span> <span class="n">plt</span><span class="o">.</span><span class="n">subplots</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span> | ||
<span class="n">nx</span><span class="o">.</span><span class="n">draw_networkx_nodes</span><span class="p">(</span> | ||
<span class="n">graph_nx</span><span class="p">,</span> | ||
<span class="n">pos</span><span class="o">=</span><span class="n">pos</span><span class="p">,</span> | ||
<span class="n">nodelist</span><span class="o">=</span><span class="n">problem</span><span class="o">.</span><span class="n">graph</span><span class="o">.</span><span class="n">nodes_name</span><span class="p">,</span> | ||
<span class="n">label</span><span class="o">=</span><span class="p">[</span><span class="nb">str</span><span class="p">(</span><span class="n">solution</span><span class="o">.</span><span class="n">colors</span><span class="p">[</span><span class="n">i</span><span class="p">])</span> <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">problem</span><span class="o">.</span><span class="n">graph</span><span class="o">.</span><span class="n">nodes_name</span><span class="p">))],</span> | ||
<span class="n">node_color</span><span class="o">=</span><span class="p">[</span><span class="n">solution</span><span class="o">.</span><span class="n">colors</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">problem</span><span class="o">.</span><span class="n">graph</span><span class="o">.</span><span class="n">nodes_name</span><span class="p">))],</span> | ||
<span class="n">ax</span><span class="o">=</span><span class="n">ax</span><span class="p">,</span> | ||
<span class="p">)</span> | ||
<span class="n">nx</span><span class="o">.</span><span class="n">draw_networkx_edges</span><span class="p">(</span><span class="n">graph_nx</span><span class="p">,</span> <span class="n">pos</span><span class="o">=</span><span class="n">pos</span><span class="p">,</span> <span class="n">ax</span><span class="o">=</span><span class="n">ax</span><span class="p">)</span> | ||
<span class="n">ax</span><span class="o">.</span><span class="n">set_title</span><span class="p">(</span><span class="n">name_figure</span><span class="p">)</span></div> | ||
|
||
</pre></div> | ||
|
||
</div> | ||
</div> | ||
<footer> | ||
|
||
<hr/> | ||
|
||
<div role="contentinfo"> | ||
<p>© Copyright 2022, Airbus.</p> | ||
</div> | ||
|
||
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a | ||
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a> | ||
provided by <a href="https://readthedocs.org">Read the Docs</a>. | ||
|
||
|
||
</footer> | ||
</div> | ||
</div> | ||
</section> | ||
</div> | ||
|
||
<div class="rst-versions" data-toggle="rst-versions" role="note" aria-label="versions"> | ||
<span class="rst-current-version" data-toggle="rst-current-version"> | ||
<span class="fa fa-book"> Versions</span> | ||
v: 0.3.0 | ||
<span class="fa fa-caret-down"></span> | ||
</span> | ||
<div class="rst-other-versions"> | ||
<dl id="docs-versions"> | ||
</dl> | ||
</div> | ||
</div> | ||
<script> | ||
jQuery(function () { | ||
SphinxRtdTheme.Navigation.enable(true); | ||
}); | ||
</script> | ||
|
||
</body> | ||
</html> |
Oops, something went wrong.