Skip to content

Commit

Permalink
Fixed a potential infinite loop during missing group generation.
Browse files Browse the repository at this point in the history
In particular, during the step where the code is searching for all child nodes that are subgraph 
isomorphic to a newly generated group, the function for isomorphic checks may misidentify two graphs as
 isomorphic even if their labeled atoms do not match. This will cause an inifinite loop where no matter 
how specific a newly generated group is, there will always be a child node that is subgraph isomorphic
 to it. This is resolved by turning the generate_initial_map option on.
  • Loading branch information
ssun30 authored and rwest committed Jul 9, 2024
1 parent 0cd19ba commit 2173017
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/fitThermoGroupsFromThermoLibrary.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@
" group = make_group(atom, n_degree_neighbor=n_degree_neighbor)\n",
" group_str = make_group_name(atom, n_degree_neighbor=n_degree_neighbor)\n",
"\n",
" while any([(group.make_sample_molecule()).is_subgraph_isomorphic(child.item) for child in node.children]):\n",
" while any([(group.make_sample_molecule()).is_subgraph_isomorphic(child.item, generate_initial_map = True) for child in node.children]):\n",
" #Child-node can't be the child of other children\n",
" #to avoid ambiguous group selection\n",
" n_degree_neighbor+=1\n",
Expand Down

0 comments on commit 2173017

Please sign in to comment.