def METHOD_NAME(xmodel, filename=None, directory=None, view=False, cleanup=False):
    """
    Visualize an optimized XModel instance with the Graphviz engine.
    Parameters:
        - xgraph: an XModel instance
        - filename: Filename for saving the source.
        - directory: (Sub)directory for source saving and rendering.
        - view: Open the rendered result with the default application.
        - cleanup: Delete the source file after rendering.
    """
    assert xmodel is not None
    assert len(xmodel.xnodes) > 0
    # create a DG instance with svg format
    graph = graphviz.Digraph(format="svg")
    node_dict = {}
    candidates = []
    for node in xmodel.xnodes:
        node_dict[node.op_name] = node
        if len(node.bottom) == 0:
            candidates.append(node)
    fused_node_dict = {}
    while len(candidates) > 0:
        xnode = candidates.pop(0)
        graph_node_label = xnode.op_type
        # case 1: node having in-place child node
        if (
            not xnode.is_inplace
            and len(xnode.top) > 0
            and node_dict.get(xnode.top[0]).is_inplace
        ):
            # update graph node label
            for ip_name in xnode.top:
                op_node = node_dict.get(ip_name)
                graph_node_label = graph_node_label + "_" + op_node.op_type
            # get last non-in-place node in the fusion chain
            last_ip_name = xnode.top[-1]
            last_ip_node = node_dict.get(last_ip_name)
            assert last_ip_node is not None
            # put the names of starting and ending nodes in dict
            fused_node_dict[xnode.op_name] = last_ip_node.top
            # update candidates with non-in-place nodes
            for xname in last_ip_node.top:
                nip_node = node_dict.get(xname)
                assert nip_node is not None
                candidates.append(nip_node)
        # case 2: node not having non-in-place node
        else:
            fused_node_dict[xnode.op_name] = xnode.top
            # update candidates with non-in-place nodes
            for xname in xnode.top:
                nip_node = node_dict.get(xname)
                assert nip_node is not None
                candidates.append(nip_node)
        # create graph node
        graph.node(xnode.op_name, label=graph_node_label)
    # create edges for graph
    for sname, enames in fused_node_dict.items():
        for ename in enames:
            graph.edge(sname, ename)
    # render and save the graph
    if filename is None:
        filename = xmodel.name + "_opt"
    graph.render(filename, directory, view, cleanup)