Index: src/Actions/GlobalListOfActions.hpp
===================================================================
--- src/Actions/GlobalListOfActions.hpp	(revision 8d56a66db031fb7242c20ad2e8df56f7593755b6)
+++ src/Actions/GlobalListOfActions.hpp	(revision d83d6492abd671df58bbc39c4ca809a226bba4d2)
@@ -75,4 +75,5 @@
   (GeometryPositionToVector) \
   (GeometryRemove) \
+  (GraphChemicalSpaceEvaluator) \
   (GraphUpdateMolecules) \
   (GraphCorrectBondDegree) \
Index: src/Actions/GraphAction/ChemicalSpaceEvaluatorAction.cpp
===================================================================
--- src/Actions/GraphAction/ChemicalSpaceEvaluatorAction.cpp	(revision d83d6492abd671df58bbc39c4ca809a226bba4d2)
+++ src/Actions/GraphAction/ChemicalSpaceEvaluatorAction.cpp	(revision d83d6492abd671df58bbc39c4ca809a226bba4d2)
@@ -0,0 +1,155 @@
+/*
+ * 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/>.
+ */
+
+/*
+ * ChemicalSpaceEvaluator.cpp
+ *
+ *  Created on: Sep 26, 2017
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+//#include "CodePatterns/MemDebug.hpp"
+
+#include <iostream>
+#include <string>
+#include <vector>
+
+#include "CodePatterns/Log.hpp"
+
+#include "Actions/GraphAction/ChemicalSpaceEvaluatorAction.hpp"
+
+#include "Element/element.hpp"
+#include "Graph/BoostGraphCreator.hpp"
+#include "Fragmentation/Homology/HomologyContainer.hpp"
+#include "FunctionApproximation/Extractors.hpp"
+#include "World.hpp"
+
+#include <boost/graph/adjacency_list.hpp>
+
+using namespace MoleCuilder;
+
+// and construct the stuff
+#include "ChemicalSpaceEvaluatorAction.def"
+#include "Action_impl_pre.hpp"
+/** =========== define the function ====================== */
+ActionState::ptr GraphChemicalSpaceEvaluatorAction::performCall() {
+  // create boost::graph from graph6 string
+  BoostGraphCreator BGC;
+  BGC.createFromGraph6String(params.graph_string.get());
+
+  BoostGraphCreator::UndirectedGraph graph = BGC.get();
+
+  Extractors::index_map_t index_map = boost::get(boost::vertex_index, graph);
+  LOG(2, "DEBUG: We have " << boost::num_vertices(graph) << " nodes in the fragment graph.");
+
+  // associate type with a node index
+  Extractors::type_index_lookup_t type_index_lookup;
+  std::vector<unsigned int> elementnumbers;
+  elementnumbers.reserve(params.graph_elements.get().size());
+  for (std::vector<const element *>::const_iterator iter = params.graph_elements.get().begin();
+      iter != params.graph_elements.get().end(); ++iter) {
+    elementnumbers.push_back((*iter)->getAtomicNumber());
+    type_index_lookup.left.insert(
+        std::make_pair(
+            std::distance(iter, params.graph_elements.get().begin()),
+            Extractors::ParticleType_t(elementnumbers.back())));
+  }
+
+  // create all induced subgraphs
+  const size_t nodes_in_graph = boost::num_vertices(graph);
+  LOG(2, "DEBUG: There are " << nodes_in_graph << " nodes in the graph.");
+  Extractors::set_of_nodes_t set_of_nodes;
+  for (size_t nodeid = 0; nodeid < nodes_in_graph; ++nodeid) {
+    const size_t &rootindex = nodeid;
+    LOG(2, "DEBUG: Current root index is " << rootindex);
+
+    /// 5a. from node in graph (with this index) perform BFS till n-1 (#nodes in binding model)
+    std::vector<size_t> distances(boost::num_vertices(graph));
+    boost::breadth_first_search(
+        graph,
+        boost::vertex(rootindex, graph),
+        boost::visitor(Extractors::record_distance(&distances[0])));
+    LOG(3, "DEBUG: BFS discovered the following distances " << distances);
+
+    /// 5b. and store all node in map with distance to root as key
+    Extractors::nodes_per_level_t nodes_per_level;
+    for (size_t i=0;i<distances.size();++i) {
+      nodes_per_level.insert( std::make_pair(Extractors::level_t(distances[i]), Extractors::node_t(i)) );
+    }
+    LOG(3, "DEBUG: Nodes per level are " << nodes_per_level);
+
+    /// 6. construct all possible induced connected subgraphs with this map (see fragmentation)
+    Extractors::nodes_t nodes;
+    // rootindex is always contained
+    nodes.insert( rootindex );
+    Extractors::level_t level = 0;
+
+    Extractors::generateAllInducedConnectedSubgraphs(
+        nodes_in_graph-1, level, nodes, set_of_nodes, nodes_per_level, graph, distances, index_map);
+    LOG(2, "DEBUG: We have found " << set_of_nodes.size() << " unique induced, connected subgraphs.");
+  }
+
+  const HomologyContainer &container = World::getInstance().getHomologies();
+  /// go through each induced, connected subgraph
+  for (Extractors::set_of_nodes_t::const_iterator nodesiter = set_of_nodes.begin();
+      nodesiter != set_of_nodes.end(); ++nodesiter) {
+    /// convert its nodes into a HomologyGraph using the graph and elements (types for index)
+    const Extractors::nodes_t &nodes = *nodesiter;
+    const HomologyGraph nodes_graph =
+        Extractors::createHomologyGraphFromNodes(nodes, type_index_lookup, graph, index_map);
+
+    /// Query HomologyContainer for this HomologyGraph.
+    HomologyContainer::range_t range = container.getHomologousGraphs(nodes_graph);
+
+    if (range.first == range.second) {
+      // range is empty, the fragment is unknown
+      ELOG(1, "Cannot find fragment graph " << nodes_graph << " to graph " << elementnumbers);
+    } else {
+      // list first energy
+      LOG(1, "Fragment graph " << nodes_graph << " has energy " << range.first->second.energy);
+    }
+  }
+
+  return Action::success;
+}
+
+ActionState::ptr GraphChemicalSpaceEvaluatorAction::performUndo(ActionState::ptr _state) {
+  return Action::success;
+}
+
+ActionState::ptr GraphChemicalSpaceEvaluatorAction::performRedo(ActionState::ptr _state){
+  return Action::success;
+}
+
+bool GraphChemicalSpaceEvaluatorAction::canUndo() {
+  return true;
+}
+
+bool GraphChemicalSpaceEvaluatorAction::shouldUndo() {
+  return true;
+}
+/** =========== end of function ====================== */
Index: src/Actions/GraphAction/ChemicalSpaceEvaluatorAction.def
===================================================================
--- src/Actions/GraphAction/ChemicalSpaceEvaluatorAction.def	(revision d83d6492abd671df58bbc39c4ca809a226bba4d2)
+++ src/Actions/GraphAction/ChemicalSpaceEvaluatorAction.def	(revision d83d6492abd671df58bbc39c4ca809a226bba4d2)
@@ -0,0 +1,39 @@
+/*
+ * ChemicalSpaceEvaluatorAction.def
+ *
+ *  Created on: Sep 26, 2017
+ *      Author: heber
+ */
+
+// all includes and forward declarations necessary for non-integral types below
+
+#include "Parameters/Validators/DummyValidator.hpp"
+#include "Parameters/Validators/STLVectorValidator.hpp"
+#include "Parameters/Validators/Specific/ElementValidator.hpp"
+
+// i.e. there is an integer with variable name Z that can be found in
+// ValueStorage by the token "Z" -> first column: int, Z, "Z"
+// "undefine" if no parameters are required, use (NOPARAM_DEFAULT) for each (undefined) default value
+#define paramtypes (std::string)(std::vector<const element*>)
+#define paramtokens ("graph6")("elements")
+#define paramdescriptions ("graph6 string representing a graph")("set of chemical elements for each node")
+#define paramdefaults (NOPARAM_DEFAULT)(NOPARAM_DEFAULT)
+#define paramreferences (graph_string)(graph_elements)
+#define paramvalids \
+(DummyValidator<std::string>()) \
+(STLVectorValidator< std::vector<const element *> >(1,100, ElementValidator()))
+
+#undef statetypes
+#undef statereferences
+
+// some defines for all the names, you may use ACTION, STATE and PARAMS
+#define CATEGORY Graph
+#define MENUNAME "graph"
+#define MENUPOSITION 7
+#define ACTIONNAME ChemicalSpaceEvaluator
+#define TOKEN "evaluate-chemical-space"
+
+
+// finally the information stored in the ActionTrait specialization
+#define DESCRIPTION "construct all possible chemical molecules for a given graph6 string and gives their energy."
+#undef SHORTFORM
Index: src/Actions/GraphAction/ChemicalSpaceEvaluatorAction.hpp
===================================================================
--- src/Actions/GraphAction/ChemicalSpaceEvaluatorAction.hpp	(revision d83d6492abd671df58bbc39c4ca809a226bba4d2)
+++ src/Actions/GraphAction/ChemicalSpaceEvaluatorAction.hpp	(revision d83d6492abd671df58bbc39c4ca809a226bba4d2)
@@ -0,0 +1,22 @@
+/*
+ * ChemicalSpaceEvaluatorAction.hpp
+ *
+ *  Created on: Sep 26, 2017
+ *      Author: heber
+ */
+
+#ifndef CHEMICALSPACEEVALUATORACTION_HPP_
+#define CHEMICALSPACEEVALUATORACTION_HPP_
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+
+#include "Actions/Action.hpp"
+
+#include "ChemicalSpaceEvaluatorAction.def"
+#include "Action_impl_header.hpp"
+
+#endif /* CHEMICALSPACEEVALUATORACTION_HPP_ */
Index: src/Actions/Makefile.am
===================================================================
--- src/Actions/Makefile.am	(revision 8d56a66db031fb7242c20ad2e8df56f7593755b6)
+++ src/Actions/Makefile.am	(revision d83d6492abd671df58bbc39c4ca809a226bba4d2)
@@ -312,4 +312,5 @@
 
 GRAPHACTIONSOURCE = \
