python - Convert a path to nodes and edges? -
i have tsv lots of paths in :
parts of looks this:
14th_century;china;gunpowder;fire 14th_century;time;isaac_newton;light;color;rainbow 14th_century;15th_century;16th_century;pacific_ocean;atlantic_ocean;accra;africa;atlantic_slave_trade;african_slave_trade
i want run trough , somehow convert this:
graph = {'a': ['b', 'c'], 'b': ['c', 'd'], 'c': ['d'], 'd': ['c'], 'e': ['f'], 'f': ['c']}
note: 'a': edges , others os nodes in path.
at sametime want keep track of how many times each node visited?
Comments
Post a Comment