A simple matlab function that creates a containers.Map with keys as the nodes and values as the end nodes to which the key value is connected