Index: src/Actions/MoleculeAction/StretchBondAction.cpp
===================================================================
--- src/Actions/MoleculeAction/StretchBondAction.cpp	(revision d24ef58f28627a24574b012f8f2b174072c4da20)
+++ src/Actions/MoleculeAction/StretchBondAction.cpp	(revision bccbe9039159cc1a3d427c8fb04c85ef2db4e781)
@@ -33,7 +33,4 @@
 #endif
 
-#include <boost/graph/adjacency_list.hpp>
-#include <boost/graph/breadth_first_search.hpp>
-
 //#include "CodePatterns/MemDebug.hpp"
 
@@ -52,4 +49,6 @@
 #include "Descriptors/AtomIdDescriptor.hpp"
 #include "Graph/BoostGraphCreator.hpp"
+#include "Graph/BoostGraphHelpers.hpp"
+#include "Graph/BreadthFirstSearchGatherer.hpp"
 #include "molecule.hpp"
 #include "World.hpp"
@@ -61,32 +60,4 @@
 #include "Action_impl_pre.hpp"
 
-
-/**
- * I have no idea why this is so complicated with BGL ...
- *
- * This is taken from the book "The Boost Graph Library: User Guide and Reference Manual, Portable Documents",
- * chapter "Basic Graph Algorithms", example on calculating the bacon number.
- */
-template <typename DistanceMap>
-class distance_recorder : public boost::default_bfs_visitor
-{
-public:
-  distance_recorder(DistanceMap dist) : d(dist) {}
-
-  template <typename Edge, typename Graph>
-  void tree_edge(Edge e, const Graph &g) const {
-    typename boost::graph_traits<Graph>::vertex_descriptor u = source(e,g), v = target(e,g);
-    d[v] = d[u] + 1;
-  }
-
-private:
-  DistanceMap d;
-};
-
-template <typename DistanceMap>
-distance_recorder<DistanceMap> record_distance(DistanceMap d)
-{
-  return distance_recorder<DistanceMap>(d);
-}
 
 static bool addEdgePredicate(
@@ -110,4 +81,17 @@
     return Action::failure;
   }
+  molecule *mol = World::getInstance().
+      getMolecule(MoleculeById(atoms[0]->getMolecule()->getId()));
+  if (mol != atoms[1]->getMolecule()) {
+    STATUS("The two selected atoms must belong to the same molecule.");
+    return Action::failure;
+  }
+
+  // gather undo information
+  const double olddistance = atoms[0]->getPosition().distance(atoms[1]->getPosition());
+  const double newdistance = params.bonddistance.get();
+  LOG(1, "INFO: Old bond distance is " << olddistance << ", stretching to " << newdistance << ".");
+
+  // gather sorted ids
   std::vector<atomId_t> atomids(2);
   atomids[0] = atoms[0]->getId();
@@ -115,14 +99,11 @@
   std::sort(atomids.begin(), atomids.end());
   LOG(1, "DEBUG: Selected nodes are " << atomids);
-  molecule *mol = World::getInstance().
-      getMolecule(MoleculeById(atoms[0]->getMolecule()->getId()));
-  if (mol != atoms[1]->getMolecule()) {
-    STATUS("The two selected atoms must belong to the same molecule.");
-    return Action::failure;
-  }
-  // gather undo information
-  const double olddistance = atoms[0]->getPosition().distance(atoms[1]->getPosition());
-  const double newdistance = params.bonddistance.get();
-  LOG(1, "INFO: Old bond distance is " << olddistance << ", stretching to " << newdistance << ".");
+
+  const Vector NormalVector = (atoms[0]->getPosition() - atoms[1]->getPosition())* (1./olddistance);
+  const double shift = 0.5*(newdistance - olddistance);
+  std::vector<Vector> Shift(2);
+  Shift[0] = shift * NormalVector;
+  Shift[1] = -shift * NormalVector;
+  Box &domain = World::getInstance().getDomain();
 
   // Assume the selected bond splits the molecule into two parts, each one on
@@ -133,64 +114,47 @@
   // leaving the other positions untouched.
 
-  // convert BondGraph into boost::graph
+  // get nodes on either side of selected bond via BFS discovery
   BoostGraphCreator BGcreator;
   BGcreator.createFromMolecule(*mol,
       boost::bind(addEdgePredicate, _1, boost::ref(atomids)));
