A fullerene
This code uses the following ILP (Integer Linear Program) to solve the
p-anionic Clar number of a fullerene
Let
Maximize:
Subject to:
-
$\sum_{j \in N(i)} x_{i,j} + \sum_{f \in HP(i)} y_{f} = 1$ , for each vertex$i \in V(F_n)$ , -
$\sum_{f \in P(F_n)} y_f = p$ , and -
$x_{i,j}, y_f \in {0,1}$ , for each$(i,j)\in E(F_n)$ and$f \in H(F_n)\cup P(F_n)$ .
To determine all
For instance, suppose the first time the above ILP is called,
to the above ILP, we can solve for another solution that is not equal to
To speed up the search process, after the first solution is found (suppose it
has
Note that this method will yield solutions that may be the same up to isomorphism.
-
A CPP+14 compiler.
-
This implementation requires a local copy of a Gurobi solver (https://www.gurobi.com/).
-
A file containing fullerenes and their adjacency lists in a particular format. For each isomer in the file, please use the following format such that there exists a planar embedding of the vertices where each neighbor is listed in clockwise order. See
output/030_adjfor an example for all fullerenes on 30 vertices. Seeunit_test/full/full_adjfor an example of$C_{20}$ :1 and$C_{60}$ :1812. Note that Buckygen (https://github.com/evanberkowitz/buckygen) can be used to generate fullerenes in this format. Vertices should be labelled starting at 0.
{number of vertices in graph (call it n)}
{degree of vertex 0} {neighbor 0} {neighbor 1} {neighbor 2}
{degree of vertex 1} {neighbor 0} {neighbor 1} {neighbor 2}
...
{degree of vertex n-1} {neighbor 0} {neighbor 1} {neighbor 2}
Code successfully compiles with GCC 14.2 (https://gcc.gnu.org/gcc-14/).
Update the Makefile to point to your copy of Gurobi. I included an example
that I used on my Macbook when running Gurobi 11. Please ensure
that the compiler defined in the Makefile is the same that is used
to compile Gurobi.
There are a some compiling flags you can change in include.h.
// For debugging purposes
#define DEBUG 0
#define DEBUG_DUAL 0
#define DEBUG_CLAR 0
#define DEBUG_GUROBI 0
The flags can be changed from 0 to 1 depending on what you want to debug (you should not need to).
./build/comp_all_p_anionic_clar_structs {value of p to solve for} < {file of fullerenes}
Given a file of your input fullerenes, files will be written to output/.
Each row (across all the files) corresponds with a particular fullerene
p_graph_id <- File of graph ids (starting with 1) corresponding
with the fullerenes in your input file.
p_r_pent <- File of resonant pentagons per $p$-anionic Clar structure.
Format per row: {# of res. pent} {face ids of res. pent.}
p_r_hex <- File of resonant hexagons per $p$-anionic Clar structure.
Format per row: {# of res. pent} {face ids of res. pent.}
p_match_e <- File of matching edges per $p$-anionic Clar structure. Format per
row: {2*(# of matching edges)} {endpoint 0 and endpoint 1 of each matching
edge}
- There are three fullerene isomers on 30 vertices. See
full/030_adjfor their adjacency lists. Seeexample/30/for an example output of all$2$ -anionic Clar structures on these isomers. Isomer$C_{30}$ :1,$C_{30}$ :2, and$C_{30}$ :3 have 30, 22, and 16$2$ -anionic Clar structures, respectively. See the image below for a depiction of the first 2-anionic Clar structure listed for$C_{30}$ :1 (corresponds to the first row of the files inexample/30/). Faces and vertices labelled. Matching edges are indicated in red, resonant pentagons in purple, and resonant hexagons in blue. There are two resonant pentagons: 1 and 12, one resonant hexagon: 9, and seven matching edges: (1, 9), (2, 3), (8, 19), (13, 14), (15, 24), (20, 28), and (25, 29).
- See
example/60_1812/for an example output of all$p$ -anionic Clar structures of isomer$C_{60}$ :1812 for even$0 \le p \le 12$ . Seefull/060_adjfor this isomer's adjacency list. This isomer has 5, 660, 1140, 60, 375, 30, and 1$p$ -anionic Clar structures for even$0 \le p \le 12$ , respectively.
If you use this code in your research, please cite it via:
@software{Slobodin_Recursively_solving_for_2025,
author = {Slobodin, A.},
month = Jan,
title = {{Recursively solving for all p-anionic Clar structures of fullerenes via Integer Linear Programming}},
url = {https://github.com/fastbodin/all_anionic_clar_structs_fullerene_ILP},
version = {1.0.0},
year = {2025}
}
