网络图的公平着色。

equitable-coloring的Python项目详细描述


networkX图的公平着色。

来自Wikipedia

In graph theory [..] an equitable coloring is an assignment of colors to the vertices of an undirected graph, in such a way that

  • No two adjacent vertices have the same color, and
  • The numbers of vertices in any two color classes differ by at most one.

Kierstead et. al.提供了一个快速多项式时间算法,用于利用最大{^ Tt2} $的图,利用^ {Tt1}颜色来揭示一个均匀着色。 这个包是networkx图算法的一个实现。

  • 自由软件:麻省理工学院许可证

安装

pip install equitable-coloring

用法

使用equitable-coloring

>>> import networkx as nx
>>> from equitable_coloring import equitable_color
>>> from equitable_coloring.utils import is_equitable
>>> G = nx.cycle_graph(4)
>>> d = equitable_color(G, num_colors=3)
>>> is_equitable(G, d)
True

开发

要运行所有测试,请运行:

pip install pytest-cov  # Needed the first time.
python setup.py test

或者,您可以使用tox

更改日志

0.1.2(2018-06-30)

  • 更新自述文件和使用说明。

0.1.1(2018-06-30)

  • 带有测试的初始版本。

0.1.0(2018-06-11)

  • 第一次承诺。

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java如何使用jdbc和jsp将数据插入mysql?   Oracle Java 7密钥工具无法将pkcs11密钥库导入JKS:非PKCS 8编码   java使用接口获取Todo id或JPA getOne方法速度更快   Java获得给定日期的下个月的第一天   java使用单个“更新”按钮将测试表的自动增量值插入分数表   BottomNavigationView下坐标布局上的java Fab按钮   java在安卓 OnPreferenceClickListener中调用非静态方法   java在MediaStore中在哪里可以找到图像的文件路径   java Spring boot 2.2 activemq jetty冲突   java集合值在所有列表变量中都得到更新   java如何在SpringMVC+maven项目中获取web上下文路径?   java不可变类:空白的最后字段可能未被初始化   在Android中实现ads的java程序?   java将数据库任务与spring petclinic应用程序分离   同一实体列上的java双向关联不能为null