Predicting The Cop Number Using Machine Learning
Organizations: Queen’s University
Abstract
Cops and Robbers is a pursuit evasion game played on a graph, first introduced independently by Quilliot \cite{quilliot1978jeux} and Nowakowski and Winkler \cite{NOWAKOWSKI1983235} over four decades ago. A main interest in recent the literature is identifying the cop number of graph families. The cop number of a graph, , is defined as the minimum number of cops required to guarantee capture of the robber. Determining the cop number is computationally difficult and exact algorithms for this are typically restricted to small graph families. This paper investigates whether classical machine learning methods and graph neural networks can accurately predict a graph's cop number from its structural properties and identify which properties most strongly influence this prediction. Of the classical machine learning models, tree-based models achieve high accuracy in prediction despite class imbalance, whereas graph neural networks achieve comparable results without explicit feature engineering. The interpretability analysis shows that the most predictive features are related to node connectivity, clustering, clique structure, and width parameters, which aligns with known theoretical results. Our findings suggest that machine learning approaches can be used in complement with existing cop number algorithms by offering scalable approximations where computation is infeasible.
Figures & tables
| Feature Category | Computed Properties |
|---|---|
| Graph Size | Number of nodes, number of edges, density |
| Connectivity | Approximate node connectivity, all-pairs node connectivity, node cuts, contains bridge |
| Clique & Independence | Clique size, -clique communities, clique removal, chordal graph cliques, largest independent set size |
| Width Parameters | Treewidth, chordal graph treewidth |
| Clustering & Local Structure | clustering coefficient, average neighbor degree |
| Distance-Based | Diameter, radius, eccentricity, average shortest path length, Wiener index |
| Graph Size | |||
|---|---|---|---|
| 2 | 1 | 0 | 0 |
| 3 | 1 | 0 | 0 |
| 4 | 5 | 1 | 0 |
| 5 | 16 | 5 | 0 |
| 6 | 68 | 44 | 0 |
| 7 | 403 | 450 | 0 |
| Metric | Class 1 | Class 2 | Class 3 |
|---|---|---|---|
| Precision | 0.9339 | 0.9767 | 1.0000 |
| Recall | 0.9250 | 0.9797 | 0.9927 |
| F1-score | 0.9294 | 0.9782 | 0.9963 |
| Support | 13,985 | 45,035 | 273 |
| Overall Accuracy: 0.9668 | |||
| Macro-F1: 0.9680 | |||
| Metric | Class 1 | Class 2 | Class 3 |
|---|---|---|---|
| Precision | 0.9394 | 0.9882 | 1.0000 |
| Recall | 0.9625 | 0.9807 | 0.9963 |
| F1-score | 0.9508 | 0.9845 | 0.9982 |
| Support | 13,985 | 45,035 | 273 |
| Overall Accuracy: 0.9765 | |||
| Macro-F1: 0.9778 | |||
| Metric | Class 1 | Class 2 | Class 3 |
|---|---|---|---|
| Precision | 0.9396 | 0.9901 | 1.0000 |
| Recall | 0.9685 | 0.9807 | 0.9927 |
| F1-score | 0.9538 | 0.9854 | 0.9963 |
| Support | 13,985 | 45,035 | 273 |
| Overall Accuracy: 0.9779 | |||
| Macro-F1: 0.9785 | |||
| Metric | Class 1 | Class 2 | Class 3 |
|---|---|---|---|
| Precision | 0.8280 | 0.9874 | 0.9784 |
| Recall | 0.9615 | 0.9378 | 0.9963 |
| F1-score | 0.8898 | 0.9620 | 0.9873 |
| Support | 13,985 | 45,035 | 273 |
| Overall Accuracy: 0.9437 | |||
| Macro-F1: 0.9464 | |||
| Metric | Value |
|---|---|
| Accuracy | 0.9465 |
| Macro F1-score | 0.8774 |
| Macro Precision | 0.9540 |
| Macro Recall | 0.8278 |
| Model | Accuracy | Macro-F1 | F1 (Class 1) | F1 (Class 2) | F1 (Class 3) |
|---|---|---|---|---|---|
| Decision Tree | 0.9668 | 0.9680 | 0.9294 | 0.9782 | 0.9963 |
| Random Forest | 0.9765 | 0.9778 | 0.9508 | 0.9845 | 0.9982 |
| HistGB | 0.9779 | 0.9785 | 0.9538 | 0.9854 | 0.9963 |
| Logistic Regression | 0.9437 | 0.9464 | 0.8898 | 0.9620 | 0.9873 |
| GNN | 0.9465 | 0.8774 | – | – | – |
| Feature | Mean SHAP |
|---|---|
| Node connectivity | 0.0924 |
| Num of edges | 0.0631 |
| Maximal clique size | 0.0306 |
| Largest clique size | 0.0303 |
| Num of nodes | 0.0294 |
| Treewidth | 0.0226 |
| Feature | Perm. Importance |
|---|---|
| Min clustering coefficient | 0.0910 |
| Average clustering coefficient | 0.0692 |
| Spectral bipartivity | 0.0652 |
| Largest clique size | 0.0250 |
| Chordal graph | 0.0180 |
| Graph has bridges | 0.0173 |