Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion compsoc/profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ def __init__(self, pairs: Set[Tuple[int, Tuple[int, ...]]], num_candidates: Opti
self.__calc_votes_per_candidate()
# Initialize a Path Preference Graph
self.path_preference_graph = {candidate: {} for candidate in self.candidates}
self.__calc_path_preference()

# ---------------------------------------------
# Comparison routines
Expand Down Expand Up @@ -289,7 +290,6 @@ def __calc_paths(self, candidate1, candidate2, candidates=None):
# End of path
if candidate == candidate2:
paths.append(path) # add to possible paths
path = [] # start a new path
else: # path isn't over
new_candidates = candidates - {candidate}
subpath = self.__calc_paths(candidate, candidate2,
Expand All @@ -298,6 +298,7 @@ def __calc_paths(self, candidate1, candidate2, candidates=None):
# concatenate with current path and save it
for weights in subpath:
paths.append(path + weights)
path = [] # start a new path
# Return a list of possible paths between candidate1 and candidate2
return paths

Expand Down