Floyd Warshall Problem
Duration: 7 min
This video lesson is available to enrolled students.
Inside: a video lesson and guided study material.
Module outline
- Quantitative Ability: Percentage, Profit and Loss, Ratio and Proportion (Ratios), Average, Time and Work, Speed Time and Distance, Simple Interest and Compound Interest, Age Problems, Number System, Divisibility Rules, HCF LCM, Algebra, Permutation and Combination, Probability, Data Interpretation, Logarithm, Sequence and Series (Series), Powers and Exponents (Surds and Indices), Speed Mathematics and Basic Mathematics
- Logical Reasoning: Seating Arrangements, Puzzle Solving (Puzzles), Data Arrangement, Coding Decoding, Blood Relations, Directions (Direction Test), Ranking, Order and Sequence, Data Sufficiency, Venn Diagram, Inequality, Series (Number and Letter Series) (Numerical Relations and Reasoning), Logical Sequence Of Words, Deductive and Inductive Reasoning (Logical Deduction and Induction) (Prepositional Reasoning), Selection Decision Table (Decision Making), Analogy, Non Verbal Reasoning (Spatial Aptitude) (Spatial Reasoning) (Visual Reasoning)
- Verbal Ability: Comprehension / Reading Comprehension / Unseen Passages (Critical Reasoning) (Paragraph Questions), Subject Verb Agreement (Verb Noun Agreement), Tenses, Articles, Preposition, Conjunction, Modals, Active Passive Voice (Voice), Direct and Indirect Speech, Vocabulary, Sentence Re-arrangements (Para Jumbles) (Narrative Sequencing), Sentence Completion (Fill in the blanks), Sentence Correction (Error Correction), Cloze Test (Cloze Passage), Facts, Inference and Judgements
- Programming Fundamentals (Technical): C Fundamentals
- Data Structures (Technical): Introduction to DS, Array, Stack, Queue, Linked List, Tree, Graphs, Hashing
- Algorithms (Technical): Algorithm Analysis, Sorting Algorithms, Greedy Algorithms, Dynamic Programming, Minimum Spanning Trees, Shortest Path Algos, Time Complexity Analysis, Advanced Algorithms
- OOPs (Technical): Object Oriented Programming (OOPS)
- DBMS (Technical): Basics of DBMS, ER Diagram, Relational Model & Functional Dependencies, Keys & Integrity Constraints, Normalization (1NF - BCNF), Decomposition Properties & 4NF, File Organization & Indexing, Relational Algebra, Relational Calculus, Transaction Management, Concurrency Control, Database Recovery, ORDBMS, Database Security & Authorization, Query Processing & Optimization, Enhanced Data Models, Data Warehousing & Mining, Big Data Systems, NoSQL
- SQL (Technical): SQL
- Operating Systems (Technical): Introduction to OS, Process Management, CPU Scheduling, Process Synchronization, Deadlock, Threads & Process Creation, Memory Management, Virtual Memory, Disc Scheduling, File Management, Windows OS, Linux OS, Security, Distributed Systems, Virtual Machines
- Computer Networks (Technical): Introduction to CN, Data Communication, DLL: Access Control, DLL: Flow Control, DLL: Error Control, DLL: Framing, Data Link Layer - Ethernet, Net Layer: IPv4 & Proto, Net Layer: IP Addressing, Net Layer:Routing Protocol, Transport Layer Services, TL: Congestion & UDP, Application Layer, Hardware basics, Network Security, Mobile Technology, Cloud Computing and IoT, Cyber and Info Security
- Software Engineering (Technical): Fundamentals of Software Engineering, Software Requirements and Quality Assurance, Software Design, Estimation and Metrics, Software Testing, Software Maintenance and Configuration Management
- Coding/Automata Round: Coding Questions by Yash Sir, C Programming by Yash Sir, Programming in C++, Java, Python for Placements by Yash Sir, Pseudo Codes
- Personality / Behavioral Assessment: Behavioral Assessment (Behavioral Competency Profiling) (Psychometric Test)
- Writing Assessment: English Writing Ability
AI summary & chapters
AI Summary
An AI-generated summary of this video lecture.
The video is an educational tutorial demonstrating the Floyd-Warshall algorithm to solve the all-pair shortest path problem in a directed weighted graph. The instructor uses a specific example with three nodes (a, b, c) to walk through the iterative process of updating distance and predecessor matrices. The lecture covers the initialization phase, followed by three distinct iterations where each node is used as an intermediate vertex to relax edge weights. Key visual elements include the hand-drawn graph, the initial matrices D0 and Pi0, and the step-by-step updates to Da, Db, and Dc. The instructor explicitly writes values into the matrices on the slide, highlighting changes in path costs and predecessors. The text "running time of O(n^3)" is visible on the right side of the screen throughout the process.
Chapters
0:00 – 2:00 00:00-02:00
The instructor introduces the problem statement: "Consider a Directed weighted Graph and find all pair shortest path?" displayed at the top of the slide. He presents a hand-drawn graph with nodes a, b, and c, and edges labeled with weights such as 6, 4, 2, 3, and 11. He begins constructing the initial distance matrix D0 and predecessor matrix Pi0. He fills the diagonal elements with 0. He populates D0 with direct edge weights: D0_ab=4, D0_ac=11, D0_ba=6, D0_bc=2, and D0_ca=3. For non-existent edges like c to b, he writes infinity. He also fills Pi0 with the source node indices for existing edges. The matrix structure is clearly labeled with row and column headers 'a', 'b', 'c'.
2:00 – 5:00 02:00-05:00
The lecture moves to the first iteration, Da, where node 'a' is the intermediate. The instructor explains the update rule Dk_ij = min(Dk-1_ij, Dk-1_ik + Dk-1_kj). He calculates that the path from c to b can be improved via a. The cost becomes D0_ca + D0_ab = 3 + 4 = 7, which is less than infinity. So, Da_cb is updated to 7, and Pi^a_cb becomes 'a'. Other entries like Da_ba remain 6. Next, he proceeds to iteration Db. He checks paths through 'b'. He finds that the path from a to c can be shortened. The cost via b is D0_ab + D0_bc = 4 + 2 = 6, which is less than the original 11. Thus, Db_ac is updated to 6, and Pi^b_ac is set to 'b'. He also notes that Db_ca remains 3.
5:00 – 6:41 05:00-06:41
The final iteration, Dc, uses node 'c' as the intermediate. The instructor updates the matrices based on paths through 'c'. He identifies that the path from b to a can be shortened. The cost via c is Db_bc + Db_ca = 2 + 3 = 5, which is less than the previous distance of 6. Therefore, Dc_ba is updated to 5, and Pi^c_ba is set to 'c'. He verifies other entries remain optimal. The video concludes by displaying the final matrices Dc and Pi^c, which contain the shortest distances and predecessors for all pairs. The final distance matrix shows Dc_ab=4, Dc_ac=6, Dc_bc=2, Dc_ca=3, and Dc_cb=7.
The video provides a clear, step-by-step walkthrough of the Floyd-Warshall algorithm. It effectively bridges the gap between the theoretical relaxation formula and its practical application on a small graph. By visually updating the matrices row by row and iteration by iteration, the instructor clarifies how intermediate nodes progressively improve path estimates. The final matrices represent the complete solution to the all-pair shortest path problem for the given graph.