Using Python Networkx and time series data

Viewed 5217

I read through the networkx documentation, but am having a hard time finding information about analyzing networks of time series data.

I am creating graph representing bank accounts (nodes) and transactions between them (edges). I need to be able to find paths and traverse the graph while respecting the time series order of the transactions.

For example:

import networkx as nx

G=nx.MultiGraph()
e=[('a','b',dict(value=1000, date='2017-01-01')),
   ('b','c',dict(value=500, date='2017-01-02')),
   ('c','d',dict(value=300, date='2017-01-01')),
   ('c','d',dict(value=500, date='2017-01-03'))]
G.add_edges_from(e)

From the edges above how could I return the transactions along the path ['a', 'b', 'c', 'd']? This should give me should give me the transactions

a -> b on 'Jan 1'
b -> c on 'Jan 2' 
c -> d on 'Jan 3'

and not return c -> d on 'Jan 1'

Do I need to use a separate node to represent each account on a given date and a reference table to identify the account-date combinations?

1 Answers
Related