You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -70,22 +73,22 @@ Run [the demo](src/main/kotlin/edu/mcgill/kaliningraph/HelloKaliningraph.kt) via
70
73
To construct a graph, the [graph builder DSL](src/main/kotlin/edu/mcgill/kaliningraph/LabeledGraph.kt) provides an small alphabet:
71
74
72
75
```kotlin
73
-
val graph =Graph { a - b - c - d - e; a - c - e }
76
+
val graph =LGBuilder { a - b - c - d - e; a - c - e }
74
77
```
75
78
76
79
This is the same as:
77
80
78
81
```kotlin
79
-
val abcde =Graph { a - b - c - d - e }
80
-
val ace =Graph { a - c - e }
82
+
val abcde =LGBuilder { a - b - c - d - e }
83
+
val ace =LGBuilder { a - c - e }
81
84
val graph = abcde + ace
82
85
```
83
86
84
87
Equality is supported using the [Weisfeiler-Lehman](http://www.jmlr.org/papers/volume12/shervashidze11a/shervashidze11a.pdf#page=6) test:
85
88
86
89
```kotlin
87
-
val x =Graph { a - b - c - d - e; a - c - e }
88
-
val y =Graph { b - c - d - e - f; b - d - f }
90
+
val x =LGBuilder { a - b - c - d - e; a - c - e }
91
+
val y =LGBuilder { b - c - d - e - f; b - d - f }
89
92
assertEquals(x == y) // true
90
93
```
91
94
@@ -98,12 +101,12 @@ Kaliningraph supports a number of graph visualizations.
98
101
Graph visualization is made possible thanks to [KraphViz](https://github.com/nidi3/graphviz-java#kotlin-dsl).
99
102
100
103
```kotlin
101
-
val de =Graph { d - e }
102
-
val dacbe =Graph { d - a - c - b - e }
103
-
val dce =Graph { d - c - e }
104
+
val de =LGBuilder { d - e }
105
+
val dacbe =LGBuilder { d - a - c - b - e }
106
+
val dce =LGBuilder { d - c - e }
104
107
105
-
val abcd =Graph { a - b - c - d }
106
-
val cfde =Graph { c -"a"- f - d - e }
108
+
val abcd =LGBuilder { a - b - c - d }
109
+
val cfde =LGBuilder { c -"a"- f - d - e }
107
110
108
111
val dg =Graph(dacbe, dce, de) +Graph(abcd, cfde)
109
112
dg.show()
@@ -145,7 +148,7 @@ The above snippet should display something like the following:
145
148
Bidirectional translation to various graph formats, including [Graphviz](https://github.com/nidi3/graphviz-java), [JGraphT](https://jgrapht.org/guide/UserOverview), [Tinkerpop](https://tinkerpop.apache.org/docs/current/reference/) and [RedisGraph](https://oss.redislabs.com/redisgraph/) is supported:
0 commit comments