def METHOD_NAME(network, callgraph):
    for r in network.routers:
        callgraph.add_node(
            _dot_create_router_node(r.path(), "R %d" % r.router_id)
        )
    # One link for each direction but draw one edge only
    connected = dict()
    for link in network.int_links:
        if (link.src_node.path() in connected) and (
            connected[link.src_node.path()] == link.dst_node.path()
        ):
            continue
        callgraph.add_edge(
            _dot_create_int_edge(link.src_node.path(), link.dst_node.path())
        )
        connected[link.dst_node.path()] = link.src_node.path()
    # Find common prefixes and sufixes to generate names
    paths = [link.ext_node.path() for link in network.ext_links]
    rpaths = [link.ext_node.path()[::-1] for link in network.ext_links]
    preffix = os.path.commonprefix(paths)
    suffix = os.path.commonprefix(rpaths)[::-1]
    def strip_right(text, suffix):
        if not text.endswith(suffix):
            return text
        return text[: len(text) - len(suffix)]
    def strip_left(text, prefix):
        if not text.startswith(prefix):
            return text
        return text[len(prefix) :]
    for link in network.ext_links:
        ctrl = link.ext_node
        label = strip_right(strip_left(ctrl.path(), preffix), suffix)
        if hasattr(ctrl, "_node_type"):
            label += " (" + ctrl._node_type + ")"
        callgraph.add_node(_dot_create_ctrl_node(ctrl.path(), label))
        callgraph.add_edge(
            _dot_create_ext_edge(link.ext_node.path(), link.int_node.path())
        )