Skip to main content
Ctrl+K
NetworkX 3.4rc0.dev0 documentation - Home
  • 安装
  • 教程
  • Reference
  • Gallery
  • Developer
  • 发布版本
  • Guides
  • Home Page
  • GitHub
  • 安装
  • 教程
  • Reference
  • Gallery
  • Developer
  • 发布版本
  • Guides
  • Home Page
  • GitHub

Section Navigation

  • 引言
  • Graph types
  • Algorithms
  • Functions
  • Graph generators
    • 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
    • kneser_graph
    • ladder_graph
    • lollipop_graph
    • null_graph
    • path_graph
    • star_graph
    • tadpole_graph
    • trivial_graph
    • turan_graph
    • wheel_graph
    • margulis_gabber_galil_graph
    • chordal_cycle_graph
    • paley_graph
    • maybe_regular_expander
    • is_regular_expander
    • random_regular_expander_graph
    • grid_2d_graph
    • grid_graph
    • hexagonal_lattice_graph
    • hypercube_graph
    • triangular_lattice_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
    • geometric_soft_configuration_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
    • prefix_tree
    • random_labeled_tree
    • random_labeled_rooted_tree
    • random_labeled_rooted_forest
    • random_unlabeled_tree
    • random_unlabeled_rooted_tree
    • random_unlabeled_rooted_forest
    • nonisomorphic_trees
    • number_of_nonisomorphic_trees
    • triad_graph
    • is_valid_joint_degree
    • joint_degree_graph
    • is_valid_directed_joint_degree
    • directed_joint_degree_graph
    • mycielskian
    • mycielski_graph
    • hnm_harary_graph
    • hkn_harary_graph
    • random_cograph
    • interval_graph
    • sudoku_graph
    • visibility_graph
  • Linear algebra
  • Converting to and from other data formats
  • Relabeling nodes
  • Reading and writing graphs
  • Drawing
  • 随机性
  • Exceptions
  • Utilities
  • 后端和配置
  • 术语表
  • Reference
  • Graph generators
  • navigable_sm...

navigable_small_world_graph#

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

返回一个可导航的小世界图。

可导航的小世界图是一个带有额外随机选择的长距离连接的有向网格。

[…]我们从一个节点集合开始[…]这些节点与:math:n times n`方形网格点集合相对应, :math:{(i, j): i in {1, 2, ldots, n}, j in {1, 2, ldots, n}}`, 并且我们定义两个节点:math:(i, j)`和:math:`(k, l)`之间的*网格距离*为它们之间的“网格步数”: :math:`d((i, j), (k, l)) = |k - i| + |l - j|。

对于一个通用常数:math:p >= 1,节点:math:u`有一条指向网格距离:math:`p`内所有其他节点的有向边——这些是它的*本地联系*。对于通用常数:math:`q >= 0`和:math:`r >= 0,我们还通过独立随机试验从:math:`u`构建:math:`q`条指向其他节点(长距离联系)的有向边;从:math:`u`到第:math:`i`条有向边的终点:math:`v`的概率与:math:`[d(u,v)]^{-r}`成正比。

—[1]

Parameters:
nint

网格一侧的长度;图中节点的数量因此为:math:n^2。

pint

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

qint

每个节点的长距离连接数。

rfloat

连接概率衰减的指数。连接到网格距离:math:d`的节点的概率为:math:`1/d^r。

dimint

网格的维度

seedinteger, random_state, 或 None (默认)

随机数生成状态的指示器。 参见 随机性 。

References

[1]
  1. Kleinberg. 小世界现象:一种算法视角。第32届ACM计算理论研讨会论文集,2000年。

On this page
  • navigable_small_world_graph()

© Copyright 2004-2024, NetworkX Developers.

Created using Sphinx 7.4.7.

Built with the PyData Sphinx Theme 0.15.4.

优云智算