#!/usr/bin/env python

from treed import TreeD
import argparse

desc = """Draw a visual representation of the branch-and-cut tree of SCIP for
    a particular instance using spatial dissimilarities of the node LP solutions.
    """

parser = argparse.ArgumentParser(description=desc)

parser.add_argument("model", type=str, help="path to model")
parser.add_argument(
    "--transformation",
    "-t",
    type=str,
    default="mds",
    help="2D transformation algorithm for node LP solutions ('mds' or 'tsne')",
)
parser.add_argument(
    "--hidecuts",
    action="store_true",
    help="hide cutting rounds and only show final node LP solutions",
)

parser.add_argument(
    "--nodelimit", type=int, default=500, help="node limit for solving the model"
)

args = parser.parse_args()

treed = TreeD(
    probpath=args.model,
    transformation=args.transformation,
    showcuts=~args.hidecuts,
    nodelimit=args.nodelimit,
)

treed.main()
treed.draw()
