Skip to content
This repository has been archived by the owner on Mar 20, 2020. It is now read-only.

Commit

Permalink
#4: Add candidate_paths for store the tips
Browse files Browse the repository at this point in the history
  • Loading branch information
Toshiyuki Yokoyama committed Jul 9, 2019
1 parent 8e0faab commit b88f9a1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/sort.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
class Profile:
node: NodeIndex
paths: List[Path]
candidate_paths: List[Path]
duplicate: int = 0


Expand All @@ -25,7 +26,7 @@ def __init__(self, paths: List[Path], nodes = {}):
def recursive_merge(self, primary_path_index: int = 0):
profile = []
for node_index in self.paths[primary_path_index].nodes:
profile.append(Profile(node_index, [self.paths[primary_path_index]], 0))
profile.append(Profile(node_index, [self.paths[primary_path_index]], [self.paths[primary_path_index]], 0))
for i, path in enumerate(self.paths):
if i == primary_path_index:
continue
Expand All @@ -50,6 +51,8 @@ def lcs(self, s1: List[Profile], s2: Path) -> List[Profile]:
if s1[i-1].node == s2.nodes[j-1]:
prev_paths = s1[i-1].paths
prev_paths.append(s2)
candidate_paths = s1[i-1].candidate_paths

index.append(Profile(s1[i-1].node, prev_paths, s1[i-1].node.node.index in prev))
prev.add(s1[i-1].node.node.index)
i -= 1
Expand Down

0 comments on commit b88f9a1

Please sign in to comment.