title: Finding Negative Cycles in Graph
body: <p>I tried the following code, to find negative cycle. While running the code faced error : "NameError: name 'NetworkXUnbounded' is not defined"</p>
  
  <p>I am trying to run bellman-ford algorithm here. Algo raises an Exception of type "NetworkXUnbounded", which I tried to handle with exception handling shown below.</p>
  
  <pre class="lang-py prettyprint-override"><code>import pandas as pd 
  import networkx as nx
  import numpy as np
  df = pd.read_csv("fx_rate_3.csv") 
  G = nx.from_pandas_edgelist(df,source='A', target='B', edge_attr ['weight'], create_using=nx.DiGraph())
  
  def find_path(digraph, start):
      try:
          path = nx.bellman_ford_predecessor_and_distance(digraph, start, 'weight') 
          return path
      except NetworkXUnbounded:
          cycles = nx.simple_cycles(digraph)
          for cycle in cycles:
              print (cycle) 
  </code></pre>