Add function for reading paths between nodes