Skip to content

Commit 58aeb70

Browse files
imp2002shermanhui
authored andcommitted
[mypy] Fix type annotations for graphs (TheAlgorithms#4622)
* Fix mypy error for frequent_pattern_graph_miner.py * Fix mypy error for markov_chain.py
1 parent fdfd613 commit 58aeb70

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

graphs/frequent_pattern_graph_miner.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,6 @@ def preprocess(edge_array):
227227
support = get_support(cluster)
228228
graph = construct_graph(cluster, nodes)
229229
find_freq_subgraph_given_support(60, cluster, graph)
230-
paths = []
230+
paths: list = []
231231
freq_subgraph_edge_list = freq_subgraphs_edge_list(paths)
232232
print_all()

graphs/markov_chain.py

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ def transition(self, node: str) -> str:
3535
current_probability += self.connections[node][dest]
3636
if current_probability > random_value:
3737
return dest
38+
return ""
3839

3940

4041
def get_transitions(

0 commit comments

Comments
 (0)