반응형
반응형

NetworkX1는 Python 프로그래밍 언어를 위한 복잡한 네트워크 구조를 생성, 조작, 분석, 모델링, 시각화, 그리고 저장하기 위한 강력한 라이브러리입니다. 사회 네트워크, 웹의 링크 구조, 인프라 네트워크, 과학 연구에서의 상호작용 등 다양한 유형의 네트워크를 다룰 수 있습니다. NetworkX는 데이터 구조로 그래프를 제공하며, 이 그래프는 노드와 엣지(간선)로 구성되어 있습니다.

 

주요 특징

  1. 다양한 그래프 타입 지원: 방향성이 있는 그래프(Directed Graphs), 방향성이 없는 그래프(Undirected Graphs), 다중 그래프(MultiGraphs) 등 다양한 유형의 그래프를 생성하고 조작할 수 있습니다.
  2. 풍부한 알고리즘 지원: 최단 경로, 클러스터링, 센트럴리티, 커뮤니티 구조 탐지 등 네트워크 구조를 분석하기 위한 다양한 알고리즘이 내장되어 있습니다.
  3. 그래프 생성과 조작: 그래프를 쉽게 생성하고 수정할 수 있으며, 노드와 엣지를 추가하거나 제거하는 등의 작업을 손쉽게 수행할 수 있습니다.
  4. 대규모 네트워크 처리 능력: NetworkX는 메모리 내에 저장할 수 있는 한에서 수천에서 수백만 개의 노드와 엣지를 가진 그래프를 처리할 수 있습니다.
  5. 시각화: Matplotlib와 통합되어 간단한 네트워크 구조를 시각화할 수 있으며, 복잡한 시각화를 위해서는 Graphviz와 같은 도구와 함께 사용할 수 있습니다.

 

pip install networkx

 

 

 

https://wikidocs.net/229298

 

NetworkX: 네트워크 구조의 모델링 및 시각화

![](https://wikidocs.net/images/page/229298/NetworkX_logo.png) NetworkX[^networkx]는 Python 프로그래밍 …

wikidocs.net

 

 

 

반응형
반응형

networkx - Graph Layout

 

Graph Layout

Node positioning algorithms for graph drawing.

For random_layout() the possible resulting shape is a square of side [0, scale] (default: [0, 1]) Changing center shifts the layout by that amount.

For the other layout routines, the extent is [center - scale, center + scale] (default: [-1, 1]).

Warning: Most layout routines have only been tested in 2-dimensions.

bipartite_layout(G, nodes[, align, scale, ...]) Position nodes in two straight lines.
circular_layout(G[, scale, center, dim]) Position nodes on a circle.
kamada_kawai_layout(G[, dist, pos, weight, ...]) Position nodes using Kamada-Kawai path-length cost-function.
planar_layout(G[, scale, center, dim]) Position nodes without edge intersections.
random_layout(G[, center, dim, seed]) Position nodes uniformly at random in the unit square.
rescale_layout(pos[, scale]) Returns scaled position array to (-scale, scale) in all axes.
rescale_layout_dict(pos[, scale]) Return a dictionary of scaled positions keyed by node
shell_layout(G[, nlist, rotate, scale, ...]) Position nodes in concentric circles.
spring_layout(G[, k, pos, fixed, ...]) Position nodes using Fruchterman-Reingold force-directed algorithm.
spectral_layout(G[, weight, scale, center, dim]) Position nodes using the eigenvectors of the graph Laplacian.
spiral_layout(G[, scale, center, dim, ...]) Position nodes in a spiral layout.
multipartite_layout(G[, subset_key, align, ...]) Position nodes in layers of straight lines.

 

https://networkx.org/documentation/latest/reference/drawing.html#module-networkx.drawing.layout

 

Drawing — NetworkX 2.7rc1.dev0 documentation

Drawing NetworkX provides basic functionality for visualizing graphs, but its main goal is to enable graph analysis rather than perform graph visualization. In the future, graph visualization functionality may be removed from NetworkX or only available as

networkx.org

반응형
반응형

프로젝트 가상공간에 들어가서

> conda install -c anaconda networks

 

https://pypi.org/project/networkx/

 

networkx

Python package for creating and manipulating graphs and networks

pypi.org

Installers  - https://anaconda.org/anaconda/networkx

conda install 

  •  linux-ppc64le  v2.2
  •  linux-64  v2.2
  •  win-32  v2.2
  •    noarch  v2.6.3
  •  osx-64  v2.2
  •  linux-32  v2.2
  •  win-64  v2.2
To install this package with conda run:
conda install -c anaconda networkx
반응형

+ Recent posts