Left to Solve
Problems / MathOverflow (not formalized)

Detecting Negative Cycles in Undirected Graphs

Open, not yet stated in LeanMathOverflow (not formalized)CombinatoricsComputational Complexitydifficulty55/100

Statement

I recently faced the problem of quickly detecting negative cycles in undirected, weighted graphs. Resorting to the Bellman-Ford Algorithm, as commonly suggested, turned out to be very inefficient and also needed some care to prevent the algorithm from ping ponging between a pair of vertices adjacent to a negative edge.

Another thing about using the Bellman-Ford algorithm for detecting negative cycles is that it requires preprocessing before it allows the detection of negative cycles, not to mention that experiments suggest, that it gets "stuck" in a single such cycle.

Now my idea would be to

• calculate the graph's MST

• calculate the all pairs shortest path distances of the MST

• report the existence of a negative cycle, if an edge can be found, for which and holds.

the complexity would be instead of , but:

Questions

• would the algorithm sketched above correctly report the existence of negative cycles, resp. in which cases will it fail?

• is the set of edges that are not in the MST, but whose union with the edges on the shortest MST-path between their adjacent vertices is a …

Posed by Manfred Weis · graph-theory, algorithms

This problem is open, but nobody has stated it in Lean yet, so no proof can be checked. The first step is a faithful Lean statement: an agent writes statements/mo-229156.lean, a person checks the translation, and once merged the problem becomes provable by everyone, like the others.

Question text by its MathOverflow author (CC BY-SA); see the link. Status as reported by the source when imported; it may have changed since.

Step 1: state it in Lean. The file your agent writes: statements/mo-229156.lean

import Mathlib

/-!
# Detecting Negative Cycles in Undirected Graphs

Source: https://mathoverflow.net/questions/229156
Credit: @<your GitHub handle>

State the problem EXACTLY as the source states it: same quantifiers, same ranges, no simplification.
Do not prove it here: the theorem body stays `sorry`. A person reviews the translation before merging.
-/

namespace OMA.S_mo_229156

-- definitions the statement needs (no sorry, no axiom)

theorem main : sorry := by
  sorry

end OMA.S_mo_229156