Ignore:
Timestamp:
May 7, 2008, 2:46:33 PM (17 years ago)
Author:
Frederik Heber <heber@…>
Children:
7afa7e
Parents:
d50d2a
Message:

rewritten CyclicStructureAnalysis(): uses DFS spanning tree and limited BFS from all back edges

The DFS tree is given via a StackClass and from each BackEdge a BFS is started to find the leftatom from rightatom but not by taking BackEdge itself. Hence, it finds the smallest circle and returns it.
Also, it limits itself by constantly redefining MinimumRingSize as the minimum of this and the current RingSize.
Tested to good results on buckyball. And may easily be enhanced to scanning and returning all rings (but so far we only need the minimum ring size).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • molecuilder/src/molecules.hpp

    rd50d2a ra01955  
    326326  // Graph analysis
    327327  MoleculeLeafClass * DepthFirstSearchAnalysis(ofstream *out, bool ReturnStack, int &MinimumRingSize);
    328   void CyclicStructureAnalysis(ofstream *out, int &MinimumRingSize);
     328  void CyclicStructureAnalysis(ofstream *out, class StackClass<bond *> *BackEdgeStack, int &MinimumRingSize);
    329329  bond * FindNextUnused(atom *vertex);
    330330  void SetNextComponentNumber(atom *vertex, int nr);
Note: See TracChangeset for help on using the changeset viewer.