improved structure, doc and naming

This commit is contained in:
pb
2024-05-03 10:58:06 +02:00
parent b7441c7430
commit c79b693ba3
6 changed files with 93 additions and 43 deletions

View File

@@ -25,23 +25,27 @@ group if g.Links size > 0
end
graph -> graph : get list branches (end_lists, unvisited_links, current_branch)
note left: unvisited links and current branch\n are nilfor the first entry
loop link in endLinks
graph -> graph : create a new list representing the current branch
graph -> graph : copy Links id on a list
loop while hasParent
graph -> graph : currentLink = idList[i]
graph -> graph : get list previous links
group if link.dst == currentLink.Src
graph -> graph : do something
note right : TEST ALGO : edit a\n string that shows every branch
graph -> graph : change currentSrc with link.Src
graph -> graph : remove currentLink from idList
end
group else
graph -> graph : hasParent = false
end
group if len(previous_links) == 0
graph -> graph : add current list
end
loop for link in previous_links
graph -> graph : add the link to the current branch
graph -> graph : remove current link from unvisited links list
graph -> graph : get list branches (end_lists, unvisited_links, current_branch)
note right: for each link we retrieve the branch that\nprecedes it recursively,\n so once we hit the end of a branch\n the entire branch is returned\n to the node where a split happened\nor that is its source
end
end