# Graphs and networks

> Graphs drawn with nodes and edges: directed, weighted, bipartite, colored, and a highlighted shortest path. 7 examples with complete LaTeX source to copy.

A package in the TeXeR TikZ library: https://texer.org/library/graphs

Category: Computer Science. On CTAN: https://ctan.org/pkg/pgf

Tags: graph theory, graphs, networks, algorithms

## Examples

- [Simple graph](https://texer.org/library/graphs/simple-graph.md): Four vertices and five edges, placed by hand: the smallest useful starting point.
- [Directed graph](https://texer.org/library/graphs/directed-graph.md): Five vertices on a pentagon with directed edges, a curved pair, and a self-loop.
- [Weighted graph](https://texer.org/library/graphs/weighted-graph.md): Distances between five towns, written on the edges.
- [Shortest path](https://texer.org/library/graphs/shortest-path.md): Dijkstra's result from A to F: the path in orange and each vertex's distance beside it.
- [Bipartite graph with a matching](https://texer.org/library/graphs/bipartite-graph.md): Workers and the jobs they can do, with a perfect matching drawn in green.
- [Dependency graph](https://texer.org/library/graphs/dependency-dag.md): Course prerequisites as a directed acyclic graph, laid out in layers from left to right.
- [Graph coloring](https://texer.org/library/graphs/graph-coloring.md): The Petersen graph colored with three colors, so no edge joins two vertices of the same color.
