class_docstr: !
  @brief Class represents graph coloring algorithm based on hysteresis oscillatory network. 
         This is bio-inspired algorithm where the network uses relaxation oscillators that is
         regarded as a multi-vibrator. Each ensemble of synchronous oscillators corresponds to
         only one color.
  
  Example
  @code
      # import required modules
      from pyclustering.nnet.hysteresis import hysteresis_visualizer;
      
      from pyclustering.gcolor.hysteresis import hysteresisgcolor;
      
      from pyclustering.utils.graph import read_graph, draw_graph;
      
      # load graph from a file
      graph = read_graph(filename);
      
      # create oscillatory network for solving graph coloring problem
      network = hysteresisgcolor(graph.data, alpha, eps);
      
      # perform simulation of the network
      output_dynamic = network.simulate(2000, 20);
      
      # show dynamic of the network
      hysteresis_visualizer.show_output_dynamic(output_dynamic);
      
      # obtain results of graph coloring and display results
      coloring_map = hysteresis_visualizer.allocate_map_coloring();
      draw_graph(graph, coloring_map);
  @endcode
docstr: !
  @brief Constructor of hysteresis oscillatory network for graph coloring.
  
  @param[in] graph_matrix (list): Matrix representation of a graph.
  @param[in] alpha (double): Positive constant (affect weight between two oscillators w[i][j]).
  @param[in] eps (double): Positive constant (affect feedback to itself (i = j) of each oscillator w[i][j] = -alpha - eps).
          
docstr_tok: ["!","@","brief","Constructor","of","hysteresis","oscillatory","network","for","graph","coloring",".","@","param","[","in","]","graph_matrix","(","list",")",":","Matrix","representation","of","a","graph",".","@","param","[","in","]","alpha","(","double",")",":","Positive","constant","(","affect","weight","between","two","oscillators","w","[","i","]","[","j","]",")",".","@","param","[","in","]","eps","(","double",")",":","Positive","constant","(","affect","feedback","to","itself","(","i","=","j",")","of","each","oscillator","w","[","i","]","[","j","]","=","-alpha","-","eps",")","."]
code: def __init__(self, graph_matrix, alpha, eps):
      """!
      @brief Constructor of hysteresis oscillatory network for graph coloring.
  
      @param[in] graph_matrix (list): Matrix representation of a graph.
      @param[in] alpha (double): Positive constant (affect weight between two oscillators w[i][j]).
      @param[in] eps (double): Positive constant (affect feedback to itself (i = j) of each oscillator w[i][j] = -alpha - eps).
  
      """
      number_oscillators = len(graph_matrix)
  
      super().__init__(number_oscillators)
  
      self._states = [0] * self._num_osc
      for i in range(0, self._num_osc):
          self._states[i] = 1 - (2 / self._num_osc) * i
  
      self._outputs = [-1] * self._num_osc
      self._outputs_buffer = [-1] * self._num_osc
      self._time_contant = 1
  
      # Create connections
      self._weight = []
      for row in range(0, self._num_osc):
          self._weight.append([0] * self._num_osc)
          for col in range(0, self._num_osc):
              if row != col:
                  self._weight[row][col] = (
                      -alpha
                      * (graph_matrix[row][col])
                      / sum(graph_matrix[row])
                  )
              else:
                  self._weight[row][col] = -alpha - eps
  
file_path: pyclustering/pyclustering/gcolor/hysteresis.py
imports: from pyclustering.nnet.hysteresis import hysteresis_network, hysteresis_dynamic
label_desc: Use image node_id 1 to create a new hysteresisgcolor object from inherited base classes: hysteresis_network with example: obj = hysteresisgcolor(graph_matrix, alpha, eps)