def pre_align(self, t1, t2, t):
    "\n        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n        p -- [ t1 ]       p         [ t1 ]\n                            ⟍     ⟋\n                     ==>     [ t ]\n                            ⟋     ⟍\n        p' -- [ t2 ]      p'        [ t2 ]\n\n        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n        "
    t1 = T(t1)
    t2 = T(t2)
    t = T(t)
    pred1 = self.predecessors(t1)
    for p in pred1:
        for (key, data) in self[p][t1].iteritems():
            assert (not data)
    pred2 = self.predecessors(t2)
    for p in pred2:
        for (key, data) in self[p][t2].iteritems():
            assert (not data)
    for p in pred1:
        for key in list(self[p][t1]):
            self.remove_edge(p, t1, key=key)
    for p in pred2:
        for key in list(self[p][t2]):
            self.remove_edge(p, t2, key=key)
    for p in (set(pred1) | set(pred2)):
        self.add_edge(p, t)
    self.add_edge(t, t1)
    self.add_edge(t, t2)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

p -- [ t1 ]       p         [ t1 ]
                    ⟍     ⟋
             ==>     [ t ]
                    ⟋     ⟍
p' -- [ t2 ]      p'        [ t2 ]

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def pre_align(self, t1, t2, t):
    "\n        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n        p -- [ t1 ]       p         [ t1 ]\n                            ⟍     ⟋\n                     ==>     [ t ]\n                            ⟋     ⟍\n        p' -- [ t2 ]      p'        [ t2 ]\n\n        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n        "
    t1 = T(t1)
    t2 = T(t2)
    t = T(t)
    pred1 = self.predecessors(t1)
    for p in pred1:
        for (key, data) in self[p][t1].iteritems():
            assert (not data)
    pred2 = self.predecessors(t2)
    for p in pred2:
        for (key, data) in self[p][t2].iteritems():
            assert (not data)
    for p in pred1:
        for key in list(self[p][t1]):
            self.remove_edge(p, t1, key=key)
    for p in pred2:
        for key in list(self[p][t2]):
            self.remove_edge(p, t2, key=key)
    for p in (set(pred1) | set(pred2)):
        self.add_edge(p, t)
    self.add_edge(t, t1)
    self.add_edge(t, t2)