mirror of
https://github.com/TheAlgorithms/Python.git
synced 2024-11-27 15:01:08 +00:00
Merge branch 'scarfinos/basic_graphs' of https://github.com/Scarfinos/Python into scarfinos/basic_graphs
This commit is contained in:
commit
2cdda8a7b6
|
@ -8,7 +8,6 @@ def _input(message):
|
||||||
def initialize_unweighted_directed_graph(
|
def initialize_unweighted_directed_graph(
|
||||||
node_count: int, edge_count: int
|
node_count: int, edge_count: int
|
||||||
) -> dict[int, list[int]]:
|
) -> dict[int, list[int]]:
|
||||||
|
|
||||||
graph: dict[int, list[int]] = {}
|
graph: dict[int, list[int]] = {}
|
||||||
for i in range(node_count):
|
for i in range(node_count):
|
||||||
graph[i + 1] = []
|
graph[i + 1] = []
|
||||||
|
@ -22,7 +21,6 @@ def initialize_unweighted_directed_graph(
|
||||||
def initialize_unweighted_undirected_graph(
|
def initialize_unweighted_undirected_graph(
|
||||||
node_count: int, edge_count: int
|
node_count: int, edge_count: int
|
||||||
) -> dict[int, list[int]]:
|
) -> dict[int, list[int]]:
|
||||||
|
|
||||||
graph: dict[int, list[int]] = {}
|
graph: dict[int, list[int]] = {}
|
||||||
for i in range(node_count):
|
for i in range(node_count):
|
||||||
graph[i + 1] = []
|
graph[i + 1] = []
|
||||||
|
@ -37,7 +35,6 @@ def initialize_unweighted_undirected_graph(
|
||||||
def initialize_weighted_undirected_graph(
|
def initialize_weighted_undirected_graph(
|
||||||
node_count: int, edge_count: int
|
node_count: int, edge_count: int
|
||||||
) -> dict[int, list[tuple[int, int]]]:
|
) -> dict[int, list[tuple[int, int]]]:
|
||||||
|
|
||||||
graph: dict[int, list[tuple[int, int]]] = {}
|
graph: dict[int, list[tuple[int, int]]] = {}
|
||||||
for i in range(node_count):
|
for i in range(node_count):
|
||||||
graph[i + 1] = []
|
graph[i + 1] = []
|
||||||
|
|
Loading…
Reference in New Issue
Block a user