+  Actions/GraphAction/ChemicalSpaceEvaluatorAction.cpp \
   Actions/GraphAction/CorrectBondDegreeAction.cpp \
   Actions/GraphAction/CreateAdjacencyAction.cpp \
@@ -319,4 +320,5 @@
   Actions/GraphAction/UpdateMoleculesAction.cpp
 GRAPHACTIONHEADER = \
+  Actions/GraphAction/ChemicalSpaceEvaluatorAction.hpp \
   Actions/GraphAction/CorrectBondDegreeAction.hpp \
   Actions/GraphAction/CreateAdjacencyAction.hpp \
@@ -326,4 +328,5 @@
   Actions/GraphAction/UpdateMoleculesAction.hpp
 GRAPHACTIONDEFS = \
+  Actions/GraphAction/ChemicalSpaceEvaluatorAction.def \
   Actions/GraphAction/CorrectBondDegreeAction.def \
   Actions/GraphAction/CreateAdjacencyAction.def \
Index: src/FunctionApproximation/Extractors.cpp
===================================================================
--- src/FunctionApproximation/Extractors.cpp	(revision 8d56a66db031fb7242c20ad2e8df56f7593755b6)
+++ src/FunctionApproximation/Extractors.cpp	(revision d83d6492abd671df58bbc39c4ca809a226bba4d2)
@@ -67,4 +67,6 @@
 
 using namespace boost::assign;
