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: Return adjacency matrix as coo sparse
  
  Returns
  -------
  sp: scipy.sparse matrix instance
      that encodes the adjacency matrix of self
docstr_tok: ["Return","adjacency","matrix","as","coo","sparse","Returns","--","--","--","-","sp",":","scipy.sparse","matrix","instance","that","encodes","the","adjacency","matrix","of","self"]
code: def to_coo_matrix(self):
      """Return adjacency matrix as coo sparse
  
      Returns
      -------
      sp: scipy.sparse matrix instance
          that encodes the adjacency matrix of self
      """
      if self.E > 0:
          i, j = self.edges.T
          sm = coo_matrix(
              (self.weights, (i, j)), shape=(self.V, self.V)
          )
      else:
          sm = coo_matrix((self.V, self.V))
      return sm
  
imports: import numpy
  from scipy.sparse import coo_matrix
label_desc: Use image node_id 27 for calling the WeightedGraph obj's underlying member method code with example usage: obj.to_coo_matrix() and returns: sm