# Path: sdopt/representation/dag_util.py
# def add_edge(dag, src, dest, attr_dict):
#     dag.add_edge(src, dest, attr_dict)
#     dag.node[dest].setdefault(NodeAttr.input_ord, array('l')).append(src)


from ..representation.dag_util import add_edge

def parse(problem, elems):
    l = elems[0]
    src, dest, mult = int(l[1]), int(l[0]), float(l[2])
    assert len(l) == 3, 'Elems: %s' % elems
    # Plotting requires the string keyword

# Path: sdopt/representation/dag_util.py
# def add_edge(dag, src, dest, attr_dict):
#     dag.add_edge(src, dest, attr_dict)
#     dag.node[dest].setdefault(NodeAttr.input_ord, array('l')).append(src)


# Path: sdopt/parsers/edge_line.py
from ..representation.dag_util import add_edge


def parse(problem, elems):
    l = elems[0]
    src, dest, mult = int(l[1]), int(l[0]), float(l[2])
    assert len(l) == 3, 'Elems: %s' % elems
    # Plotting requires the string keyword

    add_edge(problem.dag, src, dest, { 'weight' : mult } )