Directed Acyclic Graph Structure Learning from Dynamic Graphs

Shaohua Fan, Shuyang Zhang, Xiao Wang, Chuan Shi

Abstract

Learning causal structures, often represented as Directed Acyclic Graphs (DAGs), is a fundamental task in data science. However, most existing methods assume data points are independent and identically distributed (IID), failing to account for the complex interactions inherent in dynamic graphs. We present GraphNOTEARS, a novel framework that transforms DAG structure learning into a continuous optimization problem tailored for dynamic graphs. By incorporating both intra-slice contemporaneous dependencies and inter-slice time-lagged neighbor influences, GraphNOTEARS accurately recovers causal relationships in networked data.

Introduction: The Challenge of Non-IID Data

Traditional DAG learning algorithms typically assume that samples are independent. In many real-world scenarios, such as social networks or urban systems, this assumption is violated. For instance, a user's behavior is often influenced by the past actions of their friends.

Conceptual illustration of feature influence in a dynamic graph where neighbors' past behaviors affect a node's current state.

As shown in Figure 1, Bob's choice of restaurant at time $t$ may be influenced by his own past preferences and the past choices of his friends Lisa and Mary (time $t-1$). Standard methods ignore these "links" between samples, leading to inaccurate causal models. The challenge is to simultaneously model contemporaneous relationships (how features affect each other at the same moment) and time-lagged interactions (how a neighbor's past behavior affects a node's current state).

Methodology: GraphNOTEARS

GraphNOTEARS builds upon the "NOTEARS" framework, treating structure learning not as a combinatorial search over all possible graphs, but as a continuous optimization problem.

Structural Vector Autoregressive (SVAR) Model

The framework utilizes an SVAR model to decompose dependencies into two primary types:

  1. Intra-slice ($W$): Represents contemporaneous dependencies between features of the same node at the same time step.
  2. Inter-slice ($P$): Represents time-lagged dependencies where a node’s current features are influenced by the past features of its neighbors, as defined by the graph adjacency matrix $A$.
The GraphNOTEARS model architecture illustrating intra-slice dependencies (W) and inter-slice dependencies (P) across time steps.

Optimization and Constraints

To ensure the learned structure is a valid DAG, the model employs a smooth, differentiable acyclicity constraint: $h(W) = \text{trace}(e^{W \circ W}) - d = 0$. The final objective function combines a least-squares loss for data fitting, $\ell_1$ regularization for sparsity, and the acyclicity constraint, solved via the Augmented Lagrangian method. This "one-step" learning approach prevents errors from compounding between temporal and contemporaneous modeling stages.

Experimental Evaluation

The authors evaluated GraphNOTEARS against several baselines, including NOTEARS+LASSO and DYNOTEARS, using both synthetic and real-world datasets.

Synthetic Benchmarks

Using random graph models (Erdős-Rényi, Barabási-Albert) and various noise distributions (Gaussian, Exponential), the researchers found that GraphNOTEARS consistently achieved near-perfect F1-scores (~1.0) for recovering intra-slice graphs. It also significantly outperformed competitors in minimizing the Structural Hamming Distance (SHD), indicating a more accurate recovery of the underlying causal structure across various sample sizes.

Real-World Application: Yelp

The model was applied to two dynamic graphs derived from Yelp data:

  • User Dynamic Graph: Nodes are users, and edges represent friendships.
  • Business Dynamic Graph: Nodes are restaurants, and edges represent geographical proximity and category similarity.

In these tests, GraphNOTEARS successfully identified logical causal chains, such as "Restaurant Category $\rightarrow$ Rating $\rightarrow$ Customer Flow," and captured homophily effects where similar nodes influence each other over time.

Conclusion and Future Directions

GraphNOTEARS provides a robust solution for causal discovery in networked, time-varying data. By treating the problem as a continuous optimization and explicitly modeling graph-based influences, it offers superior accuracy and efficiency over traditional IID-based methods. Future work includes extending the framework to handle non-linear relationships via Graph Neural Networks and adapting to non-stationary environments where causal links may evolve over time.

Summary updated

BibTeX
@inproceedings{fan2023directed,
  author = {Shaohua Fan and Shuyang Zhang and Xiao Wang and Chuan Shi},
  title = {{Directed Acyclic Graph Structure Learning from Dynamic Graphs}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2023},
  doi = {10.1609/aaai.v37i6.25913},
}
Figure