User Manual: Graphs

Updated for release version: 1.0.10-alpha

This page explains how graphs are conceived, displayed, and modified in ModelGUI.

# Introduction

Simply put, a graph is a collection of vertices (or nodes) and edges (or links) connecting these nodes. A graph is a useful representation of any physical system which can be abstracted into discrete components (of the same class) and some relationship between these components. The original (or at least the most famous) example of graph theory is the Königsberg Bridge problem, introduced by Leonhard Euler in 1736. In this model, districts of the city of Königsberg (separated by a river) were represented as vertices, and the bridges linking them were represented as edges. Euler asked whether it was possible to cross each bridge once and only once (it isn't). More recent examples of graph theoretic models include social networks (people as vertices and their acquaintances as edges), computer networks (processors as vertices and their physical links as edges), transportation systems, protein interactions, neuronal networks, and so on.

The specific pattern of connectivity for a given graph is typically referred to as its topology. Topology is a useful concept for geometric applications (e.g., deforming one surface to another which is isomorphic to it), but has also proven useful for characterizing a network-type system. Graph theory has thus been used to characterize the efficiency of information transfer within a network; for example, the "small world network" topology observed in social networks has been shown to be an optimal trade-off between local and global communication. Similar topologies have been observed in a variety of naturally occurring networks.

As mathematical objects, graphs are inherently dimensionless entities. However, graph vertices are typically assigned spatial coordinates for the purpose of visualization; these coordinates can be based upon the geometry of the system being modelled (e.g., location of people in a social network, or location of brain structures in a neuronal network), or they can be driven by some algorithm with some visualization purpose in mind (e.g., simplicity of presentation, or spatial clustering of more highly related vertices). In ModelGUI, both types of visualization are possible. A "graph" in ModelGUI refers to the dimensionless entity; i.e., simply a set of vertices and edges, with the option of associating scalar values (or weights) to both. The Graph Display window allows graphs to be visualized in 2D, using one of a variety of available layout algorithms, including the option of fixed geometric coordinates. A "Graph3D" shape, on the other hand, is an instance of InterfaceShape, which acts as a wrapper for a given graph, and assigns fixed 3D coordinates to each of its vertices. This representation allows a graph to be visualized with respect to its physical system, alongside other geometric shapes which model that system. A graph representing a brain network, for instance, can be visualized using the centroids of brain regions as its 3D coordinates; this allows the graph to be viewed alongside the geometry of the brain as represented by neuroimaging or cortical surfaces.

In what follows, we will discuss these implementations in further detail, describing how graphs are representing in ModelGUI, and how they can be manipulated, queried, and visualized within the ModelGUI environment.

# The Graph Display Window

The Graph Display window is a viewer for dimensionless graphs, based upon the Jung Java library. A particular graph is set as the window source and its visualization is determined by the window's attributes; these include:

• Layout: The algorithm which determines how the graph vertices are positioned in 2D (see below)
• Vertex and edge display: Whether they are visible, whether edges have arrows, "curviness" of edges, line colour and weight, vertex shape and fill, etc.
• Vertex and edge labels: Visibility, position, font, colour, size, etc.
• Vertex and edge weights: Can be used to scale or colour map vertices or edges
• Background colour

Like all ModelGUI windows, the current graph display can be saved as a png snapshot via the right-click (context) menu, or as an XML object via the File Panel.

# Tutorials

page revision: 13, last edited: 03 Jan 2012 16:44