code: def min_cost(cost):
      """Find minimum cost.
  
      Keyword arguments:
      cost -- matrix containing costs
      """
      length = len(cost)
      # dist[i] stores minimum cost from 0 --> i.
      dist = [INF] * length
  
      dist[0] = 0  # cost from 0 --> 0 is zero.
  
      for i in range(length):
          for j in range(i + 1, length):
              dist[j] = min(dist[j], dist[i] + cost[i][j])
  
      return dist[length - 1]
  
label_desc: Use image node_id 1 for calling a global function with example usage: min_cost(cost) and returns: dist