Graphs
Graphs
Data Structure
Introduction
• A graph data structure is a collection of nodes that have
data and are connected to other nodes.
• For example. On facebook, everything is a node. That
includes User, Photo, Album, Event, Group, Page,
Comment, Story, Video. Anything that has data is a
node.
• Every relationship is an edge from one node to another.
Whether you post a photo, join a group, like a page,
etc., a new edge is created for that relationship.
Introduction
• All of facebook is then a collection of these nodes and
edges. This is because facebook uses a graph data
structure to store its data.