File:Barabasi Albert model.gif

页面内容不支持其他语言。
這個文件來自維基共享資源
维基百科,自由的百科全书

原始文件(800 × 800像素,文件大小:255 KB,MIME类型:image/gif、​循环、​18帧、​18秒)


摘要

描述
English: The evolution of a network by the Barabasi–Albert model. In every step, one new node appears, and in this case there is two new edges from the new node to the old ones.
Magyar: Egy hálózat fejlődése a Barabási–Albert modell szerint. Minden lépésben egy új csúcs jelenik meg, és ebben a változatban minden új csúcsból két él mutat a régi csúcsokhoz.
日期
来源 Created by the NetworkX module of the Python
作者 Horváth Árpád
 
本GIF 位图使用Matplotlib创作.

The code is (using the python-networkx and python-matplotlib packages on Ubuntu GNU/Linux distribution):

#! /usr/bin/python
# coding: utf-8

import networkx
#import pylab
from pylab import pi, cos, sin, linspace, array
import matplotlib.pyplot as plt
import os 

node_number = 20
initial_nodes = 2
animation = False
animation = True

G=networkx.barabasi_albert_graph(node_number, initial_nodes)

# pos=networkx.graphviz_layout(G, prog="dot")
type="shell4"
pos=networkx.shell_layout(G)
#pos=networkx.graphviz_layout(G,prog='twopi',args=)
print pos

dir=os.path.join("images", type)
if not os.path.isdir(dir):
    os.mkdir(dir)

Ge = networkx.empty_graph(node_number)
#networkx.draw(GG,pos, node_color="w")

for i in range(initial_nodes,node_number):
    nodes = range(i+1)
    GG = G.subgraph(nodes)
    plt.figure(figsize=(8,8))
    networkx.draw(GG,pos, node_color="w", alpha=0.5, node_color="blue", node_size=20, with_labels=False, hold=False)
    #networkx.draw(Ge,pos, node_color="w", alpha=0.5, node_color="blue", node_size=20, with_labels=False, hold=True)
    #nx.draw(G,pos,node_size=20,alpha=0.5,node_color="blue", with_labels=False)
    xmax=max(xx for xx,yy in pos.values())
    xmin=min(xx for xx,yy in pos.values() + [(0,0)])
    ymax=max(yy for xx,yy in pos.values())
    ymin=min(yy for xx,yy in pos.values() + [(0,0)])
    dx = xmax - xmin
    ddx=0.1*dx
    dy = ymax - ymin
    ddy=0.1*dy
    plt.xlim(xmin-ddx,xmax+ddx)
    plt.ylim(ymin-ddy,ymax+ddy)
    plt.savefig("%s/barabasi_%s%02d.png" % (dir, type, i))

if animation:
    input = os.path.join(dir, "*.png")
    output = os.path.join(dir, "barabasi_albert.gif")
    os.system("convert -delay 100 -loop 0 %s %s" % (input, output))

(If someone knows how to eliminate the frame around the network, write to me, please.)

许可协议

我,本作品著作权人,特此采用以下许可协议发表本作品:
GNU head 已授权您依据自由软件基金会发行的无固定段落及封面封底文字(Invariant Sections, Front-Cover Texts, and Back-Cover Texts)的GNU自由文件许可协议1.2版或任意后续版本的条款,复制、传播和/或修改本文件。该协议的副本请见“GNU Free Documentation License”。
w:zh:知识共享
署名 相同方式共享
您可以自由地:
  • 共享 – 复制、发行并传播本作品
  • 修改 – 改编作品
惟须遵守下列条件:
  • 署名 – 您必须对作品进行署名,提供授权条款的链接,并说明是否对原始内容进行了更改。您可以用任何合理的方式来署名,但不得以任何方式表明许可人认可您或您的使用。
  • 相同方式共享 – 如果您再混合、转换或者基于本作品进行创作,您必须以与原先许可协议相同或相兼容的许可协议分发您贡献的作品。
您可以选择您需要的许可协议。

说明

添加一行文字以描述该文件所表现的内容

此文件中描述的项目

描繪內容

a52986cf2e3204f992ee6f633ef66264faa8686a

260,850 字节

18

800 像素

800 像素

文件历史

点击某个日期/时间查看对应时刻的文件。

日期/时间缩⁠略⁠图大小用户备注
当前2011年7月20日 (三) 08:442011年7月20日 (三) 08:44版本的缩略图800 × 800(255 KB)52Dora囧rz被耍了...
2011年7月20日 (三) 08:432011年7月20日 (三) 08:43版本的缩略图800 × 800(296 KB)52Dora最新版本的GIF根本就没有动
2009年1月29日 (四) 13:202009年1月29日 (四) 13:20版本的缩略图800 × 800(255 KB)HarpWithout frame (without plt.frame("equal")
2009年1月28日 (三) 22:022009年1月28日 (三) 22:02版本的缩略图800 × 800(296 KB)Harp{{Information |Description={{en|1=The evolution of a graph by the Barabasi Albert model. In every step, one new node appears, and in this case there is two new edges from the new node to the old ones. }} {{hu|1=Egy gráf fejlődése a Barabási-Albert mod

以下2个页面使用本文件:

全域文件用途

以下其他wiki使用此文件: