Oop Project Report-Dijkstra
Oop Project Report-Dijkstra
VISUALIZER
Project Report
Teacher Name
Sir. Burhan Abbasi
Submitted by
The visualization begins when the user initiates the Dijkstra's algorithm by
pressing the button. The algorithm, known for its efficiency in finding the
shortest path in weighted graphs, starts exploring the grid from the start node
and systematically evaluates neighboring cells, assigning tentative
distances. This process is visually represented by highlighting the cells that
are currently being evaluated.
The project source code is structured using multiple files. Each heading
represents a file of the project and following the heading is the code
contained by that file.
The code is broken down into modules which is the essence of
JavaScript. Lets dive into these files and understand what each of them
does.
• TABLE.html
This HTML code represents the grid drawing functionality, which
plays a pivotal role in our visualization process. The grid serves as
the foundation for implementing visualization procedures.
• STYLE.css
This CSS file is responsible for the frontend design of our webpage,
enhancing its visual appeal and optimizing user interaction. It plays
a vital role in creating an engaging and aesthetically pleasing user
interface.
• CELL.js
This JavaScript file serves as a module that encapsulates a class
responsible for managing all the nodes within the grid. It plays a
crucial role in controlling the appearance and behavior of these
nodes based on user interactions. By encapsulating the functionality
within a class, it provides a structured approach to handle node
management, enabling seamless control and customization of node
appearance and behavior.
• WALL.js
This JavaScript file serves as a module that includes a child class of
Cell, specifically designed to manage the walls within the grid. By
encapsulating this functionality within a separate class, it allows for
independent and efficient management of walls across the grid. This
approach ensures modularity and facilitates easier customization
and manipulation of wall properties, enhancing the overall flexibility
and control over the grid structure.
• ALGORITHM.js
This JavaScript file serves as a module that implements the Dijkstra
algorithm. It contains a class called DijkstraAlgorithm, which
efficiently manages the execution of the algorithm. The class
comprises various functions that internally work together to
determine the shortest path. Additionally, it also handles the
visualization aspects of the algorithm, providing a comprehensive
solution for pathfinding. The modular design of the module allows for
easy integration and customization of the Dijkstra algorithm within
different projects, ensuring efficient pathfinding and visually
appealing representation.
• ADJACENCY-LIST.js
This JavaScript file serves as a core dependency, providing
essential functionality for managing adjacent nodes in a grid-based
environment. It includes a function called AdjacenList, which
efficiently retrieves and organizes the adjacent nodes for each grid
element. By utilizing the AdjacenList function, the file enables
convenient access to neighboring nodes, facilitating various
operations such as pathfinding, graph traversal, and network
analysis. Its inclusion ensures an optimized and streamlined
approach to handling adjacency relationships within a grid structure.
• INDEX.js
This JavaScript file serves as the central hub for managing all the
modules within the project. It plays a pivotal role in coordinating the
various modules, handling user events, and interacting with the
DOM (Document Object Model). By consolidating the functionality of
different modules, it provides a unified and streamlined approach to
managing user interactions and visualizations. Its responsibilities
include capturing user input, processing events, updating the DOM
dynamically, and ensuring smooth communication and
synchronization between different components. As the backbone of
the project's architecture, this file plays a crucial role in orchestrating
the seamless integration of modules and facilitating a cohesive user
experience.
Walls.js
AdjacencyList.js
Algorithm.js
Index.js
Style.css
WORKING
DRAWING WALLS
VISUALIZING ANIMATION