# Flooding algorithm

> Mediated Wiki article. Canonical URL: https://mediated.wiki/source/Flooding_algorithm
> Markdown URL: https://mediated.wiki/source/Flooding_algorithm.md
> Source: https://en.wikipedia.org/wiki/Flooding_algorithm
> Source revision: 1300467922
> License: Creative Commons Attribution-ShareAlike 4.0 International (https://creativecommons.org/licenses/by-sa/4.0/)

{{Short description|Class of algorithms}}
{{Notability|date=January 2024}}
A '''flooding algorithm''' is an [algorithm](/source/algorithm) for distributing material to every part of a [graph](/source/Graph_(discrete_mathematics)).  The name derives from the concept of inundation by a [flood](/source/flood). Flooding algorithms are used in [computer networking](/source/Flooding_(computer_networking)) and [graphics](/source/Flood_fill). Flooding algorithms are also useful for solving many mathematical problems, including [maze](/source/maze) problems and many problems in [graph theory](/source/graph_theory).

Different flooding algorithms can be applied for different problems, and run with different [time complexities](/source/time_complexities). For example, the [flood fill](/source/flood_fill) algorithm is a simple but relatively robust algorithm that works for intricate geometries and can determine which part of the (target) area that is [connected](/source/Glossary_of_graph_theory) to a given (source) node in a multi-dimensional [array](/source/Array_data_structure), and is trivially generalized to arbitrary graph structures. If there instead are several source nodes, there are no obstructions in the geometry represented in the multi-dimensional array, and one wishes to segment the area based on which of the source nodes the target nodes are closest to, while the flood fill algorithm can still be used, the [jump flooding algorithm](/source/jump_flooding_algorithm) is potentially much faster as it has a lower time complexity. Unlike the flood fill algorithm, however, the jump flooding algorithm cannot trivially be generalized to unstructured graphs.<ref>{{Cite web |title=What is Flooding Algorithm |url=https://www.igi-global.com/dictionary/flooding-algorithm/11267#:~:text=A%20flooding%20algorithm%20is%20an,part%20of%20some%20routing%20protocols. |website=IGI Global}}</ref><ref>{{Cite web |title=Flooding in Computer Networks |url=https://byjus.com/gate/flooding-in-computer-networks-notes/ |website=Byjus's Exam Prep}}</ref>

== See also ==
* [Flooding (computer networking)](/source/Flooding_(computer_networking))
* [Water retention on mathematical surfaces](/source/Water_retention_on_mathematical_surfaces)
* [Flood fill](/source/Flood_fill)
* [Graph traversal](/source/Graph_traversal)
* [Spanning tree](/source/Spanning_tree)
* [Spanning Tree Protocol](/source/Spanning_Tree_Protocol)
* [Amnesiac Flooding](/source/Amnesiac_flooding)

== References ==
{{reflist}}

== External links ==
* [https://arxiv.org/abs/1305.5756 Flooding edge or node weighted graphs, Fernand Meyer]
* [https://web.archive.org/web/20131211173036/http://users.eastlink.ca/~sharrywhite/Download.html Water Retention Utility]

Category:Flooding algorithms

---
Adapted from the Wikipedia article [Flooding algorithm](https://en.wikipedia.org/wiki/Flooding_algorithm) by Wikipedia contributors ([contributor history](https://en.wikipedia.org/wiki/Flooding_algorithm?action=history)). Available under [Creative Commons Attribution-ShareAlike 4.0 International](https://creativecommons.org/licenses/by-sa/4.0/). Changes may have been made.
