class_docstr: A class for the maximum weight clique algorithm.
  
  This class is a helper for the `max_weight_clique` function.  The class
  should not normally be used directly.
  
  Parameters
  ----------
  G : NetworkX graph
      The undirected graph for which a maximum weight clique is sought
  weight : string or None, optional (default='weight')
      The node attribute that holds the integer value used as a weight.
      If None, then each node has weight 1.
  
  Attributes
  ----------
  G : NetworkX graph
      The undirected graph for which a maximum weight clique is sought
  node_weights: dict
      The weight of each node
  incumbent_nodes : list
      The nodes of the incumbent clique (the best clique found so far)
  incumbent_weight: int
      The weight of the incumbent clique
class_docstr_tok: ["A","class","for","the","maximum","weight","clique","algorithm",".","This","class","is","a","helper","for","the","`","max_weight_clique","`","function",".","The","class","should","not","normally","be","used","directly",".","Parameters","--","--","--","--","--","G",":","NetworkX","graph","The","undirected","graph","for","which","a","maximum","weight","clique","is","sought","weight",":","string","or","None",",","optional","(","default='weight","'",")","The","node","attribute","that","holds","the","integer","value","used","as","a","weight",".","If","None",",","then","each","node","has","weight","1",".","Attributes","--","--","--","--","--","G",":","NetworkX","graph","The","undirected","graph","for","which","a","maximum","weight","clique","is","sought","node_weights",":","dict","The","weight","of","each","node","incumbent_nodes",":","list","The","nodes","of","the","incumbent","clique","(","the","best","clique","found","so","far",")","incumbent_weight",":","int","The","weight","of","the","incumbent","clique"]
code: def __init__(self, G, weight):
      self.G = G
      self.incumbent_nodes = []
      self.incumbent_weight = 0
  
      if weight is None:
          self.node_weights = {v: 1 for v in G.nodes()}
      else:
          for v in G.nodes():
              if weight not in G.nodes[v]:
                  errmsg = f"Node {v!r} does not have the requested weight field."
                  raise KeyError(errmsg)
              if not isinstance(G.nodes[v][weight], int):
                  errmsg = f"The {weight!r} field of node {v!r} is not an integer."
                  raise ValueError(errmsg)
          self.node_weights = {v: G.nodes[v][weight] for v in G.nodes()}
  
file_path: networkx/networkx/algorithms/clique.py
imports: from collections import defaultdict, deque
  from itertools import chain, combinations, islice
  import networkx
  from networkx.utils import not_implemented_for
label_desc: Use image node_id 1 to create a new MaxWeightClique object  with example: obj = MaxWeightClique(G, weight)