Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated __calc_path_preference to use Floyd Warshall #54

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

eminberker
Copy link

The existing __calc_path_preference function in profile.py runs in exponential time (in fact O(m!)) since every recursive call can have up to m recursive calls. I am guessing this is the reason the chairs decided not to include __calc_path_preference in the profile initialization. The widest paths (i.e., strengths) for Schulze can also be done using the Floyd Warshall algorithms, which runs in O(n^3) time. In my local runs, this version __calc_path_preference runs much much much faster than the original version.

The existing __calc_path_preference function in profile.py runs in exponential time (in fact O(m!)) since every recursive call can have up to m recursive calls. I am guessing this is the reason the chairs decided not to include __calc_path_preference in the profile initialization. The widest paths (i.e., strengths) for Schulze can also be done using the Floyd Warshall algorithms, which runs in O(n^3) time. In my local runs, this version __calc_path_preference runs much much much faster than the original version.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant