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)$ .
-
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
example/030_adj
for an example for all fullerenes on 30 vertices. Seeunit_test/full/full_adj
for 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_p_anionic_clar_num {value of p to solve for} < {file of fullerenes}
Given a file of your input fullerenes, files will be written to output/
.
p_anionic_clar_num <- File of solved p-anionic Clar number of input fullerenes.
Format per row: {p-anionic Clar #}.
p_r_pent <- File of resonant pentagons of input fullerenes. Format per row:
{# of res. pent} {face ids of res. pent.}
p_r_hex <- File of resonant hexagon of input fullerenes. Format per row:
{# of res. hex} {face ids of res. hex.}
p_match_e <- File of matching edges of input fullerenes. Format per row:
{2*(# of matching edges)} {endpoint 0 and endpoint 1 of each matching edge}
See example/
for an example output for the 2-anionic Clar number of all
fullerenes on 30 vertices. See unit_test/output/
for an example output of the
0-anionic Clar number of
- 2-anionic Clar structure on
$C_{30}$ :1. 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).
- A
$p$ -anionic Clar structure on$C_{60}$ :1812, for even$0 \le p \le 12$ .
The directory unit_test/
contains code to test whether your build is solving
the ILPs correctly. It contains src/
, full/
, a Makefile
, and
test_build.zsh
. The adjacency lists of isomers full/full_adj/
. Please update the Makefile
to point to your
Gurobi library (as above). When compiled and run (test_build.zsh), the
executable will test whether the ILP correctly solves the 0-anionic Clar number
of
If you use this code in your research, please cite it via:
@software{Slobodin_An_ILP_for_2024,
author = {Slobodin, A.},
month = oct,
title = {{An ILP for solving the anionic Clar number of
fullerenes}},
year = {2024},
url = {https://github.com/fastbodin/anionic_clar_fullerene_ILP},
}