+
+using namespace Extractors;
 
 FunctionModel::arguments_t
@@ -186,29 +188,4 @@
 }
 
-typedef size_t level_t;
-typedef size_t node_t;
-typedef std::multimap< level_t, node_t > nodes_per_level_t;
-typedef std::set<node_t> nodes_t;
-typedef std::set<nodes_t> set_of_nodes_t;
-typedef boost::property_map < boost::adjacency_list <>, boost::vertex_index_t >::type index_map_t;
-
-typedef boost::bimap<
-    boost::bimaps::set_of< size_t >,
-    boost::bimaps::multiset_of< Extractors::ParticleType_t >
-> type_index_lookup_t;
-
-typedef std::set<node_t> set_type;
-typedef std::set<set_type> powerset_type;
-
-typedef boost::adjacency_list < boost::vecS, boost::vecS, boost::undirectedS,
-    boost::no_property, boost::no_property > UndirectedGraph;
-typedef boost::subgraph< UndirectedGraph > UndirectedSubgraph;
-
-typedef std::map< node_t, std::pair<Extractors::ParticleType_t, size_t> > node_FragmentNode_map_t;
-
-typedef std::map< argument_t::indices_t, size_t> argument_placement_map_t;
-
-typedef std::map<size_t, size_t> argindex_to_nodeindex_t;
-
 void insertIntoNodeFragmentMap(
     node_FragmentNode_map_t &_node_FragmentNode_map,
@@ -334,5 +311,5 @@
  * \param index_map with indices per \a graph' vertex
  */
-static void generateAllInducedConnectedSubgraphs(
+void generateAllInducedConnectedSubgraphs(
     const size_t N,
     const level_t level,
@@ -438,5 +415,5 @@
 }
 
-static HomologyGraph createHomologyGraphFromNodes(
+HomologyGraph createHomologyGraphFromNodes(
     const nodes_t &nodes,
     const type_index_lookup_t &type_index_lookup,
@@ -501,32 +478,4 @@
 
   return HomologyGraph(graph_nodes, graph_edges);
-}
-
-/**
- * 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);
 }
 
Index: src/FunctionApproximation/Extractors.hpp
===================================================================
--- src/FunctionApproximation/Extractors.hpp	(revision 8d56a66db031fb7242c20ad2e8df56f7593755b6)
+++ src/FunctionApproximation/Extractors.hpp	(revision d83d6492abd671df58bbc39c4ca809a226bba4d2)
@@ -51,4 +51,74 @@
   typedef std::vector<ParticleType_t> ParticleTypes_t;
 
+  typedef size_t level_t;
+  typedef size_t node_t;
+  typedef std::multimap< level_t, node_t > nodes_per_level_t;
+  typedef std::set<node_t> nodes_t;
+  typedef std::set<nodes_t> set_of_nodes_t;
+  typedef boost::property_map < boost::adjacency_list <>, boost::vertex_index_t >::type index_map_t;
+
+  typedef boost::bimap<
+      boost::bimaps::set_of< size_t >,
+      boost::bimaps::multiset_of< Extractors::ParticleType_t >
+  > type_index_lookup_t;
+
+  typedef std::set<node_t> set_type;
+  typedef std::set<set_type> powerset_type;
+
+  typedef boost::adjacency_list < boost::vecS, boost::vecS, boost::undirectedS,
+      boost::no_property, boost::no_property > UndirectedGraph;
+  typedef boost::subgraph< UndirectedGraph > UndirectedSubgraph;
+
+  typedef std::map< node_t, std::pair<Extractors::ParticleType_t, size_t> > node_FragmentNode_map_t;
+
+  typedef std::map< argument_t::indices_t, size_t> argument_placement_map_t;
+
+  typedef std::map<size_t, size_t> argindex_to_nodeindex_t;
+
+  /**
+   * 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);
+  }
+
+  HomologyGraph createHomologyGraphFromNodes(
+      const nodes_t &nodes,
+      const type_index_lookup_t &type_index_lookup,
+      const UndirectedGraph &graph,
+      const index_map_t &index_map
+      );
+
+  void generateAllInducedConnectedSubgraphs(
+      const size_t N,
+      const level_t level,
+      const nodes_t &nodes,
+      set_of_nodes_t &set_of_nodes,
+      const nodes_per_level_t &nodes_per_level,
+      const UndirectedGraph &graph,
+      const std::vector<size_t> &_distance,
+      const index_map_t &index_map);
+
   /** Namespace for some internal helper functions.
    *
Index: src/Graph/BoostGraphCreator.cpp
===================================================================
--- src/Graph/BoostGraphCreator.cpp	(revision 8d56a66db031fb7242c20ad2e8df56f7593755b6)
+++ src/Graph/BoostGraphCreator.cpp	(revision d83d6492abd671df58bbc39c4ca809a226bba4d2)
@@ -43,4 +43,5 @@
 
 #include "Atom/atom.hpp"
+#include "Graph/Graph6Reader.hpp"
 #include "molecule.hpp"
 
@@ -94,4 +95,39 @@
 }
 
+void BoostGraphCreator::createFromGraph6String(
+    const std::string &_graph_string)
+{
+  Graph6Reader reader;
+  {
+    std::stringstream inputstream(_graph_string);
+    reader(inputstream);
+  }
+
+  graph = UndirectedGraph();
+
+  // add nodes
+  for(int numbers = 0; numbers < reader.get_num_nodes(); ++numbers) {
+    const atomId_t atomid = numbers;
+    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
+  const Graph6Reader::edges_t &edges = reader.get_edges();
+  for(Graph6Reader::edges_t::const_iterator iter = edges.begin();
+      iter != edges.end(); ++iter) {
+    // graph6 contains only upper triangle of adjacency matrix, hence add only once
+    const nodeId_t leftnodeid = iter->first;
+    const nodeId_t rightnodeid = iter->second;
+    boost::add_edge(leftnodeid, rightnodeid, graph);
+  }
+}
+
 BoostGraphCreator::nodeId_t BoostGraphCreator::getNodeId(
     const atomId_t &_atomid) const
Index: src/Graph/BoostGraphCreator.hpp
===================================================================
--- src/Graph/BoostGraphCreator.hpp	(revision 8d56a66db031fb7242c20ad2e8df56f7593755b6)
+++ src/Graph/BoostGraphCreator.hpp	(revision d83d6492abd671df58bbc39c4ca809a226bba4d2)
@@ -90,4 +90,12 @@
       const predicate_t &_pred);
 
+  /** Creates the boost::graph from the defining graph6 string where the atom
+   * nodes map is simply the identity.
+   *
+   * \param _graph_string graph6 string defining the graph
+   */
+  void createFromGraph6String(
+      const std::string &_graph_string);
+
   /** Getter for the created graph.
    *
Index: src/Graph/Graph6Reader.cpp
===================================================================
--- src/Graph/Graph6Reader.cpp	(revision d83d6492abd671df58bbc39c4ca809a226bba4d2)
+++ src/Graph/Graph6Reader.cpp	(revision d83d6492abd671df58bbc39c4ca809a226bba4d2)
@@ -0,0 +1,116 @@
+/*
+ * 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/>.
+ */
+
+/*
+ * Graph6Reader.cpp
+ *
+ *  Created on: Sep 26, 2017
+ *      Author: heber
+ */
+
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+//#include "CodePatterns/MemDebug.hpp"
+
+#include <iterator>
+
+#include "CodePatterns/Assert.hpp"
+
+#include "Graph6Reader.hpp"
+
+const int Graph6Reader::packet_size(5);
+
+void Graph6Reader::operator()(std::istream &_graph_string)
+{
+  std::istream_iterator<unsigned char> iter(_graph_string);
+  scan_num_nodes(iter);
+  scan_edges(iter);
+}
+
+void Graph6Reader::scan_num_nodes(std::istream_iterator<unsigned char> &_it)
+{
+  int packets;
+  int num_nodes;
+	//now we're one past the optional header
+	//parse the number of nodes
+	ASSERT(*_it >= 63, "The number of nodes is not properly encoded");
+	if (*_it <126) {
+		//6-bit encoding
+		num_nodes = *_it-63;
+	} else if (*_it++ == 126) {
+		unsigned int packets = 3;
+		if (*_it == 126) {
+			//36-bit encoding
+			packets++;
+			_it++;
+		}
+		for(unsigned int i =0; i<packets*packet_size; ++i) {
+			unsigned char packet = (*_it++) - 63;
+			ASSERT(packet<=(1<<(packet_size+1)),
+					"The input is malformed. "
+					"It contains a non-printable ascii-char in the number of nodes encoding.");
+			num_nodes += packet;
+			num_nodes *= (1<<packet_size);
+		}
+	} else {
+		ASSERT(*_it<=126,
+			"The input is malformed. "
+			"The number of nodes is not correctly encoded, the first byte is >126."
+			);
+	}
+	++_it;
+}
+
+void Graph6Reader::next_edge(std::istream_iterator<unsigned char> &_it) {
+  unsigned int bit = 0;
+  while(!bit && !eos) {
+    if (++row==column) {
+      column+=1;
+      row = 0;
+    }
+    if (column>=num_nodes) {
+      eos = true;
+      break;
+    }
+    if (bit_pos<0) {
+      ASSERT((*_it >= 63) && (*_it <= 126),
+          "The input contains a non-printable ascii char in the matrix encoding");
+      cur_byte = (*_it) - 63;
+      ++(_it);
+
+      bit_pos = packet_size;
+    }
+    bit = cur_byte & (1<<(bit_pos--));
+  }
+}
+
+void Graph6Reader::scan_edges(std::istream_iterator<unsigned char> &_it)
+{
+  while(!eos) {
+    next_edge(_it);
+    edges.push_back(std::make_pair(column,row));
+  }
+}
Index: src/Graph/Graph6Reader.hpp
===================================================================
--- src/Graph/Graph6Reader.hpp	(revision d83d6492abd671df58bbc39c4ca809a226bba4d2)
+++ src/Graph/Graph6Reader.hpp	(revision d83d6492abd671df58bbc39c4ca809a226bba4d2)
@@ -0,0 +1,73 @@
+/*
+ * Graph6Reader.hpp
+ *
+ *  Created on: Sep 26, 2017
+ *      Author: heber
+ */
+
+
+#ifndef GRAPH_GRAPH6READER_HPP_
+#define GRAPH_GRAPH6READER_HPP_
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <istream>
+#include <string>
+#include <vector>
+
+/** This functor parses graph6 formatted strings and returns number of nodes
+ * and a edge list.
+ *
+ * This is inspired by https://github.com/adrianN/graph6/, only I found the code
+ * there quite ugly and unnecessarily complicated: inheriting from std::iterator,
+ * overriding all the operators (++, *, ...) for no apparent reason instead of
+ * adding normal functions, ...
+ *
+ */
+struct Graph6Reader
+{
+  typedef std::pair<int, int> edge_t;
+  typedef std::vector< edge_t > edges_t;
+
+  Graph6Reader() :
+    column(0),
+    row(0),
+    eos(0),
+    bit_pos(0),
+    cur_byte(0),
+    num_nodes(0)
+  {}
+
+  void operator()(std::istream &_graph_string);
+
+  int get_num_nodes() const
+  { return num_nodes; }
+
+  const edges_t& get_edges() const
+  { return edges; }
+
+private:
+
+  void scan_num_nodes(std::istream_iterator<unsigned char> &_it);
+  void scan_edges(std::istream_iterator<unsigned char> &_it);
+  void next_edge(std::istream_iterator<unsigned char> &_it);
+
+private:
+  int column;
+  int row;
+  int eos;
+  int bit_pos;
+  int cur_byte;
+  static const int packet_size;
+
+  //!> contains number of edges
+  int num_nodes;
+  //!> contains edge list
+  std::vector< edge_t > edges;
+};
+
+
+#endif /* GRAPH_GRAPH6READER_HPP_ */
Index: src/Graph/Makefile.am
===================================================================
--- src/Graph/Makefile.am	(revision 8d56a66db031fb7242c20ad2e8df56f7593755b6)
+++ src/Graph/Makefile.am	(revision d83d6492abd671df58bbc39c4ca809a226bba4d2)
@@ -10,6 +10,7 @@
 	Graph/ConnectedSubgraph.cpp \
 	Graph/CyclicStructureAnalysis.cpp \
-	Graph/DepthFirstSearchAnalysis.cpp
-				  
+	Graph/DepthFirstSearchAnalysis.cpp \
+	Graph/Graph6Reader.cpp
+
 GRAPHHEADER = \
 	Graph/AdjacencyList.hpp \
@@ -23,4 +24,5 @@
 	Graph/CyclicStructureAnalysis.hpp \
 	Graph/DepthFirstSearchAnalysis.hpp \
+	Graph/Graph6Reader.hpp \
 	Graph/ListOfLocalAtoms.hpp
 
Index: tests/Python/AllActions/moltest_check.py
===================================================================
--- tests/Python/AllActions/moltest_check.py	(revision 8d56a66db031fb7242c20ad2e8df56f7593755b6)
+++ tests/Python/AllActions/moltest_check.py	(revision d83d6492abd671df58bbc39c4ca809a226bba4d2)
@@ -24,5 +24,5 @@
 def CheckParameters(docstring):
     result = 0
-    params = re.findall(r'\(str\)([-_a-zA-Z]*)', docstring)
+    params = re.findall(r'\(str\)([-_a-zA-Z0-9]*)', docstring)
 
     for param in params:
Index: tests/Python/AllActions/options.dat
===================================================================
--- tests/Python/AllActions/options.dat	(revision 8d56a66db031fb7242c20ad2e8df56f7593755b6)
+++ tests/Python/AllActions/options.dat	(revision d83d6492abd671df58bbc39c4ca809a226bba4d2)
@@ -92,4 +92,5 @@
 fragment_path	"test/"
 fragment_prefix	"BondFragment"
+graph6	"B`"
 grid_level	"5"
 help	"help"
