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: Compute the weights of the graph as the distances between the
  corresponding rows of X, which represents an embedding of self
  
  Parameters
  ----------
  X array of shape (self.V, edim),
    the coordinate matrix of the embedding
docstr_tok: ["Compute","the","weights","of","the","graph","as","the","distances","between","the","corresponding","rows","of","X",",","which","represents","an","embedding","of","self","Parameters","--","--","--","--","--","X","array","of","shape","(","self.V",",","edim",")",",","the","coordinate","matrix","of","the","embedding"]
code: def set_euclidian(self, X):
      """
      Compute the weights of the graph as the distances between the
      corresponding rows of X, which represents an embedding of self
  
      Parameters
      ----------
      X array of shape (self.V, edim),
        the coordinate matrix of the embedding
      """
      if np.size(X) == X.shape[0]:
          X = np.reshape(X, (np.size(X), 1))
      if X.shape[0] != self.V:
          raise ValueError("X.shape[0] != self.V")
      if self.E > 0:
          d = np.sum(
              (X[self.edges[:, 0]] - X[self.edges[:, 1]]) ** 2, 1
          )
      self.weights = np.sqrt(d)
  
imports: import numpy
  from scipy.sparse import coo_matrix
label_desc: Use image node_id 10 for calling the WeightedGraph obj's underlying member method code with example usage: obj.set_euclidian(X) without return types