Floyd Warshall Problem

Duration: 7 min

This video lesson is available to enrolled students.

Return to /learn/TPSC-ASSISTANT-TECHNICAL-OFFICER/algorithms/dynamic-programming/floyd-subset-sum/asset-floyd-warshall-problem after enrolling

Inside: a video lesson and guided study material.

Module outline

  1. About Course: About the Course
  2. Paper 2 | Digital Logic: Digital Systems & Boolean Basics, Logic Gates & Hardware, Boolean Expression, Boolean Minimization, Combinational Circuit, Sequential Circuits, Number System, Number Representation, Floating Point Rep
  3. Paper 2 | Computer Organization And Architecture: Basics of COA, Cache Memory Organization, Input Output Organisation, Pipelining, Control Unit Design, Instr Formats & Modes, Programming the Basic Computer
  4. Paper 2 | Analog And Digital Communication: Introduction to Communication Systems & Random Signals, Analog Communication Systems, Information Theory & Digital Communication Fundamentals, Digital Modulation & Detection Techniques, Error Control, Synchronization & Multiple Access Techniques
  5. Paper 2 | Programming in C: C Fundamentals, Control Flow, Functions, Arrays & Pointers, Storage Classes, Structures & Enums, DMA, Macros, Scoping & File Handling
  6. Paper 2 | Data Structures And Programming: Introduction to DS, Array, Stack, Queue, Linked List, Tree, Graphs, Hashing, Java, OOPS with C++, Java Fundamentals, Array, String, IO & References
  7. Paper 2 | Algorithms: Algorithm Analysis, Sorting Algorithms, Time Complexity Analysis, Greedy Algorithms, Dynamic Programming, Minimum Spanning Trees, Shortest Path Algos
  8. Paper 2 | Compiler Design: Intro to Compilers, Lexical Analysis, Grammar & CFG, Syntax Analysis: Top-Down, Syntax Analysis: Bottom-Up, Semantic Analysis & SDT, Intermediate Code Gen, Code Optimization, Run Time Environment
  9. Paper 2 | Operating System: Introduction to OS, Process Management, CPU Scheduling, Process Synchronization, Threads & Process Creation, Deadlock, Memory Management, Virtual Memory, Disc Scheduling, File Management, Unix OS, Linux OS
  10. Paper 2 | Databases: Basics of DBMS, ER Diagram, Relational Model & Functional Dependencies, Keys & Integrity Constraints, Normalization (1NF - BCNF), Decomposition Properties & 4NF, Relational Algebra, SQL, Relational Calculus, File Organization & Indexing, Transaction Management, Concurrency Control
  11. Paper 2 | Information Systems and Software Engineering: Fundamentals of Software Engineering, Software Requirements and Quality Assurance, Software Design, Estimation and Metrics, Software Testing, Software Maintenance and Configuration Management
  12. Paper 2 | Computer Networks: 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
  13. Paper 2 | Internet & Web Technologies: Website, Browser & Services, Internet Fundamentals, Web Design & Development, Protocols & Services, Web Publishing & Hosting, Server Side & Security, Emerging Technologies, HTML Basics, JavaScript-Basics, CSS, XML, HTML5
  14. Paper 2 | Cyber Security And Emerging Technologies: Emerging Tech Trends
  15. Paper 2 | Cloud Technology: Cloud Computing
  16. Paper 2 | Probability and statistics: Probability, Statistics
  17. Paper-1 English: Vocabulary, Preposition, Articles, Comprehension / Reading Comprehension / Unseen Passages (Critical Reasoning) (Paragraph Questions), Sentence Re-arrangements (Para Jumbles) (Narrative Sequencing), Sentence Correction (Error Correction), Sentence Completion (Fill in the blanks), Cloze Test (Cloze Passage), Sentence Construction
  18. Paper 1 General Mental Ability & Logical reasoning: Ratio and Proportion (Ratios), Divisibility Rules, Data Interpretation, Mixture and Alligation, Permutation and Combination, Logarithm, Number System, HCF LCM, Sequence and Series (Series), Speed Time and Distance, Series (Number and Letter Series) (Numerical Relations and Reasoning), Coding Decoding, Data Sufficiency, Non Verbal Reasoning (Spatial Aptitude) (Spatial Reasoning) (Visual Reasoning), Percentage, Average, Powers and Exponents (Surds and Indices), Algebra, Profit and Loss, Simple Interest and Compound Interest, Time and Work, Pipe and Cistern, Mensuration and Geometry, Mental Ability, Age Problems, Partnership, Arithmetic, Speed Mathematics and Basic Mathematics, Syllogisms, Deductive and Inductive Reasoning (Logical Deduction and Induction) (Prepositional Reasoning), Seating Arrangements, Blood Relations, Directions (Direction Test), Analytical Reasoning (Counting Figures Reasoning), Puzzle Solving (Puzzles), Calendar, Clock, Cubes & Dices, Selection Decision Table (Decision Making), Logical Sequence Of Words, Venn Diagram, Analogy
  19. Paper-1 General Knowledge & Current Affairs: State Wise GK, History, Geography, GK- Current Affairs, Static General Knowledge
  20. Full Length Mock Test:
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

  1. 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. 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.

  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.

Loading lesson…