Skip to Content
Mathematics in Cybersecurity
book

Mathematics in Cybersecurity

by Alfred Basta, Stephan Delong, Stavros Basta
March 2026
Intermediate
512 pages
14h 19m
English
Wiley
Content preview from Mathematics in Cybersecurity

12Graph Theory

12.1 What Is Graph Theory?

Graph theory is a branch of discrete mathematics that studies the properties and applications of graphs. A graph is a mathematical structure that consists of a set of vertices (also known as nodes) and a set of edges that connect pairs of vertices. Graph theory has numerous applications in computer science, engineering, social sciences, and other fields.

12.1.1 Definition of a Graph

A graph G is defined as an ordered pair (V, E), where:

  • V is a finite, non-empty set of vertices (or nodes).
  • E is a set of edges, where each edge is an unordered pair of vertices (u, v), with u, v ∈ V.

In other words, a graph is a collection of vertices, some (possibly all) of which are connected by edges. The vertices represent objects or entities, while the edges represent relationships or connections between those objects or entities.

Here is an example of a graph:

Network diagram with nodes A, B, C, D, and E connected by lines forming a hut-like shape.

The vertices in this graph are labeled as A through E, and the edges are represented by the line segments connecting the vertices. As an illustration of potential relationships illustrated here, suppose A = Alphonse, B = Betty, C = Cerano, D = Dao, E = Elise, and the edges represent friendship relationships. Here, you see Betty is friends with Dao, Alphonse, and Cerano, but not with Elise.

There are two main types of graphs:

  1. Undirected graphs: In an undirected graph, the edges are bidirectional, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Math for Security

Math for Security

Daniel Reilly
Quantum Computing

Quantum Computing

Andrew Glasner

Publisher Resources

ISBN: 9781394304769Purchase Link