-  const BoostGraphCreator::UndirectedGraph &molgraph = BGcreator.get();
-
-  const size_t num_vertices = BGcreator.getNumVertices();
-  std::vector< std::vector<size_t> > distances;
-  for (size_t i=0;i<2;++i) {
-    distances.push_back(std::vector<size_t>(num_vertices, num_vertices+1)); // set distance to num+1
-    distances[i][atomids[i]] = 0;
-    boost::breadth_first_search(
-        molgraph,
-        boost::vertex(atomids[i], molgraph),
-        boost::visitor(record_distance(&(distances[i][0]))));
-    LOG(3, "DEBUG: From atom #" << atomids[i]
-        << " BFS discovered the following distances " << distances[i]);
-  }
-
-  const Vector NormalVector = (atoms[0]->getPosition() - atoms[1]->getPosition())* (1./olddistance);
-  const double shift = 0.5*(newdistance - olddistance);
-  std::vector<Vector> Shift(2);
-  Shift[0] = shift * NormalVector;
-  Shift[1] = -shift * NormalVector;
-  Box &domain = World::getInstance().getDomain();
-  std::vector< std::vector<size_t> > bondside_sets(2);
-
-  // Check whether there are common nodes in each set of distances
-  for (size_t i=0;i<num_vertices;++i)
-    if ((distances[0][i] != (num_vertices+1)) && (distances[1][i] != (num_vertices+1))) {
-      ELOG(2, "Node #" << i << " is reachable from either side of bond, hence must by cyclic."
+  BreadthFirstSearchGatherer NodeGatherer(BGcreator);
+  std::vector< BoostGraphHelpers::Nodeset_t > bondside_sets(2);
+  for(size_t j=0;j<2;++j) {
+    bondside_sets[j] = NodeGatherer(atoms[j]->getId());
+    std::sort(bondside_sets[j].begin(), bondside_sets[j].end());
+  }
+
+  // simple test whether bond has split the system in two disjoint sets or not
+  bool isCyclic = false;
+  if ((bondside_sets[0].size() + bondside_sets[1].size()) > BGcreator.getNumVertices()) {
+      // Check whether there are common nodes in each set of distances
+    if (BoostGraphHelpers::isCommonNodeInVector(bondside_sets[0], bondside_sets[1])) {
+      ELOG(2, "Sets contain common node, hence bond must have been by cyclic."
           << " Shifting only bond partners.");
       for(size_t j=0;j<2;++j) {
-        bondside_sets[j].push_back(atoms[j]->getId());
+        bondside_sets[j].clear();
+        bondside_sets[j].push_back( atomids[j] );
         const Vector &position = atoms[j]->getPosition();
         atoms[j]->setPosition( domain.enforceBoundaryConditions(position+Shift[j]) );
       }
-      break;
-    }
+      isCyclic = true;
+    }
+  }
 
   // go through the molecule and stretch each atom in either set of nodes
-  if (bondside_sets[0].empty()) {
-    const BoostGraphCreator::index_map_t index_map = BGcreator.getIndexMap();
+  if (!isCyclic) {
     for (molecule::iterator iter = mol->begin(); iter != mol->end(); ++iter) {
       const Vector &position = (*iter)->getPosition();
       // for each atom determine in which set of nodes it is and shift accordingly
-      size_t i=0;
-      const size_t nodeindex = boost::get(index_map, boost::vertex((*iter)->getId(), molgraph));
-      for (;i<2;++i) {
-        if (distances[i][nodeindex] != (num_vertices+1)) {
-          (*iter)->setPosition( domain.enforceBoundaryConditions(position+Shift[i]) );
-          bondside_sets[i].push_back((*iter)->getId());
-          break;
-        }
-      }
-      if (i==2) {
+      const atomId_t &atomid = (*iter)->getId();
+      if (std::binary_search(bondside_sets[0].begin(), bondside_sets[0].end(), atomid)) {
+        (*iter)->setPosition( domain.enforceBoundaryConditions(position+Shift[0]) );
+      } else if (std::binary_search(bondside_sets[1].begin(), bondside_sets[1].end(), atomid)) {
+        (*iter)->setPosition( domain.enforceBoundaryConditions(position+Shift[1]) );
+      } else {
         ELOG(1, "Atom " << *iter << " is not contained on either side of bond? Undoing done shifts");
         // Have to undo shifts
-        for (i=0;i<2;++i) {
-          for (std::vector<size_t>::const_iterator iter = bondside_sets[i].begin();
+        for (size_t i=0;i<2;++i) {
+          for (BoostGraphHelpers::Nodeset_t::const_iterator iter = bondside_sets[i].begin();
               iter != bondside_sets[i].end(); ++iter) {
             atom &walker = *World::getInstance().getAtom(AtomById(*iter));
@@ -214,5 +178,5 @@
   Box &domain = World::getInstance().getDomain();
   for (size_t i=0;i<2;++i) {
-    for (std::vector<size_t>::const_iterator iter = state->bondside_sets[i].begin();
+    for (BoostGraphHelpers::Nodeset_t::const_iterator iter = state->bondside_sets[i].begin();
         iter != state->bondside_sets[i].end(); ++iter) {
       atom &walker = *World::getInstance().getAtom(AtomById(*iter));
@@ -230,5 +194,5 @@
   Box &domain = World::getInstance().getDomain();
   for (size_t i=0;i<2;++i) {
-    for (std::vector<size_t>::const_iterator iter = state->bondside_sets[i].begin();
+    for (BoostGraphHelpers::Nodeset_t::const_iterator iter = state->bondside_sets[i].begin();
         iter != state->bondside_sets[i].end(); ++iter) {
       atom &walker = *World::getInstance().getAtom(AtomById(*iter));
Index: src/Actions/MoleculeAction/StretchBondAction.def
===================================================================
--- src/Actions/MoleculeAction/StretchBondAction.def	(revision d24ef58f28627a24574b012f8f2b174072c4da20)
+++ src/Actions/MoleculeAction/StretchBondAction.def	(revision bccbe9039159cc1a3d427c8fb04c85ef2db4e781)
@@ -21,5 +21,5 @@
 (RangeValidator< double >(0., 10.))
 
-#define statetypes (std::vector<Vector>)(std::vector< std::vector<size_t> >)(const molecule *)
+#define statetypes (std::vector<Vector>)(std::vector< BoostGraphHelpers::Nodeset_t >)(const molecule *)
 #define statereferences (Shift)(bondside_sets)(mol)
 
Index: src/Graph/BoostGraphCreator.cpp
===================================================================
--- src/Graph/BoostGraphCreator.cpp	(revision d24ef58f28627a24574b012f8f2b174072c4da20)
+++ src/Graph/BoostGraphCreator.cpp	(revision bccbe9039159cc1a3d427c8fb04c85ef2db4e781)
@@ -85,5 +85,7 @@
       std::back_inserter(atomids), getAtomId);
   ASSERT( _atoms.size() == atomids.size(),
-      "BoostGraphCreator::createFromAtom() - atomids and atoms differ in size?");
+      "BoostGraphCreator::createFromAtom() - atomids "
+      +toString(atomids.size())+" and atoms "+toString(_atoms.size())
+      +" differ in size?");
   std::sort(atomids.begin(), atomids.end());
   const predicate_t predicate = boost::bind(inSetPredicate, boost::ref(atomids), _1);
@@ -95,4 +97,12 @@
 }
 
+BoostGraphCreator::nodeId_t BoostGraphCreator::getNodeId(
+    const atomId_t &_atomid) const
+{
+  atomids_nodeids_t::const_iterator iter =
+      atomids_nodeids.find(_atomid);
+  return (iter == atomids_nodeids.end()) ? (nodeId_t)-1 : iter->second;
+}
+
 template <typename iterator>
 void BoostGraphCreator::createFromRange(
@@ -101,21 +111,39 @@
     const size_t &_no_nodes,
     const predicate_t &_pred
-    ) {
-  // convert BondGraph into boost::graph
-  UndirectedGraph molgraph(_no_nodes);
+    )
+{
+  graph = UndirectedGraph();
+
+  // add vertices
   for(iterator iter = _begin; iter != _end; ++iter) {
-    LOG(2, "DEBUG: Looking at node " << (*iter)->getId());
+    const atomId_t atomid = (*iter)->getId();
+    Vertex v = boost::add_vertex(atomid, graph);
+    const atomId_t vertexname = boost::get(boost::get(boost::vertex_name, graph), v);
+    const nodeId_t vertexindex = boost::get(boost::get(boost::vertex_index, graph), v);
+    LOG(2, "DEBUG: Adding node " << vertexindex << " associated to atom #" << vertexname);
+    ASSERT( vertexname == atomid,
+        "BoostGraphCreator::createFromRange() - atomid "+toString(atomid)
+        +" is not name of vertex "+toString(vertexname)+".");
+    atomids_nodeids.insert( std::make_pair(vertexname, vertexindex) );
+  }
+
+  // add edges
+  for(iterator iter = _begin; iter != _end; ++iter) {
+    LOG(2, "DEBUG: Looking at atom " << (*iter)->getId());
     const BondList& ListOfBonds = (*iter)->getListOfBonds();
     for(BondList::const_iterator bonditer = ListOfBonds.begin();
         bonditer != ListOfBonds.end(); ++bonditer) {
+      LOG(2, "DEBUG: Looking at bond " << *(*bonditer));
       const atomId_t leftid = (*bonditer)->leftatom->getId();
+      const nodeId_t leftnodeid = getNodeId(leftid);
       const atomId_t rightid = (*bonditer)->rightatom->getId();
+      const nodeId_t rightnodeid = getNodeId(rightid);
       // only pick each bond once and evaluate predicate
       if ((leftid == (*iter)->getId())
           && (_pred(**bonditer))) {
-        LOG(3, "DEBUG: ADDING edge " << leftid << " <-> " << rightid);
-        boost::add_edge(leftid, rightid, graph);
+        LOG(3, "DEBUG: ADDING edge " << leftnodeid << " <-> " << rightnodeid);
+        boost::add_edge(leftnodeid, rightnodeid, graph);
       } else {
-        LOG(3, "DEBUG: Discarding edge " << leftid << " <-> " << rightid);
+        LOG(3, "DEBUG: Discarding edge " << leftnodeid << " <-> " << rightnodeid);
       }
     }
Index: src/Graph/BoostGraphCreator.hpp
===================================================================
--- src/Graph/BoostGraphCreator.hpp	(revision d24ef58f28627a24574b012f8f2b174072c4da20)
+++ src/Graph/BoostGraphCreator.hpp	(revision bccbe9039159cc1a3d427c8fb04c85ef2db4e781)
@@ -15,8 +15,11 @@
 #endif
 
+#include <map>
 #include <vector>
 
 #include <boost/function.hpp>
 #include <boost/graph/adjacency_list.hpp>
+
+#include "types.hpp"
 
 class atom;
@@ -32,10 +35,22 @@
   //!> typedef for an undirected graph using boost::graph
   typedef boost::adjacency_list < boost::vecS, boost::vecS, boost::undirectedS,
-      boost::no_property, boost::no_property > UndirectedGraph;
+      boost::property<boost::vertex_name_t, atomId_t>, boost::no_property > UndirectedGraph;
   //!> typedef for a map of graph node indices
-  typedef boost::property_map < boost::adjacency_list <>, boost::vertex_index_t >::type index_map_t;
+  typedef boost::property_map < UndirectedGraph, boost::vertex_index_t >::type index_map_t;
+  typedef boost::property_map < UndirectedGraph, boost::vertex_index_t >::const_type const_index_map_t;
+  //!> typedef for a map of graph node indices
+  typedef boost::property_map < UndirectedGraph, boost::vertex_name_t >::type name_map_t;
+  typedef boost::property_map < UndirectedGraph, boost::vertex_name_t >::const_type const_name_map_t;
   //!> typedef for the  predicate to evaluate for adding the current edge or not
   typedef boost::function<bool (const bond &)> predicate_t;
+  //!> typedef for a Vertex
+  typedef boost::graph_traits<UndirectedGraph>::vertex_descriptor Vertex;
+  //!> typedef for vertex iterator
+  typedef boost::graph_traits<UndirectedGraph>::vertex_iterator vertex_iter;
 
+  //!> typedef for a node id
+  typedef size_t nodeId_t;
+  //!> typedef for map converting between node id in graph and the associated atomic id
+  typedef std::map<atomId_t, nodeId_t> atomids_nodeids_t;
 
   /** Creates the boost::graph using all atoms and bonds in the given \a _mol.
@@ -89,4 +104,11 @@
   }
 
+  /** Returns the node id to a given atom id \a _atomid.
+   *
+   * \param _atomid atom id
+   * \return node id
+   */
+  nodeId_t getNodeId(const atomId_t &_atomid) const;
+
 private:
   /** General purpose function that contains the internal logic of walking the
@@ -114,4 +136,6 @@
   //!> internal graph that is created by creator functions
   UndirectedGraph graph;
+  //!> external property map for all the atomic ids of each graph node
+  atomids_nodeids_t atomids_nodeids;
 };
 
Index: src/Graph/BoostGraphHelpers.hpp
===================================================================
--- src/Graph/BoostGraphHelpers.hpp	(revision bccbe9039159cc1a3d427c8fb04c85ef2db4e781)
+++ src/Graph/BoostGraphHelpers.hpp	(revision bccbe9039159cc1a3d427c8fb04c85ef2db4e781)
@@ -0,0 +1,50 @@
+/*
+ * BoostGraphHelpers.hpp
+ *
+ *  Created on: May 18, 2017
+ *      Author: heber
+ */
+
+
+#ifndef GRAPH_BOOSTGRAPHHELPERS_HPP_
+#define GRAPH_BOOSTGRAPHHELPERS_HPP_
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <vector>
+
+namespace BoostGraphHelpers {
+
+  typedef std::vector<atomId_t> Nodeset_t;
+
+#ifdef HAVE_INLINE
+inline
+#else
+static
+#endif
+  bool isCommonNodeInVector(
+      const Nodeset_t &_firstnodes,
+      const Nodeset_t &_secondnodes) {
+    // std::set_intersection builds full set in bad case: too much work, just
+    // seek single element contained in either set
+    Nodeset_t::const_iterator firstiter = _firstnodes.begin();
+    Nodeset_t::const_iterator seconditer = _secondnodes.begin();
+    while ((firstiter != _firstnodes.end()) && (seconditer != _secondnodes.end())) {
+      if (*firstiter == *seconditer) {
+        break;
+      } else if (*firstiter > *seconditer) {
+        ++seconditer;
+      } else {
+        ++firstiter;
+      }
+    }
+    return ((firstiter != _firstnodes.end())
+        && (seconditer != _secondnodes.end()));
+  }
+} /* namespace BoostGraphHelpers */
+
+
+#endif /* GRAPH_BOOSTGRAPHHELPERS_HPP_ */
Index: src/Graph/BreadthFirstSearchGatherer.cpp
===================================================================
--- src/Graph/BreadthFirstSearchGatherer.cpp	(revision bccbe9039159cc1a3d427c8fb04c85ef2db4e781)
+++ src/Graph/BreadthFirstSearchGatherer.cpp	(revision bccbe9039159cc1a3d427c8fb04c85ef2db4e781)
@@ -0,0 +1,106 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2017 Frederik Heber. All rights reserved.
+ *
+ *
+ *   This file is part of MoleCuilder.
+ *
+ *    MoleCuilder is free software: you can redistribute it and/or modify
+ *    it under the terms of the GNU General Public License as published by
+ *    the Free Software Foundation, either version 2 of the License, or
+ *    (at your option) any later version.
+ *
+ *    MoleCuilder is distributed in the hope that it will be useful,
+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *    GNU General Public License for more details.
+ *
+ *    You should have received a copy of the GNU General Public License
+ *    along with MoleCuilder.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * BreadthFirstSearchGatherer.cpp
+ *
+ *  Created on: May 17, 2017
+ *      Author: heber
+ */
+
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+//#include "CodePatterns/MemDebug.hpp"
+
+#include "BreadthFirstSearchGatherer.hpp"
+
+#include "CodePatterns/Log.hpp"
+
+#include "Graph/BoostGraphCreator.hpp"
+
+#include <boost/graph/breadth_first_search.hpp>
+
+/**
+ * I have no idea why this is so complicated with BGL ...
+ *
+ * This is taken from the book "The Boost Graph Library: User Guide and Reference Manual, Portable Documents",
+ * chapter "Basic Graph Algorithms", example on calculating the bacon number.
+ */
+template <typename DistanceMap>
+class distance_recorder : public boost::default_bfs_visitor
+{
+public:
+  distance_recorder(DistanceMap dist) : d(dist) {}
+
+  template <typename Edge, typename Graph>
+  void tree_edge(Edge e, const Graph &g) const {
+    typename boost::graph_traits<Graph>::vertex_descriptor u = source(e,g), v = target(e,g);
+    d[v] = d[u] + 1;
+  }
+
+private:
+  DistanceMap d;
+};
+
+template <typename DistanceMap>
+distance_recorder<DistanceMap> record_distance(DistanceMap d)
+{
+  return distance_recorder<DistanceMap>(d);
+}
+
+BreadthFirstSearchGatherer::BreadthFirstSearchGatherer(BoostGraphCreator &_BGcreator) :
+    BGcreator(_BGcreator)
+{}
+
+std::vector<atomId_t> BreadthFirstSearchGatherer::operator()(const atomId_t &_discoverfrom)
+{
+  std::vector<atomId_t> returnids;
+
+  // Do BFS through graph from given vertex
+  const size_t num_vertices = BGcreator.getNumVertices();
+  distances_t distances(num_vertices, num_vertices+1); // set distance to num+1
+  const BoostGraphCreator::UndirectedGraph &BGgraph = BGcreator.get();
+  const BoostGraphCreator::nodeId_t discoverfrom_nodeid = BGcreator.getNodeId(_discoverfrom);
+  distances[ boost::vertex(discoverfrom_nodeid, BGgraph) ] = 0;
+  boost::breadth_first_search(
+      BGgraph,
+      boost::vertex(discoverfrom_nodeid, BGgraph),
+      boost::visitor(record_distance(&distances[0])));
+  LOG(3, "DEBUG: From atom #" << _discoverfrom
+      << " BFS discovered the following distances " << distances);
+
+  // any node was discovered whose distances is less than num_vertices+1
+  const BoostGraphCreator::const_name_map_t name_map = boost::get(boost::vertex_name, BGgraph);
+  BoostGraphCreator::vertex_iter vp, vpend;
+  for (boost::tie(vp, vpend) = vertices(BGgraph); vp != vpend; ++vp) {
+    BoostGraphCreator::Vertex v = *vp;
+    if (distances[v] != (num_vertices+1)) {
+      returnids.push_back( boost::get(name_map, v) );
+    }
+  }
+
+  return returnids;
+}
Index: src/Graph/BreadthFirstSearchGatherer.hpp
===================================================================
--- src/Graph/BreadthFirstSearchGatherer.hpp	(revision bccbe9039159cc1a3d427c8fb04c85ef2db4e781)
+++ src/Graph/BreadthFirstSearchGatherer.hpp	(revision bccbe9039159cc1a3d427c8fb04c85ef2db4e781)
@@ -0,0 +1,49 @@
+/*
+ * BreadthFirstSearchGatherer.hpp
+ *
+ *  Created on: May 17, 2017
+ *      Author: heber
+ */
+
+
+#ifndef GRAPH_BREADTHFIRSTSEARCHGATHERER_HPP_
+#define GRAPH_BREADTHFIRSTSEARCHGATHERER_HPP_
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <stddef.h>
+#include <vector>
+
+#include "types.hpp"
+
+struct BoostGraphCreator;
+
+/** This struct performs a BFS on a given boost::graph and finds
+ * all nodes, i.e. atoms, up to a given limit.
+ */
+struct BreadthFirstSearchGatherer
+{
+  /** Cstor of class BreadthFirstSearchGatherer.
+   *
+   * \param _graph graph to work on
+   */
+  BreadthFirstSearchGatherer(BoostGraphCreator &_graph);
+
+  /** Discovers all nodes from the given \a _discoverfrom and returns
+   * the vector of ids.
+   */
+  std::vector<atomId_t> operator()(const atomId_t &_discoverfrom);
+
+private:
+  //!> typedef for a vector with BFS discovery distances
+  typedef std::vector<size_t> distances_t;
+
+  //!> graph to operate on
+  BoostGraphCreator &BGcreator;
+};
+
+
+#endif /* GRAPH_BREADTHFIRSTSEARCHGATHERER_HPP_ */
Index: src/Graph/Makefile.am
===================================================================
--- src/Graph/Makefile.am	(revision d24ef58f28627a24574b012f8f2b174072c4da20)
+++ src/Graph/Makefile.am	(revision bccbe9039159cc1a3d427c8fb04c85ef2db4e781)
@@ -3,8 +3,9 @@
 
 GRAPHSOURCE = \
+	Graph/AdjacencyList.cpp \
 	Graph/BondGraph.cpp \
 	Graph/BoostGraphCreator.cpp \
+	Graph/BreadthFirstSearchGatherer.cpp \
 	Graph/BuildInducedSubgraph.cpp \
-	Graph/AdjacencyList.cpp \
 	Graph/ConnectedSubgraph.cpp \
 	Graph/CyclicStructureAnalysis.cpp \
@@ -12,8 +13,10 @@
 				  
 GRAPHHEADER = \
+	Graph/AdjacencyList.hpp \
 	Graph/BondGraph.hpp \
 	Graph/BoostGraphCreator.hpp \
+	Graph/BoostGraphHelpers.hpp \
+	Graph/BreadthFirstSearchGatherer.hpp \
 	Graph/BuildInducedSubgraph.hpp \
-	Graph/AdjacencyList.hpp \
 	Graph/ConnectedSubgraph.hpp \
 	Graph/CyclicStructureAnalysis.hpp \
