The aldehyde moiety consisting of atoms 1, 10, and 18 should be its own group;
The benzene ring should be another group consisting of atoms 2, 3, 4, 5, 6, 8, 11, 12, 14, 15, 16;
The unsaturated chain consisting of atoms 7, 9, 13, 17, should be in a group of its own;
The fact that all of the heavy atoms are conjugated together should not prevent correct grouping or blur the lines between groups;
As cinnamaldehyde has no ring member pnictogens or chalcogens, the rules that isolate h-bond atoms of e.g. pyrazines, indoles, and furans would not apply.
A good way to ensure item 4 would be to define a set of standard functional groups and apply pattern matching before the grouping algorithm executes. In this case the pattern matcher could identify the benzene ring and the aldehyde group, isolate those features into their own groups first, then apply the algorithm to the remaining atoms.
The above command produces the following output:
Shown here are the atoms contained in each group:
Expected behavior:
A good way to ensure item 4 would be to define a set of standard functional groups and apply pattern matching before the grouping algorithm executes. In this case the pattern matcher could identify the benzene ring and the aldehyde group, isolate those features into their own groups first, then apply the algorithm to the remaining atoms.