Блог пользователя Halym2007

Автор Halym2007, история, 5 месяцев назад, По-английски

can you share your idea?

  • Проголосовать: нравится
  • -5
  • Проголосовать: не нравится

»
5 месяцев назад, # |
  Проголосовать: нравится +3 Проголосовать: не нравится

Dijkstra Algorithm for Each Vertex

Run Dijkstra from each vertex. While doing so, keep track of the shortest path to each other vertex.

When considering a new edge during the algorithm, if the edge leads to a vertex already visited, you have found a cycle. Calculate its length and compare it with the shortest cycle found so far.

»
5 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Given a positive weighted undirected graph, find the minimum weight cycle in it. The idea is to use shortest path algorithm. We one by one remove every edge from the graph, then we find the shortest path between two corner vertices of it. We add an edge back before we process the next edge.Halym2007