KCC: Add graph.dijkstra and setup_dijkstra() docstrings
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Thu, 7 May 2015 02:06:42 +0000 (14:06 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 12 Jun 2015 04:57:16 +0000 (06:57 +0200)
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
python/samba/kcc/graph.py

index a005c59c7f39b592f91a0689973c7e58582dae8c..58f06543b216d17ed43aa2d24eb28797f8eb97c2 100644 (file)
@@ -346,6 +346,13 @@ def setup_vertices(graph):
 
 
 def dijkstra(graph, edge_type, include_black):
+    """Perform Dijkstra's algorithm on an intersite graph.
+
+    :param graph: an IntersiteGraph object
+    :param edge_type: a transport type GUID
+    :param include_black: boolean, whether to include black vertices
+    :return: None
+    """
     queue = []
     setup_dijkstra(graph, edge_type, include_black, queue)
     while len(queue) > 0:
@@ -358,6 +365,14 @@ def dijkstra(graph, edge_type, include_black):
 
 
 def setup_dijkstra(graph, edge_type, include_black, queue):
+    """Initialise a queue for Dijksta's algorithm.
+
+    :param graph: an IntersiteGraph object
+    :param edge_type: a transport type GUID
+    :param include_black: boolean, whether to include black vertices
+    :param queue: the empty queue to initialise.
+    :return: None
+    """
     setup_vertices(graph)
     for vertex in graph.vertices:
         if vertex.is_white():