This GitHub project showcases my proficiency in Python data structures and algorithms by implementing a captivating Wikiracer game which is a challenge to find the most efficient path to traverse between a Wikipedia page to another. The game is built using various algorithms traversing the WikiPedia graph data structure, including Breadth-First Search (BFS), Depth-First Search (DFS), and Dijkstra's algorithm. Additionally, it includes an HTML parsing code that does not rely on external libraries like BeautifulSoup.
Please note that the code in this repository is intended for demonstration purposes only and should not be used for any other purpose.
Once installed, you can use the following import statements to start instantiating BFS, DFS or Dijkstra's objects
import random import sys from typing import Callable, Iterator from itertools import chain from collections import defaultdict from types import ModuleType from importlib import reload from urllib.request import urlopen
A sample script to find the most efficient path between /wiki/Reese_Witherspoon
and /wiki/Academy_Awards
using BFS, DFS and Dijkstra's algorithms is shown below
bfs = BFSProblem() dfs = DFSProblem() dij = DijkstrasProblem() assert bfs.bfs(source = "/wiki/Reese_Witherspoon", goal = "/wiki/Academy_Awards") == ["/wiki/Reese_Witherspoon", "/wiki/Academy_Awards"] assert dfs.dfs(source = "/wiki/Reese_Witherspoon", goal = "/wiki/Academy_Awards") == ["/wiki/Reese_Witherspoon", "/wiki/Academy_Awards"] assert dij.dijkstras(source = "/wiki/Reese_Witherspoon", goal = "/wiki/Academy_Awards") == ["/wiki/Reese_Witherspoon", "/wiki/Academy_Awards"]
Please note that the code in this repository is provided solely for demonstration purposes and should not be used for any other purpose.
If you encounter any issues or bugs during your exploration of the repository, please open an issue, and I'll do my best to address it.