Skip to content

Rendu Ewen Horville#27

Open
The17thDoctor wants to merge 7 commits intobcalou:mainfrom
The17thDoctor:main
Open

Rendu Ewen Horville#27
The17thDoctor wants to merge 7 commits intobcalou:mainfrom
The17thDoctor:main

Conversation

@The17thDoctor
Copy link
Copy Markdown

No description provided.

Copy link
Copy Markdown
Owner

@bcalou bcalou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Voir mon commentaire plus bas et attention aux fichiers commités par erreur !

Comment thread pathfinder/pathfinder.py
from pathfinder.types import Path


class Pathfinder():
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

C'est bien, ça fonctionne, mais ce n'est pas tout à fait Diejkstra. Tu calcules tous les chemins possibles en parallèle, c'est un peu lourd (si on fait un print de self_paths dans le while, ça grimpe vite). J'ai comparé avec le mien sur 1M d'éxécution, c'est 45s vs 51s pour le tien. Pas une grosse différence, c'est vrai, mais elle existe !

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Je pense que c'est aussi ça qui t'empêche d'hériter plus grandement de cette classe pour AStar et SPFA, qui en réalité sont extrèmement proche du Diekstra classique. Or tu as du les ré-écrire presque en entier, surtout SPFA.
Quand Dijestra est écrit selon la méthode classique, l'override de AStar peut se limiter à quelques lignes, et celui de SPFA à deux lignes (je ne compte que le corps des fonctions). Je ne te dis pas de tout reprendre, c'est déjà bien que ça fonctionne. À toi de voir en fonction du temps que tu as ;)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

J'ai essayé de le ré-implémenter avec la méthode standard, je suis arrivé à faire marcher Dijkstra et A-Star sans trop de répétitions mais SPFA ne marchait pas. J'ai décidé de ne pas pousser la nouvelle version, j'ai juste poussé le fix pour les fichiers en trop.

@bcalou
Copy link
Copy Markdown
Owner

bcalou commented Feb 26, 2024

Bon travail, code bien organisé et fonctionnel malgré le détail précédemment cité

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.

2 participants