Consider the following:
ClearAll[mol1, bondList, edgeList];
mol1 = Molecule["COc1cc(C2Oc3cc(C4Oc5cc(O)cc(O)c5C(=O)C4O)ccc3OC2CO)ccc1O"];
bondList = MoleculeValue[mol1, "BondList"];
edgeList = mol1 // (MoleculeGraph /* EdgeList);
{bondList, edgeList} // (
Transpose /*
Cases[Except[{Bond[{s_, t_}, _], UndirectedEdge[s_, t_]}]]
)
(* {} *)
This always appears to work. But is it something that is guaranteed by Mathematica? In other words, is it safe to assume this alignment of ordering in other algorithms?
MoleculeGraph
callsChemistry`Private`MoleculeGraphDump`iMoleculeGraph
which, in turn, constructs the edge list from theBondList
. So they are aligned by construction. Depending on the value of the optionMethod
we might have multi edges. If the option value isAutomatic|SimpleGraph|Simplegraph
bond type (Single, Double, Triple,Auromatic) is attached as a property to the edge, if it isMultiGraph
orMultigraph
multi edges are constructed forDouble
andTriple
and a single edge forSingle
andAuromatic
. $\endgroup$