diff --git a/alib2algo/src/arbology/exact/ExactPatternMatch.cpp b/alib2algo/src/arbology/exact/ExactPatternMatch.cpp
index 294da76a459c06b0049c56b8c2714ae834f8392f..1107c39de918af6af208c2d98d624daa24ce183a 100644
--- a/alib2algo/src/arbology/exact/ExactPatternMatch.cpp
+++ b/alib2algo/src/arbology/exact/ExactPatternMatch.cpp
@@ -11,6 +11,7 @@
 namespace {
 
 auto ExactPatternMatchUnrankedPattern = registration::AbstractRegister < arbology::exact::ExactPatternMatch, ext::set < unsigned >, const tree::UnrankedTree < > &, const tree::UnrankedPattern < > & > ( arbology::exact::ExactPatternMatch::match );
+auto ExactPatternMatchUnorderedRankedPattern = registration::AbstractRegister < arbology::exact::ExactPatternMatch, ext::set < unsigned >, const tree::UnorderedRankedTree < > &, const tree::UnorderedRankedPattern < > & > ( arbology::exact::ExactPatternMatch::match );
 auto ExactPatternMatchRankedPattern = registration::AbstractRegister < arbology::exact::ExactPatternMatch, ext::set < unsigned >, const tree::RankedTree < > &, const tree::RankedPattern < > & > ( arbology::exact::ExactPatternMatch::match );
 auto ExactPatternMatchRankedNonlinearPattern = registration::AbstractRegister < arbology::exact::ExactPatternMatch, ext::set < unsigned >, const tree::RankedTree < > &, const tree::RankedNonlinearPattern < > & > ( arbology::exact::ExactPatternMatch::match );
 auto ExactPatternMatchPrefixRankedPattern = registration::AbstractRegister < arbology::exact::ExactPatternMatch, ext::set < unsigned >, const tree::PrefixRankedTree < > &, const tree::PrefixRankedPattern < > & > ( arbology::exact::ExactPatternMatch::match );
diff --git a/alib2algo/src/arbology/exact/ExactPatternMatch.h b/alib2algo/src/arbology/exact/ExactPatternMatch.h
index d8734a3131274fbaeb55f18ab3b3d795efbf33d0..d51bb809e290fce91eecd4838d2c569b795c0129 100644
--- a/alib2algo/src/arbology/exact/ExactPatternMatch.h
+++ b/alib2algo/src/arbology/exact/ExactPatternMatch.h
@@ -13,6 +13,9 @@
 #include <alib/deque>
 #include <alib/foreach>
 
+#include <tree/ranked/UnorderedRankedTree.h>
+#include <tree/ranked/UnorderedRankedPattern.h>
+
 #include <tree/ranked/RankedTree.h>
 #include <tree/ranked/RankedPattern.h>
 #include <tree/ranked/RankedNonlinearPattern.h>
@@ -42,6 +45,9 @@ public:
 	template < class SymbolType >
 	static ext::set < unsigned > match ( const tree::UnrankedTree < SymbolType > & subject, const tree::UnrankedPattern < SymbolType > & pattern );
 
+	template < class SymbolType >
+	static ext::set < unsigned > match ( const tree::UnorderedRankedTree < SymbolType > & subject, const tree::UnorderedRankedPattern < SymbolType > & pattern );
+
 	template < class SymbolType >
 	static ext::set < unsigned > match ( const tree::RankedTree < SymbolType > & subject, const tree::RankedPattern < SymbolType > & pattern );
 	template < class SymbolType >
@@ -72,6 +78,12 @@ private:
 	template < class SymbolType >
 	static void matchInternal ( unsigned & index, ext::set < unsigned > & occ, const ext::tree < common::ranked_symbol < SymbolType > > & subject, const ext::tree < common::ranked_symbol < SymbolType > > & pattern, const common::ranked_symbol < SymbolType > & subtreeVariable, const ext::set < common::ranked_symbol < SymbolType > > & nonlinearVariables, const ext::tree < common::ranked_symbol < unsigned > > & repeats );
 
+	template < class SymbolType >
+	static bool matchUnorderedHelper ( const ext::tree < common::ranked_symbol < SymbolType > > & subject, const ext::tree < common::ranked_symbol < SymbolType > > & pattern, const common::ranked_symbol < SymbolType > & subtreeVariable );
+
+	template < class SymbolType >
+	static void matchUnorderedInternal ( unsigned & index, ext::set < unsigned > & occ, const ext::tree < common::ranked_symbol < SymbolType > > & subject, const ext::tree < common::ranked_symbol < SymbolType > > & pattern, const common::ranked_symbol < SymbolType > & subtreeVariable );
+
 };
 
 template < class SymbolType >
@@ -156,6 +168,44 @@ void ExactPatternMatch::matchInternal ( unsigned & index, ext::set < unsigned >
 		matchInternal ( index, occ, std::get < 0 > ( childs ), pattern, subtreeVariable, nonlinearVariables, std::get < 1 > ( childs ) );
 }
 
