Daa Mino Joban YAshveer
Daa Mino Joban YAshveer
Daa Mino Joban YAshveer
A PROJECT REPORT
Submitted by
BACHELOR OF ENGINEERING
IN
COMPUTER SCIENCE
Chandigarh University
JANUARY 2024
BONAFIDE CERTIFICATE
Certified that this project report “StudentBids: Elevate your campus lifestyle” is
the bonafide work of “Mohd Aakib(22BCS10045), Sanket Sharma
( 22BCS10046), YashVeer Singh(22BCS10047), who carried out the
project work under my/our supervision.
SIGNATURE
List of Tables 8
List of Standards 9
CHAPTER 1. INTRODUCTION 11
1. Identification of Client/ Need/ Relevant Contemporary issue 11
2. Identification of Problem 11
3. Identification of Tasks 11
4. Timeline 11
2. Existing solutions 12
3. Bibliometric analysis 12
4. Review Summary 12
5. Problem Definition 12
6. Goals/Objectives 12
2. Design Constraints 13
4. Design Flow 13
5. Design selection 13
6. Implementation plan/methodology 13
CHAPTER 4. RESULTS ANALYSIS AND VALIDATION 14
4.1. Implementation of solution 14
REFERENCES 16
APPENDIX 17
1. Plagiarism Report 17
2. Design Checklist 17
USER MANUAL 18
Figures
The need for efficient and reliable pathfinding is a common issue in various fields, including
network routing, transportation, and AI pathfinding for gaming. The ability to compute shortest
paths in weighted graphs efficiently is crucial in these domains, especially when dealing with
large-scale systems. Dijkstra’s algorithm is a widely used approach for this purpose.
Given a graph with weighted edges, the problem is to determine the shortest path from a given
source node to all other nodes. This problem is frequently encountered in real-world applications
such as mapping software (e.g., Google Maps), network optimization, and logistics. The goal is to
implement Dijkstra’s algorithm and compare it with other shortest path algorithms to analyze
efficiency and applicability in different scenarios.
=In this section, the tasks required to solve the identified problem are outlined. These tasks will
guide the overall approach to implementing and comparing shortest path algorithms. The key tasks
for this project are as follows:
1. Research and Algorithm Selection:
• Review various shortest path algorithms, including Dijkstra’s, Bellman-Ford, and A*.
• Select Dijkstra’s algorithm as the primary algorithm for implementation, due to its
efficiency with non-negative edge weights.
2. Graph Representation:
• Design the structure to represent the graph using adjacency lists or matrices.
• The graph should accommodate weighted, directed edges.
• Develop mechanisms to handle different types of graph inputs (e.g., large, sparse, or
dense graphs).
3. Dijkstra’s Algorithm Implementation:
• Implement Dijkstra’s algorithm using a priority queue to ensure efficient extractionof
the next closest node.
• Ensure that the algorithm is capable of finding the shortest path from a given source
node to all other nodes in the graph.
4. Visualization of the Algorithm:
• Create a graphical or visual representation of the graph and the shortest path process
using tools like Python’s NetworkX and Matplotlib libraries.
• Visualize the progress of the algorithm, showing how nodes are visited and paths are
updated.
5. Comparison with Bellman-Ford Algorithm:
• Implement the Bellman-Ford algorithm to handle graphs with negative edge weights.
• Compare the performance of both algorithms on different types of graphs, focusing
on time complexity, space complexity, and edge case handling.
6. Testing and Performance Evaluation:
• Test both algorithms on various graph inputs to evaluate their efficiency.
• Measure performance metrics such as execution time, memory usage, and scalability.
• Evaluate how the algorithms handle edge cases, such as graphs with disconnected
components or negative weight cycles.
7. Documentation and Reporting:
• Document the design, implementation, and results of the project.
• Write a detailed report on the algorithms' implementation and performancecomparison,
including visual aids and performance charts.
By breaking down the tasks, the project can be organized into manageable phases that guide the
design, implementation, and evaluation processes.
1.4. Timeline
The organization of the report is structured logically to guide the reader from the introduction of
the topic through the literature, methodology, results, and conclusions. Each chapter builds upon the
previous one, culminating in a comprehensive understanding of the project and its outcomes. This
structure is designed to facilitate clarity and coherence, making it easier for readers to follow the
development and findings of the project.
2. LITERATURE REVIEW/BACKGROUND STUDY
As previously outlined, this section details the historical evolution of shortest path algorithms, emphasizing
significant milestones from the introduction of Dijkstra’s algorithm in 1956 to the modern advances in
graphtheory and real-time applications. Understanding this timeline provides essential context for the current
research and highlights the continuous advancements in the field.
This section reviews the main algorithms used to solve shortest path problems,
discussing their mechanisms, strengths, and weaknesses:
• Dijkstra’s Algorithm:
• Designed for graphs with non-negative weights.
• Utilizes a priority queue to efficiently find the shortest path from a source node
to allother nodes.
• Time complexity of O(E + V log V), where E is the number of edges and V is
thenumber of vertices.
• Bellman-Ford Algorithm:
• Capable of handling graphs with negative edge weights.
• Uses dynamic programming to find the shortest path, iterating over all edges
andrelaxing them.
• Time complexity of O(VE), which can be slower than Dijkstra’s for large
graphswith non-negative weights.
• Floyd-Warshall Algorithm:
• Computes shortest paths between all pairs of nodes.
• Utilizes a dynamic programming approach.
• Time complexity of O(V^3), making it less efficient for large graphs but
useful fordense graphs.
• A Search Algorithm:*
• Combines Dijkstra’s algorithm with heuristics to optimize pathfinding.
• Efficient for specific applications, such as game development and navigation
systems.
• Heuristic-based, leading to faster search times in many scenarios.
• Johnson’s Algorithm:
• Designed for sparse graphs, computes all-pairs shortest paths efficiently.
• Uses both Dijkstra’s and Bellman-Ford algorithms to achieve better
performance inspecific situations.
• Time complexity of O(V^2 log V + VE), making it effective for large, sparse
graphs.
2.3. Bibliometric analysis
This section analyzes research publications and key contributors in the field of shortest path
algorithms. It includes:
• Leading Researchers:
• Key figures in graph theory and algorithm design, including Edsger W. Dijkstra
and Richard Bellman, are frequently cited in academic literature.
• Trends in Research:
• Increasing focus on applications in real-time systems, AI, and big data analytics.
• A shift toward heuristic and approximation methods for solving complex and
dynamic problems.
This section synthesizes the findings from the literature review, highlighting:
• Gaps in Existing Research:
• While many algorithms have been developed, there is a need for efficient
implementations that can handle real-time updates and dynamic graphs.
• Opportunities for Improvement:
• Integrating machine learning techniques with traditional algorithms could
enhance performance and adaptability.
• Relevance to Current Project:
• The project aims to address the limitations of existing solutions by focusing on
Dijkstra’s algorithm and providing a comparative analysis with the Bellman-
Ford algorithm, specifically regarding their efficiency and applicability to
various graph types.
2.5. Problem Definition
This section clearly defines the specific problem the project addresses:
• Many applications require efficient solutions for finding shortest paths in graphs, particularly
in transportation, logistics, and network optimization.
• The challenge lies in selecting the most suitable algorithm based on graph characteristics
(e.g., presence of negative weights, density) and performance requirements (e.g., real-time
processing).
6. Goals/Objectives
3. DESIGN FLOW/PROCESS
Critically evaluate the features identified in the literature and prepare the list of features
ideally required in the solution.
1.1.1. Standards:
Regulations/Economic/Environmental/Health/manufacturability/Safety/Professional/
Ethical/Social & Political Issues/Cost considered in the design.
Detailed explanation of the algorithm implementation, including code snippets, pseudocode, and
flowcharts.
2. Results Analysis
Comparison of execution times for different graph sizes.
3. Validation
Validation using benchmark problems, real-world data, and simulations. Error metrics and
performance analysis.
5.1. Conclusion
1. Conclusion
The project explored the implementation of shortest path algorithms, focusing primarily on
Dijkstra’s algorithm and the A* search algorithm. Both were evaluated for their performance in
terms of computational efficiency and suitability to different types of networks.
The core conclusion drawn from the implementation and testing is as follows:
• Dijkstra's Algorithm is robust and guarantees the shortest path across various types of graphs, both
sparse and dense. However, it tends to be computationally expensive for large-scale networks,
especially when applied to real-time systems where performance is crucial.
• A Search Algorithm* demonstrated clear advantages in scenarios where heuristic-driven pathfinding
is applicable. Its ability to prune unnecessary explorations through the use of a heuristic function
ledto faster results in cases like maze-solving and real-time navigation.
• Suitability for Static Networks: Dijkstra’s algorithm works well for static, non-changing networks
and when all nodes and edges need to be explored uniformly. It is often preferred when we cannot
assume anything about the graph structure or when dealing with negatively weighted edges (though
the algorithm needs to be modified in such cases).
• Efficiency in Dynamic Environments: The A* search algorithm excels in dynamic or complex
environments where heuristic functions such as Euclidean or Manhattan distances can be leveraged.
Its performance on dense graphs with many nodes was significantly better, making it ideal for real-
time systems like robotics or gaming where rapid decision-making is required.
Overall, the project effectively demonstrated the trade-offs between computational cost and
accuracy in different shortest path algorithms. The experimentation validated that no single
algorithm is universally best; rather, the choice of algorithm must be tailored to the specific
characteristics of the problem, such as graph size, edge weights, and real-time needs.
While the current project has delivered insights into the performance of Dijkstra’s and A*
algorithms, several avenues remain for future exploration and optimization:
1. Real-time Adaptation: Future work could focus on algorithms that adapt dynamically as
the graph structure changes (e.g., road closures or network interruptions). Algorithms like
D-Lite* and Fringe Search offer dynamic re-planning capabilities and should be explored
for environments where real-time updates are necessary.
2. Dynamic Weight Adjustments: Implementing solutions that allow for dynamic changes in
edge weights (e.g., traffic updates in navigation systems) would expand the algorithm’s
applicability in real-world problems.
1. Parallelized Algorithms: Parallel computing could drastically reduce the computation time
for algorithms like Dijkstra’s on large graphs by dividing the graph into segments processed
concurrently. Tools like CUDA (for GPU computation) or frameworks like Hadoop or
Apache Spark (for distributed computing) could be explored to scale the algorithms across
clusters of machines.
2. Cloud-Based Solutions: Implementing shortest path algorithms in a cloud environment
would allow real-time systems with massive datasets (e.g., city-wide traffic systems or
logistics networks) to compute optimal routes more efficiently.
1. Alternative Shortest Path Algorithms: Further research into alternative algorithms such
as Johnson's Algorithm (effective for sparse graphs) or Floyd-Warshall Algorithm (best
for solving all-pairs shortest path problems) can provide insights into better handling
specialized cases, especially when considering multi-source, multi-destination queries.
2. Hybrid Approaches: Exploring hybrid solutions that combine Dijkstra’s guaranteed
correctness with A*’s efficiency could be another avenue for optimizing large-scale graphs.
1. Healthcare Systems: Shortest path algorithms can be applied to patient transport or supply
chain management within hospitals to optimize response times in emergency situations.
2. IoT and Smart Cities: Integration with Internet of Things (IoT) systems can help in real-
time traffic management and autonomous vehicle navigation, allowing more efficient route
planning through live data inputs.
3. Game Development: In AI for gaming, pathfinding algorithms play a crucial role in non-
player character (NPC) navigation and decision-making. Optimizing A* or exploring other
graph search techniques could improve the fluidity and intelligence of NPCs.
6. REFERENCES
3.Hart, P. E., Nilsson, N. J., & Raphael, B. (1968). A Formal Basis for the Heuristic
Determination of Minimum Cost Paths. IEEE Transactions on Systems Science and
Cybernetics, 4(2), 100-107.The introduction of the A* search algorithm, including the role
of heuristic functions in optimizing graph traversal for shortest pathfinding.
4. Cormen, T. H., Leiserson, C. E., Rivest, R. L., & Stein, C. (2009). Introduction to
Algorithms (3rd ed.). MIT Press.This comprehensive textbook provides detailed
explanations of graph algorithms, including Dijkstra’s and A* algorithms, and offers
insights into their complexities and use cases.
5. Russell, S. & Norvig, P. (2021). Artificial Intelligence: A Modern Approach (4th ed.).
Pearson.A key reference for AI concepts, including heuristic search techniques like A* and
their applications in real-world problem-solving.
Zhan, F. B., & Noon, C. E. (1996). Shortest path algorithms: An evaluation using real road
networks. Transportation Science, 32(1), 65-73.This paper evaluates the performance of
various shortest path algorithms using real-world transportation networks, providing key
insights into practical use cases.
Koenig, S., & Likhachev, M. (2005). D* Lite. Proceedings of the AAAI Conference on
Artificial Intelligence, 476-483.A study introducing D*-Lite, a dynamic pathfinding
algorithm that adapts to changes in graph structure, with applications in robotics and
autonomous systems.
Peterson, D. (2020). Exploring the Shortest Path in Dynamic Graphs: Challenges and
Solutions. Journal of Graph Algorithms and Applications, 24(3), 341-359.This paper
addresses the challenges faced in dynamic pathfinding and presents a detailed review of
modern approaches in handling changes in real-time graph structures.