class_docstr: Basic weighted, directed graph class
  
  Member variables:
  
  * V (int): the number of vertices
  * E (int): the number of edges
  
  Methods
  
  * vertices (list, type=int, shape=(V,)): vertices id
  * edges (list, type=int, shape=(E,2)): edges as vertices id tuples
  * weights (list, type=int, shape=(E,)): weights / lengths
    of the graph's edges
class_docstr_tok: ["Basic","weighted",",","directed","graph","class","Member","variables",":","*","V","(","int",")",":","the","number","of","vertices","*","E","(","int",")",":","the","number","of","edges","Methods","*","vertices","(","list",",","type=int",",","shape=","(","V",",",")",")",":","vertices","id","*","edges","(","list",",","type=int",",","shape=","(","E,2",")",")",":","edges","as","vertices","id","tuples","*","weights","(","list",",","type=int",",","shape=","(","E",",",")",")",":","weights","\/","lengths","of","the","graph","'s","edges"]
docstr: Constructor
  
  Parameters
  ----------
  V : int
      (int > 0) the number of vertices
  edges : (E, 2) array, type int
      edges of the graph
  weights : (E, 2) array, type=int
      weights/lengths of the edges
docstr_tok: ["Constructor","Parameters","--","--","--","--","--","V",":","int","(","int",">","0",")","the","number","of","vertices","edges",":","(","E",",","2",")","array",",","type","int","edges","of","the","graph","weights",":","(","E",",","2",")","array",",","type=int","weights\/lengths","of","the","edges"]
code: def __init__(self, V, edges=None, weights=None):
      """Constructor
  
      Parameters
      ----------
      V : int
          (int > 0) the number of vertices
      edges : (E, 2) array, type int
          edges of the graph
      weights : (E, 2) array, type=int
          weights/lengths of the edges
      """
      Graph.__init__(self, V, edges=edges)
  
      if isinstance(weights, None.__class__):
          new_weights = []
      else:
          new_weights = weights
      self.set_weights(new_weights)
  
imports: import numpy
  from scipy.sparse import coo_matrix
label_desc: Use image node_id 1 to create a new WeightedGraph object from inherited base classes: Graph with example: obj = WeightedGraph(V, edges, weights)