Wolfram Research

Function Repository Resource:

SimpleCausalGraphCoordinates (1.0.0) current version: 3.0.0 »

Source Notebook

Generate Cartesian-like coordinates for a simple two-dimensional causal graph

Contributed by: Tom Lee, Jon Lederman

ResourceFunction["SimpleCausalGraphCoordinates"][size,type]

returns the coordinate information {point number, time, space} for the initial node size of the causal graph with a different structural type of causal graph (e.g. triangular or grid).

Details

size is the initial node number of the causal graph, and type is the causal graph type that Type 1 is for simple triangular, and Type 2 is for grid-like structure graph.

Examples

Basic Examples (2) 

Coordinates for the simple triangular (type 1) causal graph with initial node size 10:

In[1]:=
ResourceFunction["SimpleCausalGraphCoordinates"][10, 1]
Out[1]=

Coordinates for the grid-like (type 2) causal graph with initial node size 10:

In[2]:=
ResourceFunction["SimpleCausalGraphCoordinates"][10, 2]
Out[2]=

Scope (2) 

Create a triangular structured causal graph:

In[3]:=
Graph[ResourceFunction[
   "WolframModel"][{{x, y, y}, {y, z}} -> {{x, y}, {y, z, z}}, {{1, 2,
     2}, {2, 3}, {3, 4, 4}, {4, 5}, {5, 6, 6}, {6, 7}, {7, 8, 8}, {8, 9}, {9, 10, 10}, {10, 11}, {11, 12, 12}, {12, 13}, {13, 14, 14}, {14, 15}, {15, 16, 16}, {16, 17}, {17, 18, 18}, {18, 19}, {19, 20, 20}, {20, 21}, {21, 21, 1}}, Infinity, "LayeredCausalGraph"], GraphLayout -> "LayeredDigraphEmbedding", AspectRatio -> 1/2, VertexLabels -> Automatic]
Out[3]=

Calculate the coordinates for each node:

In[4]:=
ResourceFunction["SimpleCausalGraphCoordinates"][10, 1]
Out[4]=

Version History

  • 3.0.0 – 11 June 2022
  • 2.0.0 – 14 March 2022
  • 1.0.0 – 04 October 2021

Source Metadata

Related Resources

License Information