def net_to_linkdict(net):
    """
    Convert Net object from parse_net_file to dict { (from,to) : Link }
    mapping a link indexed by (from,to) tuple to Link data
    
    Parameters:
      net - Net object as returned by parse_net_file()
    
    Return value:
      dict {(from,to):Link} as described above
    """
    return dict( [ ((link.init_node, link.term_node), link )
                   for link in net.links ] )