Re: Longest Common Subsequence in Postgres - Algorithm Challenge

From: hubert depesz lubaczewski <depesz(at)depesz(dot)com>
To: Robert James <srobertjames(at)gmail(dot)com>
Cc: Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Longest Common Subsequence in Postgres - Algorithm Challenge
Date: 2013-07-08 14:45:19
Message-ID: 20130708144518.GA13082@depesz.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, Jul 08, 2013 at 09:09:26AM -0400, Robert James wrote:
> I have two relations, where each relation has two fields, one
> indicating a name and one indicating a position. That is, each
> relation defines a sequence.
>
> I need to determine their longest common subsequence. Yes, I can do
> this by fetching all the data into Java (or any other language) and
> computing it using the standard LCS dynamic programming language. But
> I'd like to stay within Postgres. Is there any way to do this?

I'm not entirely sure I understand. Can you show us some sample data and
expected output?

Best regards,

depesz

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jeff Davis 2013-07-08 17:16:15 Re: Why is NULL = unbounded for rangetypes?
Previous Message John DeSoi 2013-07-08 14:27:41 replication stops working