Send Close Add comments: (status displays here)
Got it!  This site "www.robinsnyder.com" uses cookies. You consent to this by clicking on "Got it!" or by continuing to use this website.  Note: This appears on each machine/browser from which this site is accessed.
GraphViz: expression trees
by RS  admin@robinsnyder.com : 1024 x 640


1. GraphViz: expression trees
GraphViz is a DSL (Domain Specific Language) for creating diagram visualizations as images, SVG (Scalable Vector Graphics), etc.

For installation information, see Graphviz: dot .

2. Graphs
Many years ago, Microsoft (in Excel, etc.) emphasized that what had often been called graphs were now charts.

A graph is a collection of nodes with connections called edges.

In math, a graph is a collection of vertices with connections called arcs.

3. Graphs and graph theory
Directed graphGraph theory is a mathematical and computer science area that has to do with the properties and algorithms for processing a graph of nodes (or vertices) and edges (or arcs) connecting those nodes (vertices).

The size and importance of nodes and edges may or may not be displayed in a diagram of the graph because nodes can be placed anywhere. It is the type of node and the relationships between nodes that is important.

Information sign More: Graphs and graph theory
A graph is a collection of nodes and edges connecting those nodes.

4. Nodes and edges
Computer trees and graphs are collections of nodes (vertices) and edges (arcs) connecting those nodes.

5. Facebook graph
The Facebook graph is a data structure of users and who they know, are friends with, etc.

A large graph is the Facebook graph, with hundreds of millions of nodes (people, groups, organizations, etc.) and billions of edges connecting those nodes.

6. Names
Mathematicians often call nodes vertices and edges arcs.

Computer scientists often like when names (as in variables) have the same number of letters. The words "node" and "edge" each have four letters. And the letter "v" is often used for "variables" so it is already taken as an abbreviation.

7. Undirected edge
Undirected edgeAn undirected edge (arc) connects two nodes (vertices) without a direction on the edge (arc).

In the Facebook graph, the "friend" relation goes both ways. Both sides need to agree or accept that relation. It is an undirected edge in the Facebook graph.

8. Directed edge
Directed edgeA directed edge (arc) connects two nodes (vertices) with a direction on the edge (arc).

In the Facebook graph, a "like" is a relation that goes one way. It is a directed edge. What is "liked" does not have to return the "like".

9. Undirected graphs
Undirected graphAn undirected graph has no direction on each edge.

10. Directed graph
Directed graphA directed graph has a direction on each edge.

A DAG (Directed Acyclic Graph) is a directed graph which has no cycles.

11. Tree structures
Tree graphA connected graph with no cycles (directed or undirected) can always be represented as a tree structure. In such cases, one node can be designated as the root node. All other nodes with only one edge connection are leaf nodes.

12. Cross edges
Note that cross-edges in what looks like a tree is what is called a DAG.

A common type of DAG structure would be your family tree. What you think of as a tree going back in time is actually a DAG since, at some point, some of your ancestors would be the same person. This may be easier to visualize from the other end where, at some point, some descendant of an earlier ancestor would marry and have children to another descendant of an earlier ancestor.

13. Hello world in GraphViz
GraphViz hello worldHere is the GraphViz diagram. Here is the code that creates the diagram.


14. Hello world in GraphViz
GraphViz hello worldHere is the GraphViz diagram. Here is the code that creates the diagram.


15. Expression node tree as graph
GraphViz expression treeHere is the GraphViz diagram.

The diagram is a digraph where the tree has interior nodes as a symbol. Here is the code that creates the diagram.


16. Expression node tree as digraph
GraphViz expression treeHere is the GraphViz diagram.

The diagram is a graph where the tree has interior nodes as a symbol. Here is the code that creates the diagram.


17. Expression variable tree as graph
GraphViz expression treeHere is the GraphViz diagram.

The diagram is a digraph where the tree has interior nodes as a variable. Here is the code that creates the diagram.


18. Expression variable tree as digraph
GraphViz expression treeHere is the GraphViz diagram.

The diagram is a graph where the tree has interior nodes as a variable. Here is the code that creates the diagram.


19. End of page

by RS  admin@robinsnyder.com : 1024 x 640