--- layout: default title: "Graphs" parent: Composite ancestor: Funcons-beta --- [Funcons-beta] : [Graphs.cbs] ----------------------------- ### Graphs
[
  Type   directed-graphs
  Funcon is-cyclic
  Funcon topological-sort
]
Meta-variables
  GT <: ground-values
Type
  directed-graphs(GT) ~> maps(GT, sets(GT))
directed-graphs(GT) models directed graphs with vertices of type GT, represented as maps from vertices to the set of vertices to which the vertex has an edge. E.g., the graph (1)--->(2) would be represented as { 1 |-> {2}, 2 |-> {} }
Built-in Funcon
  is-cyclic(_:directed-graphs(GT)) : =>booleans
Built-in Funcon
  topological-sort(_:directed-graphs(GT)) : =>(GT)*
topological-sort(DG) returns a topological ordering of the vertices of the graph DG, as a sequence of vertices, provided that DG is not cyclic. ____ From the [PLanCompS Project] | [CBS-beta issues...] | [Suggest an improvement...] [Graphs.cbs]: Graphs.cbs "CBS SOURCE FILE" [Funcons-beta]: /CBS-beta/docs/Funcons-beta "FUNCONS-BETA" [Unstable-Funcons-beta]: /CBS-beta/docs/Unstable-Funcons-beta "UNSTABLE-FUNCONS-BETA" [Languages-beta]: /CBS-beta/docs/Languages-beta "LANGUAGES-BETA" [Unstable-Languages-beta]: /CBS-beta/docs/Unstable-Languages-beta "UNSTABLE-LANGUAGES-BETA" [CBS-beta]: /CBS-beta "CBS-BETA" [PLanCompS Project]: https://plancomps.github.io "PROGRAMMING LANGUAGE COMPONENTS AND SPECIFICATIONS PROJECT HOME PAGE" [CBS-beta issues...]: https://github.com/plancomps/CBS-beta/issues "CBS-BETA ISSUE REPORTS ON GITHUB" [Suggest an improvement...]: mailto:plancomps@gmail.com?Subject=CBS-beta%20-%20comment&Body=Re%3A%20CBS-beta%20specification%20at%20Values/Composite/Graphs/Graphs.cbs%0A%0AComment/Query/Issue/Suggestion%3A%0A%0A%0ASignature%3A%0A "GENERATE AN EMAIL TEMPLATE"