-
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
1 parent
4fd0a30
commit 1ef9ba2
Showing
7 changed files
with
67 additions
and
21 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
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Creates LFR benchmark graphs based on the properties of the main graph | ||
|
||
# Power law degree exponent = 3.5651290105965305 | ||
# Power law community size exponent = 4.1918 | ||
# Average degree = 6.783669266744867 | ||
# Minimum degree = 1 | ||
# Maximum degree = 6756 | ||
# Minimum community size = 21716 | ||
# Maximum community size = 116565 | ||
|
||
import networkx as nx |
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# From the main graph, randomly sample n nodes and their edges from the graph | ||
|
||
from random import sample | ||
|
||
import networkx as nx | ||
|
||
|
||
def generate_random_graph( | ||
G: nx.DiGraph, | ||
n: int, | ||
) -> nx.DiGraph: | ||
random_nodes = sample(list(G.nodes), n) | ||
return nx.subgraph(G, random_nodes) |
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,3 +1,4 @@ | ||
networkx~=2.8 | ||
scikit-learn~=1.1 | ||
click~=8.1 | ||
powerlaw |