You can use a map to represent paths.