[Wsuug] everything's a graph

Zach Young young.zach at gmail.com
Thu Feb 4 23:28:21 EST 2010


Kelley Walker <kcwalker at inkworkswell.com> wrote:
> So, now I'm curious about how to think of everything as a graph. :)

Well first off, I guess I should define what I'm talking about. From Wikipedia:

"A "graph" in this context refers to a collection of vertices or
'nodes' and a collection of edges that connect pairs of vertices." [1]

I was working on some code to set up a graph and then I was thinking
about how pretty much everything could be represented as a graph
(individual items are nodes/vertices and the connections between them
are edges.

***Lists are just a subset of graphs (with a parent vertex capable of
having multiple children, but without the ability of a child to have
multiple parents.)***

The problem with graphs is that they can be difficult to organize in a
meaningful way, especially on a flat surface. Lists are much quicker
and easier to read.

A couple of examples of graphs (on the Internet)

1. The Internet itself (each page is a vertex and outbound and inbound
links are edges.)

2. Friends on a social networking site (A list would represent an
individuals friend, but a graph would display the interactions between
different friends.)

Anyway, I thought that was interesting. Maybe someone else will as well.

[1] http://en.wikipedia.org/wiki/Graph_theory

Zach Young | 757.462.0045 | http://zachyoung.org


More information about the Wsuug mailing list