-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
18 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,17 @@ | ||
print("exec sources directory") | ||
import cfpq_data | ||
import networkx as nx | ||
import random | ||
import matplotlib.pyplot as plt | ||
|
||
n = 3 # количество вершин | ||
p = 0.3 # вероятность соединения вершин | ||
|
||
random_graph = nx.erdos_renyi_graph(n, p) | ||
print(random_graph.nodes()) | ||
print(random_graph.edges()) | ||
print(random_graph.number_of_nodes()) | ||
''' | ||
fig, ax = plt.subplots() # создать фигуру и оси | ||
nx.draw(random_graph, with_labels=True, ax=ax) # сделать рисунок на указанных осях | ||
plt.show() # показать граф | ||
''' |