✅ Перевірена відповідь на це питання доступна нижче. Наші рішення, перевірені спільнотою, допомагають краще зрозуміти матеріал.
Shortest paths with negative weights
Assume a graph where no negative cycle is reachable from the source. Bellman-Ford repeats its pass over all the edges |V| − 1 times. Why are that many passes sufficient?