Top Qs
Timeline
Chat
Perspective
Dynamic problem (algorithms)
From Wikipedia, the free encyclopedia
Remove ads
In computer science, dynamic problems are problems stated in terms of changing input data. In its most general form, a problem in this category is usually stated as follows:
- Given a structure composed of objects, find efficient algorithms and data structures to answer certain queries about the structure, while also efficiently supporting update operations such as insertion, deletion or modification of objects in the structure.
This article relies largely or entirely on a single source. (April 2024) |
Problems in this class have the following measures of complexity:
- Space – the amount of memory space required to store the data structure;
- Initialization time – time required for the initial construction of the data structure;
- Insertion time – time required for the update of the data structure when one more input element is added;
- Deletion time – time required for the update of the data structure when an input element is deleted;
- Query time – time required to answer a query;
- Other operations specific to the problem in question
The overall set of computations for a dynamic problem is called a dynamic algorithm.
Many algorithmic problems stated in terms of fixed input data (called static problems in this context and solved by static algorithms) have meaningful dynamic versions.
Remove ads
Special cases
Incremental algorithms, or online algorithms, are algorithms in which only additions of elements are allowed, possibly starting from empty/trivial input data.
Decremental algorithms are algorithms in which only deletions of elements are allowed, starting with the initialization of a full data structure.
If both additions and deletions are allowed, the algorithm is sometimes called fully dynamic.
Remove ads
Examples
Summarize
Perspective
Maximal element
- Static problem
- For a set of N numbers find the maximal one.
The problem may be solved in O(N) time.
- Dynamic problem
- For an initial set of N numbers, dynamically maintain the maximal one when insertions and deletions are allowed.
This is just the priority queue maintenance problem allowing for insertions and deletions; it can be solved, for example, using a binary heap in time for an update and time for a query, with setup time (i.e., the initial processing of the data). Note that the value of N may change during the life of the structure.
Graphs
Given a graph, maintain its parameters, such as connectivity, maximal degree, shortest paths, etc., when insertion and deletion of its edges are allowed.[1]
Examples:
- There is an algorithm that maintains the minimum spanning forest of a weighted, undirected graph, subject to edge deletions and insertions, in time per update.[2]
- There is an algorithm that maintains the minimum spanning forest of a weighted, undirected graph, subject to edge deletions and insertions, in amortized time per update.[3]
Remove ads
See also
References
Wikiwand - on
Seamless Wikipedia browsing. On steroids.
Remove ads