TiloRC / p-wikiracer

0 stars 1 forks source link

Alg Team: Implement Greedy Algorithm #3

Open TiloRC opened 11 months ago

TiloRC commented 11 months ago

Implement Greedy in greedy.py which should inherit the abstract base class WikiRacer[^1] from wikiracer.py. See RandomRacer for an example on how to implement a class that inherits WikiRacer.

Greedy starts at the start page and considers each link coming from the start page. Links to wikipedia pages with titles that are similar to the destination page should be ranked most highly.[^2] The page that is ranked most highly similar to the destination page is then visited and all of the pages linking from that page are considered. This process is repeated until Greedy reaches a page that links directly to the destination page or some maximum page visited threshold is reached.

Check out the wikipedia page for Greedy Best-First Search—not be confused with breadth-first search . The algorithm is a little bit different than what you'll be implementing but it's mostly the same idea. You only need to consider pages that one the wikipedia page you're currently on so you don't need to worry about using a queue.

[^1]: As an abstract base class, WikiRacer provides us with a template to implement other WikiRacers that use the same methods. This will make comparing different WikiRacers easier.

[^2]: You'll want to use some measure of document similarity.

TiloRC commented 11 months ago

Try to get a pull request open before next meeting. It's okay if it only includes partial progress. Name the branch you use to create the PR something short related to this issue such as "greedy".

Edit: Include "fixes #3" in the PR description. This will help GitHub know that your PR is related to this issue.

You should co-author the commits you make so you both get credit for the work you get done together. See this guide to learn how to co-author commits.