pathpy / pathpyG

GPU-accelerated Next-Generation Network Analytics and Graph Learning for Time Series Data on Complex Networks.
https://www.pathpy.net
GNU Affero General Public License v3.0
33 stars 3 forks source link

Idea: Time-Resolved Line Graph Transformations #134

Closed M-Lampert closed 7 months ago

M-Lampert commented 8 months ago

Continuing on the discussion I had with @IngoScholtes today, where we were thinking about ways to speed up algorithms.temporal.temporal_graph_to_event_dag that creates a DAG from a temporal graph given a specific time window delta. Since I got this idea on the bike ride home today, I thought that I will write it down before I forget it again. We can discuss it in more detail in the upcoming sprint:

I know that we need the event DAG to construct the higher-order graphs for the temporal interactions. Do we need this anywhere else? Because if not, then I may have an idea that would skip this step and directly construct the higher-order graph from the temporal graph. The procedure would be as follows:

  1. Construct a graph where each timestamped edge corresponds to one edge in the graph where the time stamp is the edge weight. This might lead to duplicate edges but with different edge weights (time stamps).
  2. Use the indexing-based lift order function inspired by PyG's Line Graph transformation (#132). This will create a 2nd order graph with all possible walks of length 2 without respecting the time. Note that since the edges now correspond to nodes, the edge weights now correspond to node features.
  3. Subtract the node feature (edge timestamp) of the source node from the destination node in the higher-order edge index. This can be done either with message passing, but a simple diff = edge_weight[edge_index[1]] - edge_weight[edge_index[0]] should also do the trick.
  4. Create a mask that filters the higher-order edges 0 < diff < delta and filter the higher-order edge index correspondingly. (Potentially remove isolated nodes.)

Benefits:

Potential Problems: