Skip to main content

Graph

A graph is an abstract structure containing objects (typically called "nodes"), and each object can have one or many connections (typically called "edges") to other nodes.

These connections could either be one-way, or two-way.

In a graph containing at least one one-way connection, the graph is said to be a "directed graph". Where as in a graph containing nothing but two-way connections, the graph is said to be an "undirected graph".

For example, in a social network where every relationship is a "friendship", the social network forms an undirected graph. Facebook and LinkedIn (had they never implemented the concept of a "follower") are examples of social networks that form an undirected graph.

In another example, a social networks that has the concept of followers‚but not "friends"—any graph that results from this social network is not guaranteed to be an undirected graph.