Wolfram Language

Find Shortest Paths in a Molecule

We can use FindShortestPath to find the maximal shortest path between two atoms. Start with a molecule.

Now find the graph distance matrix.

Find the two atoms that correspond to the longest such distance.

FindShortestPath will return the list of atom indices.

Now use BondList to convert this to a list of bonds, and highlight the path in MoleculePlot3D.

Related Examples

de es fr ja pt-br zh