Skip to content

Commit 2c938b5

Browse files
authored
Added note of caution in minimum_spanning_tree(_parallel) (#199)
1 parent fcb27e6 commit 2c938b5

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

pydatastructs/graphs/algorithms.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,14 @@ def minimum_spanning_tree(graph, algorithm):
265265
==========
266266
267267
.. [1] https://en.wikipedia.org/wiki/Kruskal%27s_algorithm
268+
269+
Note
270+
====
271+
272+
The concept of minimum spanning tree is valid only for
273+
connected and undirected graphs. So, this function
274+
should be used only for such graphs. Using with other
275+
types of graphs may lead to unwanted results.
268276
"""
269277
import pydatastructs.graphs.algorithms as algorithms
270278
func = "_minimum_spanning_tree_" + algorithm + "_" + graph._impl
@@ -337,6 +345,14 @@ def minimum_spanning_tree_parallel(graph, algorithm, num_threads):
337345
==========
338346
339347
.. [1] https://en.wikipedia.org/wiki/Kruskal%27s_algorithm#Parallel_algorithm
348+
349+
Note
350+
====
351+
352+
The concept of minimum spanning tree is valid only for
353+
connected and undirected graphs. So, this function
354+
should be used only for such graphs. Using with other
355+
types of graphs will lead to unwanted results.
340356
"""
341357
import pydatastructs.graphs.algorithms as algorithms
342358
func = "_minimum_spanning_tree_parallel_" + algorithm + "_" + graph._impl

0 commit comments

Comments
 (0)