From 2c938b53c8a6c44c3b0d8f619fee9cf9413216ea Mon Sep 17 00:00:00 2001 From: sar99 <43995983+sar99@users.noreply.github.com> Date: Mon, 23 Mar 2020 19:46:05 +0530 Subject: [PATCH] Added note of caution in `minimum_spanning_tree(_parallel)` (#199) --- pydatastructs/graphs/algorithms.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/pydatastructs/graphs/algorithms.py b/pydatastructs/graphs/algorithms.py index 3d6765f48..79cfeaef3 100644 --- a/pydatastructs/graphs/algorithms.py +++ b/pydatastructs/graphs/algorithms.py @@ -265,6 +265,14 @@ def minimum_spanning_tree(graph, algorithm): ========== .. [1] https://en.wikipedia.org/wiki/Kruskal%27s_algorithm + + Note + ==== + + The concept of minimum spanning tree is valid only for + connected and undirected graphs. So, this function + should be used only for such graphs. Using with other + types of graphs may lead to unwanted results. """ import pydatastructs.graphs.algorithms as algorithms func = "_minimum_spanning_tree_" + algorithm + "_" + graph._impl @@ -337,6 +345,14 @@ def minimum_spanning_tree_parallel(graph, algorithm, num_threads): ========== .. [1] https://en.wikipedia.org/wiki/Kruskal%27s_algorithm#Parallel_algorithm + + Note + ==== + + The concept of minimum spanning tree is valid only for + connected and undirected graphs. So, this function + should be used only for such graphs. Using with other + types of graphs will lead to unwanted results. """ import pydatastructs.graphs.algorithms as algorithms func = "_minimum_spanning_tree_parallel_" + algorithm + "_" + graph._impl