All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends Macros Pages
Public Types | Public Member Functions | List of all members
paal::greedy::detail::shortest_superstring< Words > Class Template Reference

class to solve shortest superstring 3.5 aproximation, using greedy algorithm: contract pair of words with largest overlap until one word stays

#include <iostream>
#include <string>
int main() {
std::vector<std::string> words({ "ba", "ab", "aa", "bb" });
std::cout << paal::greedy::shortestSuperstring(words) << std::endl;
}
More...

#include <shortest_superstring.hpp>

Public Types

typedef range_to_elem_t< Words > Word
 
typedef range_to_elem_t< Word > Letter
 

Public Member Functions

 shortest_superstring (const Words &words)
 
Word get_solution ()
 return word contains all words as subwords, of lenght at most 3.5 larger than shortest superstring. More...
 

Detailed Description

template<typename Words>
class paal::greedy::detail::shortest_superstring< Words >

class to solve shortest superstring 3.5 aproximation, using greedy algorithm: contract pair of words with largest overlap until one word stays

#include <iostream>
#include <string>
int main() {
std::vector<std::string> words({ "ba", "ab", "aa", "bb" });
std::cout << paal::greedy::shortestSuperstring(words) << std::endl;
}

example file is shortest_superstring_example.cpp

Template Parameters
Words

Definition at line 48 of file shortest_superstring.hpp.

Member Function Documentation

template<typename Words>
Word paal::greedy::detail::shortest_superstring< Words >::get_solution ( )
inline

return word contains all words as subwords, of lenght at most 3.5 larger than shortest superstring.

#include <iostream>
#include <string>
int main() {
std::vector<std::string> words({ "ba", "ab", "aa", "bb" });
std::cout << paal::greedy::shortestSuperstring(words) << std::endl;
}

example file is shortest_superstring_example.cpp

Definition at line 82 of file shortest_superstring.hpp.


The documentation for this class was generated from the following file: