Edugraph? What is it good for?
Over the last thirty years, networks, alongside formal logic and classical mathematics, have come to play an increasingly important role in the scientific analysis. Coincidentally, that was also the period when the Internet became popular. But in fact, classical mathematics had already reached its limits at the start of the last century. Einstein used a four-dimensional geometry for his theory of relativity, de euclidian geometry with three dimensions did not suffice. He added the dimension of time. Time also plays a key role in the analysis of causation.
It is surprising that the logics for causation has been neglected that long, although David Hume stressed its importance his long time ago in his "Treatise of Human Nature, and An Enquiry concerning Human Understanding" (1739–1740). Why are formal logic and classical mathematics not sufficient? Essentially for two reasons. Firstly, because they are based on a binary view of reality. In formal logic, something is either true or false. The excluded middle is, of course, useful for proving things from the absurd, but formal logic and classical mathematics only work well for closed. They fall short when it comes to describing networks.
Initially, computer science, too, was limited to binary relationships. Data first had to be normalised in relational databases before it could be processed. That normalisation heterogeneous data was organised into tables showing unambiguous relationships between the data key and the other data. However, once relationships becomes complex, for example in a semantic network, this approach no longer works. The relationships within a network are ternary, not binary. In networks, triplets are used: a → b. The advantage of these triplets is that they are highly extensible and thus manage to describe a complex reality quite well without being constrained by the restructuring of the original data. It is no coincidence that XML, AI, neural networks and LLMs work with triplets. It was the only solution that produced results.
The second reason why classical mathematics falls short is that, whilst it copes well with homogeneous data, it soon runs into problems with heterogeneous data. In the field of ecology, for example, Robert E. Ulanowicz came across that problem after having spent a long time trying to analyse ecological networks using classical mathematics. It didn’t work. Too much heterogeneity. That problem also arose in biology, genetics, neurology, geography and numerous other sciences as they became more complex. More and more networks are also popping up there.
The building block of a network is a graph. And Edugraph can be used to visualise graphs. It also generates an adjacency matrix from each of these graphs. The adjacency matrix makes the bridge to classical mathematics. Internally, in computer programmes, these matrices are used for the processing.
Edugraph is intended as an introduction to network analysis for secondary education. It can help to demystify AI in this context. At an academic level, it is useful for presenting interdisciplinary research. As an example think about the language acquisition of the homo sapiens. It covers genetics, biology, neurology, phonetics, linguistics and anthropology, all of which are discussed. However, as the collection and processing of data varies from discipline to discipline, different scientific disciplines use different software programmes. In ecology, for example, Ecopath is used. In the Wikipedia you find a list of the various software applications used in different disciplines.
The three main advantages of Edugraph are that it can integrate images and HTML links into graphs. To do this, you would normally have to rely on expensive commercial software packages. Furthermore, it does not require much prior knowledge; an intuitive understanding of networks is sufficient. It is immediately accessible to students in both the humanities and the arts. It can also be used in technical and vocational education. This means that science can still be presented visually without extensive knowledge of mathematics.
How does Edugraph work?
On the website, you can see eight completed examples. On each page, you’ll see the process notation first, followed by a link to the matrix and, finally, the complete network that has been created based on the process notation. Edugraph is therefore not a drawing programme but a conversion programme that converts formally structured text into images. This formal process notation is converted into instructions for Graphiz, which then automatically generates the images.
As the Graphiz image generator requires not only a description of the processes but also a description of the individual nodes, Edugraph generates a basic description of the nodes and saves that description in a file with the .nodes extension. That file can still be updated if you want to add extra text, images and links to it. Without updating the nodes file, a basic graph is created, but then without any additional text, links or images. That is all that is needed to ultimately generate the visualisation in a .svg (scalar vector graphics).
The programme also copied all the default layout settings to a file. These can still be adjusted, not via a menu – as is usually the case with a drawing programme – but by changing the settings in the .layout file.
The graphical user interface consists solely of a menu for a text editor and the option to open the .txt file containing the process notation via a ‘file chooser’. In the menu, you do have the choice between a targeted search and a targeted weighted search. Once the file has been selected, the conversion of the process notation begins. Edugraph also creates a web page with the .html extension at the end, which displays the process notation and the SVG.
Edugraph can display both directed graphs and directed weighted graphs. The only difference is that the arc matrix is created in a different way for a directed weighted graph. In the case of a directed graph, this matrix contains only zeros and ones; in the case of a directed weighted graph, the values of the weights are represented instead of ones. You can also create an undirected graph using Edugraph. All you need to do is remove the arrowheads. This is a layout setting. Default is arrowhead="normal". When you change is to arrowhead="none", the arrowheads vannish. But to generate the adjacency matrix, you’ll still have some extra work to do. An undirected dig is symmetric. So, in the process notation, you will have to code both directions each time. Both a → b and b → a have to be defined.
Technische details
After each run, Edugraph displays a report of what it has done. If the word “ERROR” appears in that report, then something has gone wrong. It is particularly strict when it comes to process notation. Double spaces are enough to terminate processing. The programme does, however, specify exactly which line the error is on. As the basic coding of the node definitions is carried out automatically, there will be very few errors in them. HOWEVER, if, in the process notation the spelling of a term differs slightly, you end up with duplicates in the automatically generated node definitions. ALWAYS check for duplicates and correct the process notation until there are no more duplicates. You will therefore need to delete the file containing the node definitions each time before you start a new run.
Even the inclusion of ordinary short text that does not require a line break will rarely cause any problems. For long texts (more than 70 characters), images and links, special instructions must be used, and these must strictly follow the grammar rules. These are as follows:
ltext(“Here’s the long bit…”)
img(“Here is the name of the image file with the extension”)
url(“Here’s the link. You can use both absolute and relative URLs, e.g. ./text/text.html”)
The image file must be located in the folder containing the process notation for processing.
Below is a list of the layout settings that can be adjusted:
rankdir="TB"; The direction of the excavator’s movement may also be BT, LR or RL
fontname="Verdana"; Font to be used
fontsize="14"; Font size
bgcolor="#ffffff"; Kleur van het achtergrond van de graaf in hexadecimale code
stylesheet="../svg_def.css"; Link to the CSS file
--- NODES ---
fontname="Verdana", Font to be used
fontsize="14", Font size
color="#101010", Font colour in hexadecimal code
bgcolor="#ffffff" Background colour in hexadecimal code for the ‘node’ heading
border="0" For the rim around the node
cellborder="1" For the border around a cell
cellpadding="3" Internal distance within the cell
cellspacing="0" External distance between the cells
63 Specifies when a line break is required for ltext
--- EDGES ---
decorate="false", Links the text to the arrow
style="solid", Values can also be dashes and full stops
arrowhead="normal", Nstandard arrowhead; ‘none’ is not an arrowheadt
penwidth="1.0", Thickness of the arrow
fontsize="14", Text font size
fontcolor="14", Text colour for text next to the arrow next to the arrows
fontname="Verdana", Font to be used for text next to the arrows
--- OUTPUT ---
SVG I default can be changed to NOSVG
NOPNG can be changed to PNG ook een .png beeld
NOPDF can be changed to PDF
HTML can be changed to NOHTML
However, do not change the format in any way! They are almost all literal Graphiz instructions.
You can find a comprehensive list of RGB hexadecimal colour codes here.
Download and installation
The programme runs on various platforms because it was created using Java. Given that it makes use of Graphiz you’ll have to install that as well. To install Java on Microsoft Windows, you need administrator authorisation. Make sure that both Java and Graphiz are included in the system’s startup paths. In Windows, you can check this by entering the command at the prompt: path <enter>.
After PATH= should you then view lines as:
C:\Program Files\Common Files\Oracle\Java\javapath;
C:\Program Files\Java\jdk-21\bin;
C:\Program Files\Graphviz\bin;
Once the programme has been compiled, you can run it from the bin folder containing the classes using:
java EDUGRAPH
You can also put that command in a batch file with the .bat extension in the bin folder. Then you can run it without having to go to the command prompt every time.
You can compile the source code at the command prompt from within the src folder using the command:
javac *.java -d ..\bin
The zip file, which you can download below, also contains folders with examples of process notations and node definitions. You can use this to practise a bit before you start working on your own projects. The binary has been compiled for Windows 10, 64-bit, using JDK 21. You can still find the binaries in the bin folder. Those binaries will also work with the latest version of Java, JDK 27 if you’re using Windows 10, 64-bit. They will be overwritten if you recompile.
Useful tips
If you use images in the layout, ensure that they are the same width. Three factors determine the width of a node: (1) The length of a line without a hyphenation break. (2) The length of the lines after hyphenation, and (3) the width of the images.
With SVG, it doesn’t matter what type of image you use. .png, .jpg and .gif are all fine, but if you also want to convert the graphic to PNG or PDF, it’s best to use .png. GIFs become invisible after conversion.
The SVG file that is generated already contains a link to a style sheet file extension.css. In the file
where the layout is defined, you can change that link. So you can also control the formatting of the SVG there, just as you would in HTML.
There are, however, a number of special cases. To indicate that the formatting rules apply to the SVG file, that file contains the line:
@namespace svg url(http://www.w3.org/2000/svg);
The items you wish to address must be preceded by svg|
Examples:
svg|text
svg|a text
svg|polygon
svg|path
A typical feature of SVG CSS is that, for example, if you want to colour an area grey, you then use fill:#e0e0e0; instead of background-color. To make a line red, use stroke:#ff0000;.
See also the FAQ
Dowload Edugraph Beta 1.0
Download Edugraph Beta 1.0: Edugraph.zip
(creative commons CC BY-NC-ND 4.0)
The programme is open source, but that does not mean that the images created using it on this site
are not copyrighted. If they are used for educational and non-commercial purposes, they are indeed licensed under Creative Commons CC BY-NC-ND 4.0.
As the programme for the graphic conversion, Graphiz dot, is launched via the operating system, it is likely that those instructions will need to be adjusted within the programme in Linux. You will probably need to specify the absolute path to Graphiz. In Windows, this is not necessary because that path is stored in the system.
References
Alkharashi M. Comparing experiential versus conventional learning on knowledge retention for teaching surgery to medical graduates. Saudi J Ophthalmol. 2020 Dec 28;34(2):107-110. doi: 10.4103/1319-4534.305042. PMID: 33575531; PMCID: PMC7866721 <https://pmc.ncbi.nlm.nih.gov/articles/PMC7866721/>.
Belli, Stefano R., Robert D. Rogers, Jennifer Y.F. Lau, Adult and adolescent social reciprocity: Experimental data from the Trust Game, Journal of Adolescence, Volume 35, Issue 5, 2012, Pages 1341-1349, ISSN 0140-1971, https://doi.org/10.1016/j.adolescence.2012.05.004. (https://www.sciencedirect.com/science/article/pii/S0140197112000814).
Dahlström, Erik et al, (2011) Scalable Vector Graphics (SVG) 1.1 (Second Edition), W3C Recommendation 16 August 2011, <https://www.w3.org/TR/2011/REC-SVG11-20110816/>
Daigavane, Balaraman Ravindran, Gaurav Aggarwal, 2021, Understanding Convolutions on Graphs, Google Research, Published Sept. 2, 2021, DOI: 10.23915/distill.00032, <https://distill.pub/2021/understanding-gnns/>.
Jawed S, Amin HU, Malik AS, Faye I. Classification of Visual and Non-visual Learners Using Electroencephalographic Alpha and Gamma Activities. Front Behav Neurosci. 2019 May 7;13:86. doi: 10.3389/fnbeh.2019.00086. PMID: 31133829; PMCID: PMC6513874. <https://pmc.ncbi.nlm.nih.gov/articles/PMC6513874/>
Ladkin, Bernard (2018), Causal Analysis of Incidents with Why-Because Analysis using the SERAS® , Software Toolkit, CAUSALIS Ingenieurgesellschaft mbH, 2008, revised 2018-02-14, <https://rvs-bi.de/research/WBA/WBA-NewIntro20180214.pdf>
Levonian, E. Auditory and visual retention in relation to arousal. AVCR 16, 57–62 (1968). https://doi.org/10.1007/BF02768681, <https://link.springer.com/article/10.1007/BF02768681>
Lewis, David, (2004), “Causation as Influence” (expanded version), in Collins, Hall, and Paul 2004, 75–106, <https://www.andrewmbailey.com/dkl/Causation_As_Influence_long.pdf>
Menzies, Peter, (2019), Counterfactual Theories of Causation, 29 October 2019, Stanford Encyclopedia of Pholosophy, <https://plato.stanford.edu/entries/causation-counterfactual/>
Reed, Stephen K. (2012). Cognition : theories and applications. Wadsworth, Cengage Learning, 12 April 2012, ISBN 978-1-133-49228-3. OCLC 1040947645, <https://www.worldcat.org/nl/title/1040947645>
Roark CL, Lescht E, Hampton Wray A, Chandrasekaran B. Auditory and visual category learning in children and adults. Dev Psychol. 2023 May;59(5):963-975. doi: 10.1037/dev0001525. Epub 2023 Mar 2. PMID: 36862449; PMCID: PMC10164074.
Rottman BM, Hastie R. Reasoning about causal relationships: Inferences on causal networks. Psychol Bull. 2014 Jan;140(1):109-39. doi: 10.1037/a0031903. Epub 2013 Apr 1. PMID: 23544658; PMCID: PMC3988659. <https://pmc.ncbi.nlm.nih.gov/articles/PMC3988659/>.
Runge, Jakob, et al. , (2019), Detecting and quantifying causal associations in large non-linear time series datasets. Sci. Adv.5,eaau4996 (2019). DOI: <https://www.science.org/doi/10.1126/sciadv.aau4996>
Sanchez-Lengeling, Benjamin, Emily Reif, Adam Pearce, Alexander B. Wiltschko, 2021, A Gentle Introduction to Graph Neural Networks, Google Research, Published Sept. 2, 2021, DOI 10.23915/distill.00033, <https://distill.pub/2021/gnn-intro/>.
Schürmann, Tim, (WBA) 'Counterfactual Test’, Workgroup RVS, Faculty of Technology, Bielefeld University) <https://rvs-bi.de/research/WBA/IntroWBA-ENG.pdf>
Stepanov, Alexander (1985), Towards a Theory of Causal Implication, Department of Electrical Engineering and Computer Science, Polytechnic University of New York, 1985, <http://stepanovpapers.com/TOWARDS%20A%20THEORY%20OF%20CAUSAL%20IMPLICATION.pdf>
van Benthem, Johan, (IEP), Modal Logic: A Contemporary View, University of Amsterdam, Stanford University, and Tsinghua University, The Netherlands, U. S. A., and China, <https://iep.utm.edu/modal-lo/>
Wielemaker, J. (2005). An Optimised Semantic Web Query Language Implementation in Prolog. In: Gabbrielli, M., Gupta, G. (eds) Logic Programming. ICLP 2005. Lecture Notes in Computer Science, vol 3668. Springer, Berlin, Heidelberg. <https://doi.org/10.1007/11562931_12>.