def align_node_label(label: str, width=20) -> str:
    """
    Format Graphviz node labels to fit within fixed width.
    """
    words = label.split(' ')
    result = ""
    line_width = 0
    for word in words:
        if len(word) < width and line_width + len(word) > width:
            result += "\\n"
            line_width = 0
        else:
            if line_width > 0:
                result += ' '
            line_width += 1

        result += word
        line_width += len(word)

    escaped_result = result.replace('"', '\\"')

    return escaped_result