code: def chordal_graph_treewidth(G):
      """Returns the treewidth of the chordal graph G.
  
      Parameters
      ----------
      G : graph
        A NetworkX graph
  
      Returns
      -------
      treewidth : int
          The size of the largest clique in the graph minus one.
  
      Raises
      ------
      NetworkXError
          The algorithm does not support DiGraph, MultiGraph and MultiDiGraph.
          The algorithm can only be applied to chordal graphs. If the input
          graph is found to be non-chordal, a :exc:`NetworkXError` is raised.
  
      Examples
      --------
      >>> e = [
      ...     (1, 2),
      ...     (1, 3),
      ...     (2, 3),
      ...     (2, 4),
      ...     (3, 4),
      ...     (3, 5),
      ...     (3, 6),
      ...     (4, 5),
      ...     (4, 6),
      ...     (5, 6),
      ...     (7, 8),
      ... ]
      >>> G = nx.Graph(e)
      >>> G.add_node(9)
      >>> nx.chordal_graph_treewidth(G)
      3
  
      References
      ----------
      .. [1] https://en.wikipedia.org/wiki/Tree_decomposition#Treewidth
      """
      if not is_chordal(G):
          raise nx.NetworkXError("Input graph is not chordal.")
  
      max_clique = -1
      for clique in nx.chordal_graph_cliques(G):
          max_clique = max(max_clique, len(clique))
      return max_clique - 1
  
file_path: networkx/networkx/algorithms/chordal.py
imports: import sys
  import networkx
  from networkx.algorithms.components import connected_components
  from networkx.utils import arbitrary_element, not_implemented_for
label_desc: Use image node_id 4 for calling a global function with example usage: chordal_graph_treewidth(G) and returns: unknown