class_docstr: !
  @brief Graph representation.
class_docstr_tok: ["!","@","brief","Graph","representation","."]
docstr: !
  @brief Constructor of graph.
  
  @param[in] data (list): Representation of graph. Considered as matrix if 'type_graph' is not specified.
  @param[in] type_graph (type_graph_descr): Type of graph representation in 'data'.
  @param[in] space_descr (list): Coordinates of each vertex that are used for graph drawing (can be omitted).
  @param[in] comments (string): Comments related to graph.
docstr_tok: ["!","@","brief","Constructor","of","graph",".","@","param","[","in","]","data","(","list",")",":","Representation","of","graph",".","Considered","as","matrix","if","'type_graph","'","is","not","specified",".","@","param","[","in","]","type_graph","(","type_graph_descr",")",":","Type","of","graph","representation","in","'data","'",".","@","param","[","in","]","space_descr","(","list",")",":","Coordinates","of","each","vertex","that","are","used","for","graph","drawing","(","can","be","omitted",")",".","@","param","[","in","]","comments","(","string",")",":","Comments","related","to","graph","."]
code: def __init__(
      self, data, type_graph=None, space_descr=None, comments=None
  ):
      """!
      @brief Constructor of graph.
  
      @param[in] data (list): Representation of graph. Considered as matrix if 'type_graph' is not specified.
      @param[in] type_graph (type_graph_descr): Type of graph representation in 'data'.
      @param[in] space_descr (list): Coordinates of each vertex that are used for graph drawing (can be omitted).
      @param[in] comments (string): Comments related to graph.
  
      """
      self.__data = data
      self.__space_descr = space_descr
      self.__comments = comments
  
      if type_graph is not None:
          self.__type_graph = type_graph
      else:
          self.__type_graph = type_graph_descr.GRAPH_MATRIX_DESCR
          for row in self.__data:
              if len(row) != len(self.__data):
                  self.__type_graph = (
                      type_graph_descr.GRAPH_VECTOR_DESCR
                  )
                  break
  
              for element in row:
                  if (element != 0) or (element != 1):
                      self.__type_graph = (
                          type_graph_descr.GRAPH_VECTOR_DESCR
                      )
  
file_path: pyclustering/pyclustering/utils/graph.py
imports: import matplotlib.pyplot
  from matplotlib import colors
  from enum import IntEnum
label_desc: Use image node_id 1 to create a new graph object  with example: obj = graph(data, type_graph, space_descr, comments)