1.pumnet
2.muxViz
3. SATNet
1. pymnet主页网址:https://mnets.github.io/pymnet/index.html
pymnet模块介绍The library is based on the general definition of multilayer networks presented in a review article. Multilayer networks can be used to represent various types network generalizations found in the literature. For example, multiplex networks, temporal networks, networks of networks, and interdependent networks are all types of multilayer networks. The library supports even more general types of networks with multiple aspects such that the networks can for example have both temporal and multiplex aspect at the same time. The visualization on the left is produced with the library. See the visualization tutorial for instructions on how to visualize your own network data with the library! 该库基于一篇综述文章中给出的多层网络的一般定义。多层网络可用于表示文献中发现的各种类型的网络概括。例如,多路网络、时间网络、网络的网络和相互依赖的网络都是多层网络的类型。该库甚至支持具有多个方面的更一般类型的网络,使得网络可以例如同时具有时间和复用方面。 左边的可视化是由库产生的。有关如何使用库可视化您自己的网络数据的说明,请参见可视化教程!
Main features include:
|
|
关于pymnet库的安装:引用自:https://bbs.huaweicloud.com/blogs/399360 向原作者致谢!
Github官网: 将下载的文件解压到conda的site-packages目录下:
进入目录: cd D:\python\anaconda\Lib\site-packages\Multilayer-networks-library-master 构建和安装 构建 python setup.py build 继续安装 python setup.py install
安装成功:
导入成功:
初步尝试示例1: from pymnet import * # MultilayerNetwork 是库中的基本网络类——所有其他类型的网络都是它的特例。 # 为了获得单体网络对象,可以简单地构造一个具有 0 个方面的多层网络。 net = MultilayerNetwork(aspects=0) net.add_node(1) net.add_node(2) print(list(net)) print(net[1].deg())
初步尝试示例2: # — coding: utf-8 – from pymnet import * fig3 = draw(er(10, 3 * [0.3]), layout="circular", layershape="circle", nodeColorDict={(0, 0): "r", (1, 0): "r", (0, 1): "r"}, layerLabelRule={}, nodeLabelRule={}, nodeSizeRule={"rule": "degree", "propscale": 0.05}) fig3.savefig("net3.pdf") 我们首先创建了一个三层的空白网络,然后添加了一些层和节点以及它们之间的连接。接下来,我们设置了节点和层的颜色和形状,并使用
在可视化网络时,可以使用 在
|
|
三种类型的网络 Monoplex networksimport pymnet net = pymnet.MultilayerNetwork(aspects=0) net.add_node(1) net.add_node(2) net[1, 3] = 1 list(net) #[1, 2, 3] list(net[1]) #the list of neighbors of the node #[2, 3] net[1, 3] = 0 list(net[1]) #[2] #Directed network objects dirnet = pymnet.MultilayerNetwork(aspects=0, directed=True) dirnet[1, 2] = 1 dirnet[1, 2] #1 dirnet[2, 1] #0
Multilayer networksmnet = pymnet.MultilayerNetwork(aspects=1) #In the syntax where you first access a node object and then its neighbor, #Sometimes new syntax is needed.
Multiplex networksonet = pymnet.MultiplexNetwork(couplings="ordinal") onet.add_node("node") onet.add_layer(1) onet.add_layer(2) onet.add_layer(3) onet["node", "node", 1, 2] cnet = pymnet.MultiplexNetwork(couplings=("categorical", 10)) cnet.add_node(1) cnet.add_layer("a") cnet.add_layer("b") cnet[1, 1, "a", "b"] conet = pymnet.MultiplexNetwork(couplings=["categorical", "ordinal"]) conet.add_node("node") conet.add_layer("a", 1) conet.add_layer("b", 1) conet.add_layer(1, 2) conet.add_layer(2, 2) conet.add_layer(3, 2) conet["node", "node", "a", "a", 1, 2] conet.A[("a", 1)]["node", "node2"] = 1
|
|
Visualizing networksimport random random.seed(42) import numpy as np np.random.seed(42) from pymnet import * net = models.er_multilayer(5, 2, 0.2) fig = draw(net) fig.show()
fig = draw(er(10, 3*[0.4]), layout="spring") fig.show() fig.savefig("net.pdf")
fig = draw(er(10, 3*[0.3]), layout="circular", layershape="circle", nodeColorDict={(0,0):"r", (1,0):"r", (0,1):"r"}, layerLabelRule={}, nodeLabelRule={}, nodeSizeRule={"rule":"degree", "propscale":0.05} )
#If the network is large, then it is often desirable not to plot the coupling edges.
|
|
Isomorphisms and automorphisms同构和自同态
要求安装:networkx 和 bliss-blind networkx: Available through pip.
|
|
muxViz MuxViz:多层网络分析与可视化
|
|
SATNet
https://github.com/locuslab/SATNet
Bridging deep learning and logical reasoning using a differentiable satisfiability solver. This repository contains the source code to reproduce the experiments in the ICML 2019 paper SATNet: Bridging deep learning and logical reasoning using a differentiable satisfiability solver by Po-Wei Wang, Priya L. Donti, Bryan Wilder, and J. Zico Kolter. SATNet is a differentiable (smoothed) maximum satisfiability (MAXSAT) solver that can be integrated into the loop of larger deep learning systems. This (approximate) solver is based upon a fast coordinate descent approach to solving the semidefinite program (SDP) associated with the MAXSAT problem. |
|