title: Find the lowest-weight cycle in a weighted, directed graph using Dijkstra's
body: <p>Hi I am struggling with this question. It is the following:</p>
  
  <blockquote>
    <p>Devise an algorithm to find the lowest-weight cycle(i.e. of all cycles in the graph, the one with the smallest sum of edge weights), in a weighted, directed graph G = (V,E). Briefly justify the runtime and space complexity. Assume all edges are non-negative. It should run in O(|V||E|log|V|) time. 
    Hint: Use multiple calls to Dijkstra's algorithm.</p>
  </blockquote>
  
  <p>I have seen solutions that use Floyd-Warshall but I was wondering how we would do this using Dijkstra's and how to do it within the time constraint given. </p>
  
  <p>I have a few points of confusion:</p>
  
  <ul>
  <li>Firstly, how do we even know how many cycles are in the graph and how
  to check those?</li>
  <li>Also, why is it |E||V|log|V|? By my understanding you should traverse
  through all the vertices therefore making it |V|log|V|.</li>
  </ul>
  
  <p>This is for my personal learning so if anyone has an example they could use, it would greatly help me! I am not really looking for pseudo-code - just a general algorithm to understand how using the shortest path from one node to all nodes is going to help us solve this problem.
  Thank you!</p>