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: Defines the graph as the Voronoi diagram (VD)
  that links the seeds.
  The VD is defined using the sample points.
  
  Parameters
  ----------
  seeds: array of shape (self.V, dim)
  samples: array of shape (nsamples, dim)
  
  Notes
  -----
  By default, the weights are a Gaussian function of the distance The
  implementation is not optimal
docstr_tok: ["Defines","the","graph","as","the","Voronoi","diagram","(","VD",")","that","links","the","seeds",".","The","VD","is","defined","using","the","sample","points",".","Parameters","--","--","--","--","--","seeds",":","array","of","shape","(","self.V",",","dim",")","samples",":","array","of","shape","(","nsamples",",","dim",")","Notes","--","--","-","By","default",",","the","weights","are","a","Gaussian","function","of","the","distance","The","implementation","is","not","optimal"]
code: def voronoi_diagram(self, seeds, samples):
      """Defines the graph as the Voronoi diagram (VD)
      that links the seeds.
      The VD is defined using the sample points.
  
      Parameters
      ----------
      seeds: array of shape (self.V, dim)
      samples: array of shape (nsamples, dim)
  
      Notes
      -----
      By default, the weights are a Gaussian function of the distance The
      implementation is not optimal
      """
      from .bipartite_graph import cross_knn
  
      # checks
      if seeds.shape[0] != self.V:
          raise ValueError("The numberof seeds is not as expected")
      if np.size(seeds) == self.V:
          seeds = np.reshape(seeds, (np.size(seeds), 1))
      if np.size(samples) == samples.shape[0]:
          samples = np.reshape(samples, (np.size(samples), 1))
      if seeds.shape[1] != samples.shape[1]:
          raise ValueError(
              "The seeds and samples do not belong \
                                    to the same space"
          )
  
      # 1. define the graph knn(samples, seeds, 2)
      j = cross_knn(samples, seeds, 2).edges[:, 1]
  
      # 2. put all the pairs i the target graph
      Ns = np.shape(samples)[0]
      self.E = Ns
      self.edges = np.array(
          [j[2 * np.arange(Ns)], j[2 * np.arange(Ns) + 1]]
      ).T
      self.weights = np.ones(self.E)
  
      # 3. eliminate the redundancies and set the weights
      self.cut_redundancies()
      self.symmeterize()
      self.set_gaussian(seeds)
  
imports: import numpy
  from scipy.sparse import coo_matrix
label_desc: Use image node_id 19 for calling the WeightedGraph obj's underlying member method code with example usage: obj.voronoi_diagram(seeds, samples) without return types