Skip to content

Commit

Permalink
Ensure reliable edge density of generated DAG (#54)
Browse files Browse the repository at this point in the history
Closes #44
  • Loading branch information
JohannesHuegle authored Feb 9, 2023
1 parent 7b29d25 commit 9a09b49
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion manm_cs/graph/graph_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ def generate_continuous_variable(self, parents, node_idx) -> 'ContinuousVariable

def generate_dag(self, seed: int) -> 'DiGraph':
# Generate graph using networkx package
G = nx.gnp_random_graph(n=self.num_nodes, p=self.edge_density, seed=seed, directed=True)
G = nx.gnp_random_graph(n=self.num_nodes, p=self.edge_density, seed=seed, directed=False)
# Convert generated graph to DAG
dag = nx.DiGraph()
dag.add_nodes_from(G)
Expand Down

0 comments on commit 9a09b49

Please sign in to comment.