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: Removes trivial edges, i.e. edges that are (vv)-like
  self.weights and self.E are corrected accordingly
  
  Returns
  -------
  self.E (int): The number of edges
docstr_tok: ["Removes","trivial","edges",",","i.e",".","edges","that","are","(","vv",")","-like","self.weights","and","self.E","are","corrected","accordingly","Returns","--","--","--","-","self.E","(","int",")",":","The","number","of","edges"]
code: def remove_trivial_edges(self):
      """Removes trivial edges, i.e. edges that are (vv)-like
      self.weights and self.E are corrected accordingly
  
      Returns
      -------
      self.E (int): The number of edges
      """
      if self.E > 0:
          valid = self.edges[:, 0] != self.edges[:, 1]
          self.edges = self.edges[valid]
          self.weights = self.weights[valid]
          self.E = np.sum(valid)
      return self.E
  
imports: import numpy
  from scipy.sparse import coo_matrix
label_desc: Use image node_id 16 for calling the WeightedGraph obj's underlying member method code with example usage: obj.remove_trivial_edges() and returns: self