+template < class SymbolType >
+bool ExactPatternMatch::matchUnorderedHelper ( const ext::tree < common::ranked_symbol < SymbolType > > & subject, const ext::tree < common::ranked_symbol < SymbolType > > & pattern, const common::ranked_symbol < SymbolType > & subtreeVariable ) {
+	if ( pattern.getData ( ) == subtreeVariable ) return true;
+
+	if ( subject.getData ( ) != pattern.getData ( ) ) return false;
+
+	auto testPermutation = [ ] ( const auto & subjectChildren, const auto & patternChildren, const common::ranked_symbol < SymbolType > & subtreeVar ) {
+		 // ranked symbols are the same; test for number of children is not needed
+		for ( const ext::tuple < const ext::tree < common::ranked_symbol < SymbolType > > &, const ext::reference_wrapper < const ext::tree < common::ranked_symbol < SymbolType > > > & > & childs : ext::make_tuple_foreach ( subjectChildren, patternChildren ) )
+			if ( ! matchUnorderedHelper ( std::get < 0 > ( childs ), std::get < 1 > ( childs ).get ( ), subtreeVar ) )
+				return false;
+
+		return true;
+	};
+
+	ext::vector < ext::reference_wrapper < const ext::tree < common::ranked_symbol < SymbolType > > > > patternChildrenRefs;
+	for ( const auto & child : pattern.getChildren ( ) ) {
+		patternChildrenRefs.emplace_back ( child );
+	}
+
+	do {
+		if ( testPermutation ( subject.getChildren ( ), patternChildrenRefs, subtreeVariable ) )
+			return true;
+	} while ( next_permutation ( patternChildrenRefs.begin ( ), patternChildrenRefs.end ( ) ) );
+
+	return false;
+}
+
+template < class SymbolType >
+void ExactPatternMatch::matchUnorderedInternal ( unsigned & index, ext::set < unsigned > & occ, const ext::tree < common::ranked_symbol < SymbolType > > & subject, const ext::tree < common::ranked_symbol < SymbolType > > & pattern, const common::ranked_symbol < SymbolType > & subtreeVariable ) {
+	if ( matchUnorderedHelper ( subject, pattern, subtreeVariable ) ) occ.insert ( index );
+
+	index++;
+
+	for ( const ext::tree < common::ranked_symbol < SymbolType > > & child : subject.getChildren ( ) )
+		matchUnorderedInternal ( index, occ, child, pattern, subtreeVariable );
+}
+
 template < class SymbolType >
 ext::set < unsigned > ExactPatternMatch::match ( const tree::UnrankedTree < SymbolType > & subject, const tree::UnrankedPattern < SymbolType > & pattern ) {
 	unsigned i = 0;
@@ -165,6 +215,15 @@ ext::set < unsigned > ExactPatternMatch::match ( const tree::UnrankedTree < Symb
 	return occ;
 }
 
+template < class SymbolType >
+ext::set < unsigned > ExactPatternMatch::match ( const tree::UnorderedRankedTree < SymbolType > & subject, const tree::UnorderedRankedPattern < SymbolType > & pattern ) {
+	unsigned i = 0;
+	ext::set < unsigned > occ;
+
+	matchUnorderedInternal ( i, occ, subject.getContent ( ), pattern.getContent ( ), pattern.getSubtreeWildcard ( ) );
+	return occ;
+}
+
 template < class SymbolType >
 ext::set < unsigned > ExactPatternMatch::match ( const tree::RankedTree < SymbolType > & subject, const tree::RankedPattern < SymbolType > & pattern ) {
 	unsigned i = 0;
diff --git a/alib2data/src/tree/common/TreeAuxiliary.h b/alib2data/src/tree/common/TreeAuxiliary.h
index 6a90c13c885e73b9ecd7e77d3fdec4440400f6d8..4c7ee98fa14025b5e7001ba86c8327f5d113a631 100644
--- a/alib2data/src/tree/common/TreeAuxiliary.h
+++ b/alib2data/src/tree/common/TreeAuxiliary.h
@@ -26,7 +26,12 @@ class TreeAuxiliary {
 
 	template < class SymbolType >
 	static ext::tree < common::ranked_symbol < SymbolType > > prefixToTreeInt ( const ext::vector < common::ranked_symbol < SymbolType > > & from, unsigned & index );
+
+	template < class SymbolType >
+	static void sortInt ( ext::tree < SymbolType > & tree );
 public:
+	template < class SymbolType >
+	static ext::tree < SymbolType > sort ( ext::tree < SymbolType > tree );
 	template < class SymbolType >
 	static ext::set < SymbolType > unrankSymbols ( const ext::set < common::ranked_symbol < SymbolType > > & alphabet );
 	template < class SymbolType >
@@ -60,6 +65,20 @@ public:
 	static ext::vector < common::ranked_symbol < SymbolType > > treeToPostfix ( const ext::tree < common::ranked_symbol < SymbolType > > & tree );
 };
 
+template < class SymbolType >
+void TreeAuxiliary::sortInt ( ext::tree < SymbolType > & tree ) {
+	for ( ext::tree < SymbolType > & child : tree.getChildren ( ) ) {
+		sortInt ( child );
+	}
+	std::sort ( tree.getChildren ( ).begin ( ), tree.getChildren ( ).end ( ) );
+}
+
+template < class SymbolType >
+ext::tree < SymbolType > TreeAuxiliary::sort ( ext::tree < SymbolType > tree ) {
+	sortInt ( tree );
+	return tree;
+}
+
 template < class SymbolType >
 ext::set < SymbolType > TreeAuxiliary::unrankSymbols ( const ext::set < common::ranked_symbol < SymbolType > > & alphabet ) {
 	return ext::transform < SymbolType > ( alphabet, [&] ( const common::ranked_symbol < SymbolType > & symbol ) {
diff --git a/alib2data/src/tree/ranked/UnorderedRankedPattern.cpp b/alib2data/src/tree/ranked/UnorderedRankedPattern.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..54bdd6a828ed4eb49f3ecda49f9e48767c06164d
--- /dev/null
+++ b/alib2data/src/tree/ranked/UnorderedRankedPattern.cpp
@@ -0,0 +1,24 @@
+/*
+ * UnorderedRankedPattern.cpp
+ *
+ *  Created on: Nov 30, 2019
+ *      Author: Jan Travnicek
+ */
+
+#include "UnorderedRankedPattern.h"
+
+#include <registration/ValuePrinterRegistration.hpp>
+#include <registration/CastRegistration.hpp>
+#include <registration/ComponentRegistration.hpp>
+
+template class tree::UnorderedRankedPattern < >;
+
+namespace {
+
+auto components = registration::ComponentRegister < tree::UnorderedRankedPattern < > > ( );
+
+auto valuePrinter = registration::ValuePrinterRegister < tree::UnorderedRankedPattern < > > ( );
+
+auto UnorderedRankedPatternFromRankedPattern = registration::CastRegister < tree::UnorderedRankedPattern < >, tree::RankedPattern < > > ( );
+
+} /* namespace */
diff --git a/alib2data/src/tree/ranked/UnorderedRankedPattern.h b/alib2data/src/tree/ranked/UnorderedRankedPattern.h
new file mode 100644
index 0000000000000000000000000000000000000000..58ae7b1695622bbe9e0c619f77094b3affebd0bc
--- /dev/null
+++ b/alib2data/src/tree/ranked/UnorderedRankedPattern.h
@@ -0,0 +1,405 @@
+/*
+ * UnorderedRankedPattern.h
+ *
+ * This file is part of Algorithms library toolkit.
+ * Copyright (C) 2017 Jan Travnicek (jan.travnicek@fit.cvut.cz)
+
+ * Algorithms library toolkit 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 3 of the License, or
+ * (at your option) any later version.
+
+ * Algorithms library toolkit 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 Algorithms library toolkit.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *  Created on: Nov 30, 2019
+ *      Author: Jan Travnicek
+ */
+
+#ifndef UNORDERED_RANKED_PATTERN_H_
+#define UNORDERED_RANKED_PATTERN_H_
+
+#include <common/DefaultSymbolType.h>
+
+namespace tree {
+
+template < class SymbolType = DefaultSymbolType >
+class UnorderedRankedPattern;
+
+} /* namespace tree */
+
+#include <sstream>
+
+#include <alib/string>
+#include <alib/set>
+#include <alib/tree>
+#include <alib/iostream>
+#include <alib/algorithm>
+
+#include <core/components.hpp>
+#include <common/ranked_symbol.hpp>
+
+#include <tree/TreeException.h>
+#include <tree/common/TreeAuxiliary.h>
+
+#include <core/normalize.hpp>
+#include <tree/common/TreeNormalize.h>
+
+#include <tree/ranked/RankedPattern.h>
+
+namespace tree {
+
+class GeneralAlphabet;
+class SubtreeWildcard;
+
+/**
+ * \brief
+ * Tree pattern represented in its natural representation. The representation is so called ranked, therefore it consists of ranked symbols. The rank of the ranked symbol needs to be compatible with unsigned integer. Additionally the pattern contains a special wildcard symbol representing any subtree.
+ *
+ * \details
+ * T = (A, C, W \in ( A \minus B ) ),
+ * A (Alphabet) = finite set of ranked symbols,
+ * C (Content) = pattern in its natural representation
+ * W (Wildcard) = special symbol representing any subtree
+ *
+ * \tparam SymbolType used for the symbol part of the ranked symbol
+ */
+template < class SymbolType >
+class UnorderedRankedPattern final : public ext::CompareOperators < UnorderedRankedPattern < SymbolType > >, public core::Components < UnorderedRankedPattern < SymbolType >, ext::set < common::ranked_symbol < SymbolType > >, component::Set, GeneralAlphabet, common::ranked_symbol < SymbolType >, component::Value, SubtreeWildcard > {
+	/**
+	 * Natural representation of the pattern content.
+	 */
+	ext::tree < common::ranked_symbol < SymbolType > > m_content;
+
+	/**
+	 * Checks that symbols of the pattern are present in the alphabet.
+	 *
+	 * \throws TreeException when some symbols of the pattern representation are not present in the alphabet
+	 *
+	 * \param data the pattern in its natural representation
+	 */
+	void checkAlphabet ( const ext::tree < common::ranked_symbol < SymbolType > > & data ) const;
+
+	/**
+	 * Checks that the rank of each symbol of a pattern node corresponds to the number of child nodes of that same node.
+	 *
+	 * \throws TreeException when some nodes of a pattern have different number of children than the rank of their label states
+	 *
+	 * \param data the pattern in its natural representation
+	 */
+	void checkArities ( const ext::tree < common::ranked_symbol < SymbolType > > & data ) const;
+
+public:
+	/**
+	 * \brief Creates a new instance of the pattern with concrete alphabet, content, and wildcard.
+	 *
+	 * \param subtreeWildcard the wildcard symbol
+	 * \param alphabet the initial alphabet of the pattern
+	 * \param pattern the initial content in it's natural representation
+	 */
+	explicit UnorderedRankedPattern ( common::ranked_symbol < SymbolType > subtreeWildcard, ext::set < common::ranked_symbol < SymbolType > > alphabet, ext::tree < common::ranked_symbol < SymbolType > > pattern );
+
+	/**
+	 * \brief Creates a new instance of the pattern with concrete content and wildcard. The alphabet is deduced from the content.
+	 *
+	 * \param subtreeWildcard the wildcard symbol
+	 * \param pattern the initial content in it's natural representation
+	 */
+	explicit UnorderedRankedPattern ( common::ranked_symbol < SymbolType > subtreeWildcard, ext::tree < common::ranked_symbol < SymbolType > > pattern );
+
+	/**
+	 * \brief Creates a new instance of the pattern based on the Ranked Pattern.
+	 *
+	 * \param tree the ranked pattern to use.
+	 */
+	explicit UnorderedRankedPattern ( const RankedPattern < SymbolType > & tree );
+
+	/**
+	 * Getter of the alphabet.
+	 *
+	 * \returns the alphabet of the pattern
+	 */
+	const ext::set < common::ranked_symbol < SymbolType > > & getAlphabet ( ) const & {
+		return this->template accessComponent < GeneralAlphabet > ( ).get ( );
+	}
+
+	/**
+	 * Getter of the alphabet.
+	 *
+	 * \returns the alphabet of the pattern
+	 */
+	ext::set < common::ranked_symbol < SymbolType > > && getAlphabet ( ) && {
+		return std::move ( this->template accessComponent < GeneralAlphabet > ( ).get ( ) );
+	}
+
+	/**
+	 * Adder of an alphabet symbols.
+	 *
+	 * \param symbols the new symbols to be added to the alphabet
+	 */
+	void extendAlphabet ( const ext::set < common::ranked_symbol < SymbolType > > & symbols ) {
+		this->template accessComponent < GeneralAlphabet > ( ).add ( symbols );
+	}
+
+	/**
+	 * Getter of the wildcard symbol.
+	 *
+	 * \returns the wildcard symbol of the pattern
+	 */
+	const common::ranked_symbol < SymbolType > & getSubtreeWildcard ( ) const & {
+		return this->template accessComponent < SubtreeWildcard > ( ).get ( );
+	}
+
+	/**
+	 * Getter of the wildcard symbol.
+	 *
+	 * \returns the wildcard symbol of the pattern
+	 */
+	common::ranked_symbol < SymbolType > && getSubtreeWildcard ( ) && {
+		return std::move ( this->template accessComponent < SubtreeWildcard > ( ).get ( ) );
+	}
+
+	/**
+	 * Getter of the pattern representation.
+	 *
+	 * \return the natural representation of the pattern.
+	 */
+	const ext::tree < common::ranked_symbol < SymbolType > > & getContent ( ) const &;
+
+	/**
+	 * Getter of the pattern representation.
+	 *
+	 * \return the natural representation of the pattern.
+	 */
+	ext::tree < common::ranked_symbol < SymbolType > > && getContent ( ) &&;
+
+	/**
+	 * Setter of the representation of the pattern.
+	 *
+	 * \throws TreeException in same situations as checkAlphabet and checkArities
+	 *
+	 * \param pattern new representation of the pattern.
+	 */
+	void setTree ( ext::tree < common::ranked_symbol < SymbolType > > pattern );
+
+	/**
+	 * The actual compare method
+	 *
+	 * \param other the other instance
+	 *
+	 * \returns the actual relation between two by type same pattern instances
+	 */
+	int compare ( const UnorderedRankedPattern & other ) const;
+
+	/**
+	 * Print this object as raw representation to ostream.
+	 *
+	 * \param out ostream where to print
+	 * \param instance object to print
+	 *
+	 * \returns modified output stream
+	 */
+	friend std::ostream & operator << ( std::ostream & out, const UnorderedRankedPattern & instance ) {
+		out << "(UnorderedRankedPattern ";
+		out << "alphabet = " << instance.getAlphabet ( );
+		out << "content = " << instance.getContent ( );
+		out << "subtreeWildcard = " << instance.getSubtreeWildcard ( );
+		out << ")";
+		return out;
+	}
+
+	/**
+	 * Casts this instance to as compact as possible string representation.
+	 *
+	 * \returns string representation of the object
+	 */
+	explicit operator std::string ( ) const;
+
+	/**
+	 * Nice printer of the tree natural representation
+	 *
+	 * \param os the output stream to print to
+	 */
+	void nicePrint ( std::ostream & os ) const;
+};
+
+template < class SymbolType >
+UnorderedRankedPattern < SymbolType >::UnorderedRankedPattern ( common::ranked_symbol < SymbolType > subtreeWildcard, ext::set < common::ranked_symbol < SymbolType > > alphabet, ext::tree < common::ranked_symbol < SymbolType > > pattern ) : core::Components < UnorderedRankedPattern, ext::set < common::ranked_symbol < SymbolType > >, component::Set, GeneralAlphabet, common::ranked_symbol < SymbolType >, component::Value, SubtreeWildcard > ( std::move ( alphabet ), std::move ( subtreeWildcard ) ), m_content ( TreeAuxiliary::sort ( std::move ( pattern ) ) ) {
+	checkAlphabet ( m_content );
+	checkArities ( m_content );
+}
+
+template < class SymbolType >
+UnorderedRankedPattern < SymbolType >::UnorderedRankedPattern ( common::ranked_symbol < SymbolType > subtreeWildcard, ext::tree < common::ranked_symbol < SymbolType > > pattern ) : UnorderedRankedPattern ( subtreeWildcard, ext::set < common::ranked_symbol < SymbolType > > ( pattern.prefix_begin ( ), pattern.prefix_end ( ) ) + ext::set < common::ranked_symbol < SymbolType > > { subtreeWildcard }, pattern ) {
+}
+
+template < class SymbolType >
+UnorderedRankedPattern < SymbolType >::UnorderedRankedPattern ( const RankedPattern < SymbolType > & tree ) : UnorderedRankedPattern ( tree.getSubtreeWildcard ( ), tree.getAlphabet ( ), tree.getContent ( ) ) {
+}
+
+template < class SymbolType >
+const ext::tree < common::ranked_symbol < SymbolType > > & UnorderedRankedPattern < SymbolType >::getContent ( ) const & {
+	return m_content;
+}
+
+template < class SymbolType >
+ext::tree < common::ranked_symbol < SymbolType > > && UnorderedRankedPattern < SymbolType >::getContent ( ) && {
+	return std::move ( m_content );
+}
+
+template < class SymbolType >
+void UnorderedRankedPattern < SymbolType >::checkAlphabet ( const ext::tree < common::ranked_symbol < SymbolType > > & data ) const {
+	ext::set < common::ranked_symbol < SymbolType > > minimalAlphabet ( data.prefix_begin ( ), data.prefix_end ( ) );
+	ext::set < common::ranked_symbol < SymbolType > > unknownSymbols;
+	std::set_difference ( minimalAlphabet.begin ( ), minimalAlphabet.end ( ), getAlphabet().begin ( ), getAlphabet().end ( ), std::inserter ( unknownSymbols, unknownSymbols.end ( ) ) );
+
+	if ( !unknownSymbols.empty ( ) )
+		throw exception::CommonException ( "Input symbols not in the alphabet." );
+}
+
+template < class SymbolType >
+void UnorderedRankedPattern < SymbolType >::checkArities ( const ext::tree < common::ranked_symbol < SymbolType > > & data ) const {
+	if ( ( size_t ) data.getData ( ).getRank ( ) != data.getChildren ( ).size ( ) )
+		throw exception::CommonException ( "Invalid rank." );
+
+	for ( const ext::tree < common::ranked_symbol < SymbolType > > & child : data )
+		checkArities ( child );
+}
+
+template < class SymbolType >
+void UnorderedRankedPattern < SymbolType >::setTree ( ext::tree < common::ranked_symbol < SymbolType > > pattern ) {
+	checkAlphabet ( pattern );
+	checkArities ( pattern );
+
+	this->m_content = TreeAuxiliary::sort ( std::move ( pattern ) );
+}
+
+template < class SymbolType >
+int UnorderedRankedPattern < SymbolType >::compare ( const UnorderedRankedPattern & other ) const {
+	auto first = ext::tie ( m_content, getAlphabet(), getSubtreeWildcard() );
+	auto second = ext::tie ( other.m_content, other.getAlphabet(), other.getSubtreeWildcard() );
+
+	static ext::compare < decltype ( first ) > comp;
+
+	return comp ( first, second );
+}
+
+template < class SymbolType >
+void UnorderedRankedPattern < SymbolType >::nicePrint ( std::ostream & os ) const {
+	m_content.nicePrint ( os );
+}
+
+template < class SymbolType >
+UnorderedRankedPattern < SymbolType >::operator std::string ( ) const {
+	std::stringstream ss;
+	ss << * this;
+	return ss.str ( );
+}
+
+} /* namespace tree */
+
+namespace core {
+
+/**
+ * Helper class specifying constraints for the pattern's internal alphabet component.
+ *
+ * \tparam SymbolType used for the symbol part of the ranked symbols of the alphabet of the pattern.
+ */
+template < class SymbolType >
+class SetConstraint< tree::UnorderedRankedPattern < SymbolType >, common::ranked_symbol < SymbolType >, tree::GeneralAlphabet > {
+public:
+	/**
+	 * Returns true if the symbol is still used in the pattern.
+	 *
+	 * \param pattern the tested pattern
+	 * \param symbol the tested symbol
+	 *
+	 * \returns true if the symbol is used, false othervise
+	 */
+	static bool used ( const tree::UnorderedRankedPattern < SymbolType > & pattern, const common::ranked_symbol < SymbolType > & symbol ) {
+		const ext::tree < common::ranked_symbol < SymbolType > > & m_content = pattern.getContent ( );
+		return std::find(m_content.prefix_begin(), m_content.prefix_end(), symbol) != m_content.prefix_end() || pattern.template accessComponent < tree::SubtreeWildcard > ( ).get ( ) == symbol;
+	}
+
+	/**
+	 * Returns true as all symbols are possibly available to be in an alphabet.
+	 *
+	 * \param pattern the tested pattern
+	 * \param symbol the tested symbol
+	 *
+	 * \returns true
+	 */
+	static bool available ( const tree::UnorderedRankedPattern < SymbolType > &, const common::ranked_symbol < SymbolType > & ) {
+		return true;
+	}
+
+	/**
+	 * All symbols are valid as symbols of an alphabet.
+	 *
+	 * \param pattern the tested pattern
+	 * \param symbol the tested symbol
+	 */
+	static void valid ( const tree::UnorderedRankedPattern < SymbolType > &, const common::ranked_symbol < SymbolType > & ) {
+	}
+};
+
+/**
+ * Helper class specifying constraints for the pattern's internal subtree wildcard element.
+ *
+ * \tparam SymbolType used for the symbol part of the ranked symbols of the alphabet of the pattern.
+ */
+template < class SymbolType >
+class ElementConstraint< tree::UnorderedRankedPattern < SymbolType >, common::ranked_symbol < SymbolType >, tree::SubtreeWildcard > {
+public:
+	/**
+	 * Determines whether the symbol is available in the pattern's alphabet.
+	 *
+	 * \param pattern the tested pattern
+	 * \param symbol the tested symbol
+	 *
+	 * \returns true if the symbol is already in the alphabet of the pattern
+	 */
+	static bool available ( const tree::UnorderedRankedPattern < SymbolType > & pattern, const common::ranked_symbol < SymbolType > & symbol ) {
+		return pattern.template accessComponent < tree::GeneralAlphabet > ( ).get ( ).count ( symbol );
+	}
+
+	/**
+	 * Subtree wildcard needs to have zero arity and it needs to be different from any nonlinear variable of the tree.
+	 *
+	 * \param pattern the tested pattern
+	 * \param symbol the tested symbol
+	 *
+	 * \throws TreeException if the symbol does not have zero arity
+	 */
+	static void valid ( const tree::UnorderedRankedPattern < SymbolType > &, const common::ranked_symbol < SymbolType > & symbol) {
+		if( ( unsigned ) symbol.getRank() != 0 )
+			throw tree::TreeException ( "SubtreeWildcard symbol has nonzero arity" );
+	}
+};
+
+/**
+ * Helper for normalisation of types specified by templates used as internal datatypes of symbols.
+ *
+ * \returns new instance of the tree with default template parameters or unmodified instance if the template parameters were already default ones
+ */
+template < class SymbolType >
+struct normalize < tree::UnorderedRankedPattern < SymbolType > > {
+	static tree::UnorderedRankedPattern < > eval ( tree::UnorderedRankedPattern < SymbolType > && value ) {
+		common::ranked_symbol < DefaultSymbolType > wildcard = alphabet::SymbolNormalize::normalizeRankedSymbol ( std::move ( value ).getSubtreeWildcard ( ) );
+		ext::set < common::ranked_symbol < DefaultSymbolType > > alphabet = alphabet::SymbolNormalize::normalizeRankedAlphabet ( std::move ( value ).getAlphabet ( ) );
+		ext::tree < common::ranked_symbol < DefaultSymbolType > > content = tree::TreeNormalize::normalizeRankedTree ( std::move ( value ).getContent ( ) );
+
+		return tree::UnorderedRankedPattern < > ( std::move ( wildcard ), std::move ( alphabet ), std::move ( content ) );
+	}
+};
+
+} /* namespace core */
+
+extern template class tree::UnorderedRankedPattern < >;
+
+#endif /* UNORDERED_RANKED_PATTERN_H_ */
diff --git a/alib2data/src/tree/ranked/UnorderedRankedTree.cpp b/alib2data/src/tree/ranked/UnorderedRankedTree.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..74accbc97ea1dd1ecb270d439d7546ea6ef4a048
--- /dev/null
+++ b/alib2data/src/tree/ranked/UnorderedRankedTree.cpp
@@ -0,0 +1,24 @@
+/*
+ * UnorderedRankedTree.cpp
+ *
+ *  Created on: Nov 30, 2019
+ *      Author: Jan Trávníček
+ */
+
+#include "UnorderedRankedTree.h"
+
+#include <registration/ValuePrinterRegistration.hpp>
+#include <registration/CastRegistration.hpp>
+#include <registration/ComponentRegistration.hpp>
+
+template class tree::UnorderedRankedTree < >;
+
+namespace {
+
+auto components = registration::ComponentRegister < tree::UnorderedRankedTree < > > ( );
+
+auto valuePrinter = registration::ValuePrinterRegister < tree::UnorderedRankedTree < > > ( );
+
+auto UnorderedRankedTreeFromRankedTree = registration::CastRegister < tree::UnorderedRankedTree < >, tree::RankedTree < > > ( );
+
+} /* namespace */
diff --git a/alib2data/src/tree/ranked/UnorderedRankedTree.h b/alib2data/src/tree/ranked/UnorderedRankedTree.h
new file mode 100644
index 0000000000000000000000000000000000000000..e688a9517d17e009d3252a0fc4799476118273fb
--- /dev/null
+++ b/alib2data/src/tree/ranked/UnorderedRankedTree.h
@@ -0,0 +1,348 @@
+/*
+ * UnorderedRankedTree.h
+ *
+ * This file is part of Algorithms library toolkit.
+ * Copyright (C) 2017 Jan Travnicek (jan.travnicek@fit.cvut.cz)
+
+ * Algorithms library toolkit 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 3 of the License, or
+ * (at your option) any later version.
+
+ * Algorithms library toolkit 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 Algorithms library toolkit.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *  Created on: Nov 23, 2013
+ *      Author: Stepan Plachy
+ */
+
+#ifndef UNORDERED_RANKED_TREE_H_
+#define UNORDERED_RANKED_TREE_H_
+
+#include <common/DefaultSymbolType.h>
+
+namespace tree {
+
+template < class SymbolType = DefaultSymbolType >
+class UnorderedRankedTree;
+
+} /* namespace tree */
+
+#include <sstream>
+
+#include <alib/string>
+#include <alib/set>
+#include <alib/tree>
+#include <alib/iostream>
+#include <alib/algorithm>
+#include <alib/compare>
+
+#include <core/components.hpp>
+#include <common/ranked_symbol.hpp>
+
+#include <tree/TreeException.h>
+#include <tree/common/TreeAuxiliary.h>
+
+#include <core/normalize.hpp>
+#include <tree/common/TreeNormalize.h>
+
+#include <tree/ranked/RankedTree.h>
+
+namespace tree {
+
+class GeneralAlphabet;
+
+/**
+ * \brief
+ * Tree structure represented in its natural representation. The representation is so called ranked, therefore it consists of ranked symbols. The rank of the ranked symbol needs to be compatible with unsigned integer.
+
+ * \details
+ * T = (A, C),
+ * A (Alphabet) = finite set of ranked symbols,
+ * C (Content) = tree in its natural representation
+ *
+ * \tparam SymbolType used for the symbol part of the ranked symbol
+ */
+template < class SymbolType >
+class UnorderedRankedTree final : public ext::CompareOperators < UnorderedRankedTree < SymbolType > >, public core::Components < UnorderedRankedTree < SymbolType >, ext::set < common::ranked_symbol < SymbolType > >, component::Set, GeneralAlphabet > {
+	/**
+	 * Natural representation of the tree content.
+	 */
+	ext::tree < common::ranked_symbol < SymbolType > > m_content;
+
+	/**
+	 * Checks that symbols of the tree are present in the alphabet.
+	 *
+	 * \throws TreeException when some symbols of the tree representation are not present in the alphabet
+	 *
+	 * \param data the tree in its natural representation
+	 */
+	void checkAlphabet ( const ext::tree < common::ranked_symbol < SymbolType > > & data ) const;
+
+	/**
+	 * Checks that the rank of each symbol of a tree node corresponds to the number of child nodes of that same node.
+	 *
+	 * \throws TreeException when some nodes of a tree have different number of children than the rank of their label states
+	 *
+	 * \param data the tree in its natural representation
+	 */
+	void checkArities ( const ext::tree < common::ranked_symbol < SymbolType > > & data ) const;
+
+public:
+	/**
+	 * \brief Creates a new instance of the tree with concrete alphabet and content.
+	 *
+	 * \param alphabet the initial alphabet of the tree
+	 * \param tree the initial tree in its natural representation
+	 */
+	explicit UnorderedRankedTree ( ext::set < common::ranked_symbol < SymbolType > > alphabet, ext::tree < common::ranked_symbol < SymbolType > > tree );
+
+	/**
+	 * \brief Creates a new instance of the tree based on the content, the alphabet is implicitly created from the content.
+	 *
+	 * \param tree the initial tree in its natural representation
+	 */
+	explicit UnorderedRankedTree ( ext::tree < common::ranked_symbol < SymbolType > > tree );
+
+	/**
+	 * \brief Creates a new instance of the tree based on the Ranked Tree.
+	 *
+	 * \param tree the ranked tree to use.
+	 */
+	explicit UnorderedRankedTree ( const RankedTree < SymbolType > & tree );
+
+	/**
+	 * Getter of the alphabet.
+	 *
+	 * \returns the alphabet of the tree
+	 */
+	const ext::set < common::ranked_symbol < SymbolType > > & getAlphabet ( ) const & {
+		return this->template accessComponent < GeneralAlphabet > ( ).get ( );
+	}
+
+	/**
+	 * Getter of the alphabet.
+	 *
+	 * \returns the alphabet of the tree
+	 */
+	ext::set < common::ranked_symbol < SymbolType > > && getAlphabet ( ) && {
+		return std::move ( this->template accessComponent < GeneralAlphabet > ( ).get ( ) );
+	}
+
+	/**
+	 * Adder of an alphabet symbols.
+	 *
+	 * \param symbols the new symbols to be added to the alphabet
+	 */
+	void extendAlphabet ( const ext::set < common::ranked_symbol < SymbolType > > & symbols ) {
+		this->template accessComponent < GeneralAlphabet > ( ).add ( symbols );
+	}
+
+	/**
+	 * Getter of the tree representation.
+	 *
+	 * \return the natural representation of the tree.
+	 */
+	const ext::tree < common::ranked_symbol < SymbolType > > & getContent ( ) const &;
+
+	/**
+	 * Getter of the tree representation.
+	 *
+	 * \return the natural representation of the tree.
+	 */
+	ext::tree < common::ranked_symbol < SymbolType > > && getContent ( ) &&;
+
+	/**
+	 * Setter of the representation of the tree.
+	 *
+	 * \throws TreeException in same situations as checkAlphabet and checkArities
+	 *
+	 * \param tree new representation of the tree.
+	 */
+	void setTree ( ext::tree < common::ranked_symbol < SymbolType > > tree );
+
+	/**
+	 * The actual compare method
+	 *
+	 * \param other the other instance
+	 *
+	 * \returns the actual relation between two by type same tree instances
+	 */
+	int compare ( const UnorderedRankedTree & other ) const;
+
+	/**
+	 * Print this object as raw representation to ostream.
+	 *
+	 * \param out ostream where to print
+	 * \param instance object to print
+	 *
+	 * \returns modified output stream
+	 */
+	friend std::ostream & operator << ( std::ostream & out, const UnorderedRankedTree & instance ) {
+		out << "(UnorderedRankedTree ";
+		out << "alphabet = " << instance.getAlphabet ( );
+		out << "content = " << instance.getContent ( );
+		out << ")";
+		return out;
+	}
+
+	/**
+	 * Casts this instance to as compact as possible string representation.
+	 *
+	 * \returns string representation of the object
+	 */
+	explicit operator std::string ( ) const;
+
+	/**
+	 * Hierarchical printer of the tree.
+	 *
+	 * \param os the output stream destination of the print
+	 */
+	void nicePrint ( std::ostream & os ) const;
+};
+
+template < class SymbolType >
+UnorderedRankedTree < SymbolType >::UnorderedRankedTree ( ext::set < common::ranked_symbol < SymbolType > > alphabet, ext::tree < common::ranked_symbol < SymbolType > > tree ) : core::Components < UnorderedRankedTree, ext::set < common::ranked_symbol < SymbolType > >, component::Set, GeneralAlphabet > ( std::move ( alphabet ) ), m_content ( TreeAuxiliary::sort ( std::move ( tree ) ) ) {
+	checkAlphabet ( m_content );
+	checkArities ( m_content );
+}
+
+template < class SymbolType >
+UnorderedRankedTree < SymbolType >::UnorderedRankedTree ( ext::tree < common::ranked_symbol < SymbolType > > tree ) : UnorderedRankedTree ( ext::set < common::ranked_symbol < SymbolType > > ( tree.prefix_begin ( ), tree.prefix_end ( ) ), tree ) {
+}
+
+template < class SymbolType >
+UnorderedRankedTree < SymbolType >::UnorderedRankedTree ( const RankedTree < SymbolType > & tree ) : UnorderedRankedTree ( tree.getAlphabet ( ), tree.getContent ( ) ) {
+}
+
+template < class SymbolType >
+const ext::tree < common::ranked_symbol < SymbolType > > & UnorderedRankedTree < SymbolType >::getContent ( ) const & {
+	return m_content;
+}
+
+template < class SymbolType >
+ext::tree < common::ranked_symbol < SymbolType > > && UnorderedRankedTree < SymbolType >::getContent ( ) && {
+	return std::move ( m_content );
+}
+
+template < class SymbolType >
+void UnorderedRankedTree < SymbolType >::checkAlphabet ( const ext::tree < common::ranked_symbol < SymbolType > > & data ) const {
+	ext::set < common::ranked_symbol < SymbolType > > minimalAlphabet ( data.prefix_begin ( ), data.prefix_end ( ) );
+	ext::set < common::ranked_symbol < SymbolType > > unknownSymbols;
+	std::set_difference ( minimalAlphabet.begin ( ), minimalAlphabet.end ( ), getAlphabet().begin ( ), getAlphabet().end ( ), std::inserter ( unknownSymbols, unknownSymbols.end ( ) ) );
+
+	if ( !unknownSymbols.empty ( ) )
+		throw exception::CommonException ( "Input symbols not in the alphabet." );
+}
+
+template < class SymbolType >
+void UnorderedRankedTree < SymbolType >::checkArities ( const ext::tree < common::ranked_symbol < SymbolType > > & data ) const {
+	if ( ( size_t ) data.getData ( ).getRank ( ) != data.getChildren ( ).size ( ) )
+		throw exception::CommonException ( "Invalid rank." );
+
+	for ( const ext::tree < common::ranked_symbol < SymbolType > > & child : data )
+		checkArities ( child );
+}
+
+template < class SymbolType >
+void UnorderedRankedTree < SymbolType >::setTree ( ext::tree < common::ranked_symbol < SymbolType > > tree ) {
+	checkAlphabet ( tree );
+	checkArities ( tree );
+
+	this->m_content = TreeAuxiliary::sort ( std::move ( tree ) );
+}
+
+template < class SymbolType >
+int UnorderedRankedTree < SymbolType >::compare ( const UnorderedRankedTree & other ) const {
+	auto first = ext::tie ( m_content, getAlphabet() );
+	auto second = ext::tie ( other.m_content, other.getAlphabet() );
+
+	static ext::compare < decltype ( first ) > comp;
+
+	return comp ( first, second );
+}
+
+template < class SymbolType >
+void UnorderedRankedTree < SymbolType >::nicePrint ( std::ostream & os ) const {
+	m_content.nicePrint ( os );
+}
+
+template < class SymbolType >
+UnorderedRankedTree < SymbolType >::operator std::string ( ) const {
+	std::stringstream ss;
+	ss << * this;
+	return ss.str ( );
+}
+
+} /* namespace tree */
+
+namespace core {
+
+/**
+ * Helper class specifying constraints for the tree's internal alphabet component.
+ *
+ * \tparam SymbolType used for the symbol part of the ranked symbols of the alphabet of the pattern.
+ */
+template < class SymbolType >
+class SetConstraint< tree::UnorderedRankedTree < SymbolType >, common::ranked_symbol < SymbolType >, tree::GeneralAlphabet > {
+public:
+	/**
+	 * Returns true if the symbol is still used in the tree.
+	 *
+	 * \param tree the tested tree
+	 * \param symbol the tested symbol
+	 *
+	 * \returns true if the symbol is used, false othervise
+	 */
+	static bool used ( const tree::UnorderedRankedTree < SymbolType > & tree, const common::ranked_symbol < SymbolType > & symbol ) {
+		const ext::tree < common::ranked_symbol < SymbolType > > & m_content = tree.getContent ( );
+		return std::find(m_content.prefix_begin(), m_content.prefix_end(), symbol) != m_content.prefix_end();
+	}
+
+	/**
+	 * Returns true as all symbols are possibly available to be in an alphabet.
+	 *
+	 * \param tree the tested tree
+	 * \param symbol the tested symbol
+	 *
+	 * \returns true
+	 */
+	static bool available ( const tree::UnorderedRankedTree < SymbolType > &, const common::ranked_symbol < SymbolType > & ) {
+		return true;
+	}
+
+	/**
+	 * All symbols are valid as symbols of an alphabet.
+	 *
+	 * \param tree the tested tree
+	 * \param symbol the tested symbol
+	 */
+	static void valid ( const tree::UnorderedRankedTree < SymbolType > &, const common::ranked_symbol < SymbolType > & ) {
+	}
+};
+
+/**
+ * Helper for normalisation of types specified by templates used as internal datatypes of symbols.
+ *
+ * \returns new instance of the tree with default template parameters or unmodified instance if the template parameters were already default ones
+ */
+template < class SymbolType >
+struct normalize < tree::UnorderedRankedTree < SymbolType > > {
+	static tree::UnorderedRankedTree < > eval ( tree::UnorderedRankedTree < SymbolType > && value ) {
+		ext::set < common::ranked_symbol < DefaultSymbolType > > alphabet = alphabet::SymbolNormalize::normalizeRankedAlphabet ( std::move ( value ).getAlphabet ( ) );
+		ext::tree < common::ranked_symbol < DefaultSymbolType > > content = tree::TreeNormalize::normalizeRankedTree ( std::move ( value ).getContent ( ) );
+
+		return tree::UnorderedRankedTree < > ( std::move ( alphabet ), std::move ( content ) );
+	}
+};
+
+} /* namespace core */
+
+extern template class tree::UnorderedRankedTree < >;
+
+#endif /* UNORDERED_RANKED_TREE_H_ */