This page is documentation for a DEVELOPMENT / PRE-RELEASE version. Switch to stable version
logo
  • 安装
  • 教程
  • 参考文献
  • 释放
  • 开发商
  • 绘图示例
  • Guides
    • devel (latest)
    • current (stable)
  • 介绍
  • 图形类型
  • 算法
  • 功能
  • 图形生成器
    • graph_atlas
    • graph_atlas_g
    • balanced_tree
    • barbell_graph
    • binomial_tree
    • complete_graph
    • complete_multipartite_graph
    • circular_ladder_graph
    • circulant_graph
    • cycle_graph
    • dorogovtsev_goltsev_mendes_graph
    • empty_graph
    • full_rary_tree
    • ladder_graph
    • lollipop_graph
    • null_graph
    • path_graph
    • star_graph
    • trivial_graph
    • turan_graph
    • wheel_graph
    • margulis_gabber_galil_graph
    • chordal_cycle_graph
    • paley_graph
    • grid_2d_graph
    • grid_graph
    • hexagonal_lattice_graph
    • hypercube_graph
    • triangular_lattice_graph
    • make_small_graph
    • LCF_graph
    • bull_graph
    • chvatal_graph
    • cubical_graph
    • desargues_graph
    • diamond_graph
    • dodecahedral_graph
    • frucht_graph
    • heawood_graph
    • hoffman_singleton_graph
    • house_graph
    • house_x_graph
    • icosahedral_graph
    • krackhardt_kite_graph
    • moebius_kantor_graph
    • octahedral_graph
    • pappus_graph
    • petersen_graph
    • sedgewick_maze_graph
    • tetrahedral_graph
    • truncated_cube_graph
    • truncated_tetrahedron_graph
    • tutte_graph
    • fast_gnp_random_graph
    • gnp_random_graph
    • dense_gnm_random_graph
    • gnm_random_graph
    • erdos_renyi_graph
    • binomial_graph
    • newman_watts_strogatz_graph
    • watts_strogatz_graph
    • connected_watts_strogatz_graph
    • random_regular_graph
    • barabasi_albert_graph
    • dual_barabasi_albert_graph
    • extended_barabasi_albert_graph
    • powerlaw_cluster_graph
    • random_kernel_graph
    • random_lobster
    • random_shell_graph
    • random_powerlaw_tree
    • random_powerlaw_tree_sequence
    • random_kernel_graph
    • duplication_divergence_graph
    • partial_duplication_graph
    • configuration_model
    • directed_configuration_model
    • expected_degree_graph
    • havel_hakimi_graph
    • directed_havel_hakimi_graph
    • degree_sequence_tree
    • random_degree_sequence_graph
    • random_clustered_graph
    • gn_graph
    • gnr_graph
    • gnc_graph
    • random_k_out_graph
    • scale_free_graph
    • geometric_edges
    • geographical_threshold_graph
    • navigable_small_world_graph
    • random_geometric_graph
    • soft_random_geometric_graph
    • thresholded_random_geometric_graph
    • waxman_graph
    • line_graph
    • inverse_line_graph
    • ego_graph
    • stochastic_graph
    • random_internet_as_graph
    • uniform_random_intersection_graph
    • k_random_intersection_graph
    • general_random_intersection_graph
    • karate_club_graph
    • davis_southern_women_graph
    • florentine_families_graph
    • les_miserables_graph
    • caveman_graph
    • connected_caveman_graph
    • gaussian_random_partition_graph
    • LFR_benchmark_graph
    • planted_partition_graph
    • random_partition_graph
    • relaxed_caveman_graph
    • ring_of_cliques
    • stochastic_block_model
    • windmill_graph
    • spectral_graph_forge
    • random_tree
    • prefix_tree
    • nonisomorphic_trees
    • number_of_nonisomorphic_trees
    • triad_graph
    • is_valid_joint_degree
    • joint_degree_graph
    • is_valid_directed_joint_degree
    • directed_joint_degree_graph
    • 迈谢尔斯基
    • mycielski_graph
    • hnm_harary_graph
    • hkn_harary_graph
    • random_cograph
    • interval_graph
    • sudoku_graph
  • 线性代数
  • 转换为其他数据格式或从其他数据格式转换
  • 重新标记节点
  • 读写图表
  • 绘图
  • 随机性
  • 例外情况
  • 公用事业
  • 术语表

navigable_small_world_graph#

navigable_small_world_graph(n, p=1, q=1, r=2, dim=2, seed=None)[源代码]#

返回可导航的小世界图。

一个可导航的小世界图是一个有向的网格,其中包含随机选择的附加远程连接。

[...] we begin with a set of nodes [...] that are identified with the set of lattice points in an \(n \times n\) square, \(\{(i, j): i \in \{1, 2, \ldots, n\}, j \in \{1, 2, \ldots, n\}\}\), and we define the lattice distance between two nodes \((i, j)\) and \((k, l)\) to be the number of "lattice steps" separating them: \(d((i, j), (k, l)) = |k - i| + |l - j|\).

对于万能常量 \(p >= 1\) ,该节点 \(u\) 具有指向晶格距离内所有其他节点的有向边 \(p\) -这些是它的 本地联系人 。对于万能常量 \(q >= 0\) 和 \(r >= 0\) 我们还从以下位置构造有向边 \(u\) 至 \(q\) 其他节点( long-range contacts )使用独立随机试验; \(i\) 此有向边来自 \(u\) 具有端点 \(v\) 与概率成正比 \([d(u,v)]^{{-r}}\) 。

—[1]

参数
n集成

点阵一侧的长度;因此,图中的节点数为 \(n^2\) 。

p集成

短程连接的直径。每个节点都与该晶格距离内的所有其他节点连接。

q集成

每个节点的远程连接数。

r浮动

连接的衰减概率的指数。连接到格点距离上的节点的概率 \(d\) 是 \(1/d^r\) 。

dim集成

栅格尺寸

seed整数、随机状态或无(默认)

随机数生成状态的指示器。见 Randomness .

工具书类

1

J. Kleinberg. The small-world phenomenon: An algorithmic perspective. Proc. 32nd ACM Symposium on Theory of Computing, 2000.

© Copyright 2004-2022, NetworkX Developers.

Created using Sphinx 4.5.0.