# Graph - Data Structure (Physical Representation)

### Table of Contents

## About

A graph is represented generally in a physical data structure

## Articles Related

## Format

### Two set

The graph is composed of two set.

- a set of vertices (node)

Node |
---|

a |

b |

c |

- and set of egde represented for a :
- directed graph by a ordered pairs of vertices
- undirected graph by a set of unordered pairs of vertices

Node | adjacent to Node |
---|---|

a | b |

a | c |

b | a |

b | c |

c | a |

c | b |

### Adjacency list

The graph is composed of set.

- a set of vertices (node)

Node | |
---|---|

a | |

b | |

c |

- and a set of a set of adjacent vertices

Node | adjacent to Nodes |
---|---|

a | b,c |

b | a,c |

c | a,b |

### Adjacency matrix

Adjacency matrix is a matrix of adjacent vertices where the coordinates (x,y) may be stored in a set

a | b | c | |
---|---|---|---|

a | 0 | 1 | 1 |

b | 1 | 0 | 1 |

c | 1 | 1 | 1 |