ArticleslgStudy

computer science

Minimum mean weight cycle

Minimum mean weight cycle is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Minimum mean weight cycle rather than just read about it. In short: In graph theory, a minimum mean weight cycle is a cycle whose average weight (total weight divided by length) is smallest among all cycles in the graph. An analogous problem is the maximum mean weight cycle.

Key takeaways

  • Minimum mean weight cycle belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Minimum mean weight cycle to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Minimum mean weight cycle from memory before moving on to harder problems.

Reference excerpt

In graph theory, a minimum mean weight cycle is a cycle whose average weight (total weight divided by length) is smallest among all cycles in the graph. An analogous problem is the maximum mean weight cycle. These problems have applications to embedded systems and logic chip design.

Definitions Let G = (V,E) be a directed graph in which each edge has a weight (positive or negative). The weight of any path or cycle p = (e1,...,ek), is the sum of weights of the edges: w(p) = w(e1) + ... + w(ek). The mean weight of p is the weight of p divided by the number of edges in it: w(p)/len(p). The minimum cycle mean weight in G is the minimum, over all directed cycles p in G, of w(p)/len(p). A minimum mean weight cycle is any cycle with the minimum mean weight.

Algorithms Lawler presented an algorithm for computing a minimum mean weight cycle using O(log |V|) calls to an algorithm for solving the negative cycle problem. There exists such an algorithm that runs in time O(|V||E|), so the total runtime of Lawler's algorithm is O(|E||V|log |V|).

Karp's algorithm Karp presented a characterization of the minimum cycle mean weight, and presented an algorithm that runs in time O(|V||E|). An analogous algorithm can be used for finding a maximum mean weight cycle. Let G be any directed graph, and let s be a fixed vertex in G. For every nonnegative integer k and every vertex v in G, define Hk(v) as the maximum cost of a path of length k from s to v; if no such path exists, then Hk(v) = minus infinity.

The main lemma says that the maximum mean cycle weight of G equals(*) max v ∈ V min 0 ≤ k ≤ n − 1 H n ( v ) − H k ( v ) n − k {\displaystyle \max _{v\in V}\min _{0\leq k\leq n-1}{\frac {H_{n}(v)-H_{k}(v)}{n-k}}} Proof. It is sufficient to prove the lemma for the case in which the maximum mean cycle weight equals 0. This is because adding a constant weight to each edge adds the same constant both to the maximum mean cycle cost and to the expression in (*). Suppose the maximum mean cycle weight is 0. Then there is a cycle with cost exactly 0, but no cycles with a positive cost. We first prove that (*) is at most 0. As G has no positive-cost cycles, for every node v, there is a maximum-cost path of length smaller than n from s to v. Let kv be the length of this maximum-cost path. Then Hkv(v) >= Hn(v), so the expression inside the min in (*) is at most 0 when k = kv. As kv <= n-1, the minimum in (*) is at most 0. As this holds for every node v, the maximum in (*) is at most 0 too. We now prove that (*) is at least 0. G has a zero-cost cycle; let w be some node in that cycle. Let P0 be a maximum-cost path from s to w. For every t >= 1, let Pt be a concatenation of P0 with t copies of the cycle; as the cost of Pt equals the cost of P0, it is also a maximum-cost path from s to w. Every prefix of a maximum-cost path is also a maximum-cost path from s to its endpoint. When t is sufficiently large, Pt has a prefix of length n; it is a maximum-cost path from s to some node w'. Then Hn(w') >= Hk(w') for all k, so the expression inside the min in (*) is at least 0 for all k, so the minimum in (*) is at least 0. Taking v=w' in the maximum shows that the maximum in (*) is at least 0 too. Therefore, when the maximum mean cycle cost is 0, (*) equals 0, which is sufficient to complete the proof. It is possible to compute Hk using dynamic programming in time O(|E||V|); then it is possible to find the maximum mean cycle weight using (*). The cycle itself can be found as follows:

Find the maximizing v and the minimizing k in (*). As the outcome for this v and this k is finite, both Hn(v) and Hk(v) are finite. This means that there exists a maximum-weight path of length n from s to v, and a maximum-weight path of length k from s to v. Therefore, the path of length n contains a cycle of length n-k; this is the maximum mean weight cycle. Chaturvedi and McConnell identified an error in Karp's algorithm for constructing a cycle attaining the minimum mean weight. They presented a corrected algorithm.

Newer algorithms Dasdan and Gupta study maximum mean weight cycle, and present an algorithm that is provably always faster than Karp's algorithm. Albrecht, Korte, Schietke and Vygen relate the problem of maximum mean weight cycle to the minimum balance problem: find a potential function such that the "slacks" of all edges are optimally balanced. Both problems can be solved by a parametric shortest path algorithm. They show that parametric shortest path can be used for solving more general variants of these problems, with constraints that are relevant to optimizing the clock schedule of a logic chip.

See also Negative cycle

References

Worked examples

Example 1 — a first encounter with Minimum mean weight cycle

Start with the simplest possible case. Write down what Minimum mean weight cycle claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Minimum mean weight cycle before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Minimum mean weight cycle ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Minimum mean weight cycle

In research
Minimum mean weight cycle appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Minimum mean weight cycle in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Minimum mean weight cycle is common in secondary-school and first-year university syllabi. It links to neighbouring topics Combinatorial optimization, Computational problems in graph theory, Graph theory objects, so understanding it makes those chapters shorter.
In everyday life
Look for Minimum mean weight cycle outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study Minimum mean weight cycle in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Minimum mean weight cycle means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Minimum mean weight cycle out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Minimum mean weight cycle in simple terms?

In graph theory, a minimum mean weight cycle is a cycle whose average weight (total weight divided by length) is smallest among all cycles in the graph. An analogous problem is the maximum mean weight cycle.

Why does Minimum mean weight cycle matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Minimum mean weight cycle?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Minimum mean weight cycle.

Tags

  • Combinatorial optimization
  • Computational problems in graph theory
  • Graph theory objects

Keep exploring