python networkx使用案例,复杂网络networkx使用笔记--Python

复杂网络networkx使用笔记--Python

复杂网络networkx使用笔记--Python

四个基础网络Basic Networks

import networkx as nx

import matplotlib.pyplot as plt

import scipy.io

import numpy as np

# 规则网络

RG = nx.random_graphs.random_regular_graph(3, 100)

plt.subplot(221)

print ('RG' )

print (nx.global_efficiency(RG))

nx.draw(RG,node_size = 20)

#ER随机网络

ER = nx.random_graphs.erdos_renyi_graph(20, 0.2)

plt.subplot(222)

nx.draw(ER,node_size = 20)

print ('ER' )

print (nx.global_efficiency(ER))

#BA无标度网络

BA = nx.random_graphs.barabasi_albert_graph(100, 1)

Degree_distribution = nx.degree_histogram(BA)

plt.subplot(223)

nx.draw(BA,node_size = 20)

print ('BA')

print (nx.global_efficiency(BA))

# print (Degree_distribution)

x = range(len(Degree_distribution))

#ws小世界网络

WS = nx.random_graphs.watts_strogatz_graph(100, 4, 0.3)

plt.subplot(224)

nx.draw(WS,node_size = 20)

print ('WS')

print (nx.global_efficiency(WS))

plt.show()

1a410dfaddbf251fdc52738d1fddcb01.png

import networkx as nx

import matplotlib.pyplot as plt

import scipy.io

import numpy as np

# 规则网络

RG = nx.random_graphs.random_regular_graph(3, 100)

plt.subplot(221)

print ('RG' )

print (nx.global_efficiency(RG))

#nx.draw(RG,node_size = 20)

Degree_distribution_RG = nx.degree_histogram(RG)

xRG = range(len(Degree_distribution_RG))

plt.subplot(221)

plt.plot(xRG,Degree_distribution_RG)

#ER随机网络

ER = nx.random_graphs.erdos_renyi_graph(20, 0.2)

Degree_distribution_ER = nx.degree_histogram(ER)

xER = range(len(Degree_distribution_ER))

plt.subplot(222)

plt.plot(xRG,Degree_distribution_RG)

#nx.draw(ER,node_size = 20)

print ('ER' )

print (nx.global_efficiency(ER))

#BA无标度网络

BA = nx.random_graphs.barabasi_albert_graph(100, 1)

Degree_distribution_BA = nx.degree_histogram(BA)

xBA = range(len(Degree_distribution_BA))

plt.subplot(223)

plt.plot(xBA,Degree_distribution_BA)

print ('BA')

print (nx.global_efficiency(BA))

# print (Degree_distribution)

#ws小世界网络

WS = nx.random_graphs.watts_strogatz_graph(100, 4, 0.3)

Degree_distribution_WS = nx.degree_histogram(WS)

xWS = range(len(Degree_distribution_WS))

plt.subplot(224)

plt.plot(xWS,Degree_distribution_WS)

print ('WS',nx.global_efficiency(WS))

plt.show()

cba74ff79ee906e0eca3e2bd19eedb43.png

复杂网络networkx使用笔记--Python相关教程

计算机网络笔记——比较详细

计算机网络笔记——比较详细 文章目录 计算机网络 序:计算机概述 1.相关概念 2.参考模型 一、物理层 1.作用 2.电信号 3.物理传输介质 4.信道控制 二、数据链路层 1.arp协议 2.封帧 3.差错控制-海明码 4.流量控制 三、网络层 1.路由选择 2.差错控制-ICMP 3.流

10.网络编程-java版本

10.网络编程-java版本 网络编程 1 概述 Java是 Internet 上的语言,它从语言级上提供了对网络应用程序的支持,程序员能够很容易开发常见的网络应用程序。 Java提供的网络类库,可以实现无痛的网络连接,联网的底层细节被隐藏在 Java 的本机安装系统里,由 JVM

神经网络

神经网络 1、神经网络 ----神经网络的一个重要性质是它可以自动地从数据中学习到合适的权重参数。 (神经网络的例子) ----我们把最左边的一列称为输入层,最右边的一列称为输出层,中间的一列称为中间层。中间层有时也称为隐藏层。“隐藏”一词的意思是,隐

postman传复杂对象(对象内 包含对象与对象列表)

postman传复杂对象(对象内 包含对象与对象列表) 对象代码 class SattionAlarmAndAlarmChannelDTO { SattionAlarmEntity sattionAlarmEntity; ListTAlarmChannelEntity tAlarmChannelList; @Override public String toString() { return SattionAlarmAndAlar

【Java网络编程】TCP协议详解

【Java网络编程】TCP协议详解 TCP协议详解 在前面计算机网络概述中,我们知道了TCP是面向连接的,可靠的,数据传输服务的网络传输协议。而在TCP 协议特点中有几个关键的点,即: a、TCP 通信是需要建立连接的。 b、数据的发送时全双工的。 c、TCP 通信是可靠

计算机网络

计算机网络 超文本传输协议(hyperText Transfer protocol ) 浏览器输入URL发生了什么 1、浏览器分析URL是否合法 2、游览器检查是否有缓存(游览器缓存-系统缓存-路由器缓存),如果有,直接显示。如果没有,跳到第三步 3、浏览器向 DNS 请求解析 域名 的 IP

Linux网络服务 ----------------- DNS域名解析服务即构建

Linux网络服务 ----------------- DNS域名解析服务即构建 文章目录 前言 一 DNS(域名解析服务) 1.1 作用: 1.2 原因: 1.3 解析方式: 1.4 记录文件类型 1.5 DNS的域名分层: 1.6 DNS的解析过程 二 构建服务器实验 2.1 DNS缓存服务器: 2.1.1 解析 2.1.2 实

6、Linux中的网络与磁盘管理

6、Linux中的网络与磁盘管理 6 网络与磁盘管理 Tips: 重点讲解内容 6.1.1 ifconfig命令 引子:ifconfig命令有点类似于Windows的ipconfig命令 ifconfig是Linux中用于显示或配置网络设备的命令,英文全称是network interfaces configuring ifconfig命令用于显示

  • 0
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值