welcome: please sign in
location: Diff for "FinalProblemDescriptions/PermutationPatternMatching"
Differences between revisions 3 and 4
Revision 3 as of 2012-11-09 17:36:35
Size: 1658
Comment: Fix
Revision 4 as of 2012-11-11 21:16:29
Size: 1687
Comment: Format of predicats added
Deletions are marked like this. Additions are marked like this.
Line 15: Line 15:
The permutations T and P are encoded as binary predicates, e.g. T=132
is encoded as t(1,1). t(2,3). t(3,2). Additionally, patternlength/1
describes the length of the pattern P. The output predicate solution/2
contains an encoding of the matching of P into T (if it exists).

Random instances can be easily generated for this problem.
Line 29: Line 23:
The permutations T and P are encoded as binary predicates, e.g. T=132
is encoded as {{{t(1,1).}}} {{{t(2,3).}}} {{{t(3,2).}}} Additionally, {{{patternlength/1}}}
describes the length of the pattern P.
Line 32: Line 28:
The output predicate {{{solution/2}}}
contains an encoding of the matching of P into T (if it exists).
Line 39: Line 37:
Line 46: Line 43:

Random instances can be easily generated for this problem.

Permutation Pattern Matching

Problem Description

Permutation Pattern Matching (PPM) is an NP-complete pattern matching problem. Given a permutation T (the text) and a permutation P (the pattern) the question is whether there exists a matching of P into T. A matching is a subsequence of T that has the same relative order as P. For example the permutation T = 53142 (written in one-line representation) contains the pattern 231, since the subsequence 342 of T is order-isomorphic to 231 (i.e. the smallest element is in the third position, the second smallest in the first position and the largest in the second position).

Predicates

  • Input: t/2, p/2, patternlength/1

  • Output: solution/2

Input format

The permutations T and P are encoded as binary predicates, e.g. T=132 is encoded as t(1,1). t(2,3). t(3,2). Additionally, patternlength/1 describes the length of the pattern P.

Output format

The output predicate solution/2 contains an encoding of the matching of P into T (if it exists).

Example(s)

In this instance we are given the permutation 53142 as text and 231 as the pattern. The only subsequence that matches the text is 342.

Thus, the output of the solver should look like:  solution(3,2) solution(2,4) solution(1,3) 

Problem Peculiarities

Type: Search Competition: Both

Random instances can be easily generated for this problem.

Notes and Updates

Author(s)

  • Author: Andreas Pfandler, Martin Lackner
    • Affiliation: DBAI, Vienna University of Technology, Austria

ASP Competition 2013: FinalProblemDescriptions/PermutationPatternMatching (last edited 2013-03-22 08:01:13 by GiovambattistaIanni)