gusl: (Default)
[personal profile] gusl
Given a set L of permutations of a list, compute the maximal partial order (DAG) under which all lists in L are topological sorts. How would you do this? Can you do better than O(m n^2 k^2)? (m = number of lists in L, k = # of things in domain = the size of the elements of L)
Sounds like an ILP problem.

One idea: whenever a cycle is detected, all the elements are deemed incomparable.

(no subject)

Date: 2008-05-06 07:35 pm (UTC)
From: [identity profile] rdore.livejournal.com
Oh ok. Well suppressing log factors, I think the complexity is O(mk+k2). Make a graph on the k objects by throwing in all the consecutive pairs from all the lists. This is O(mk). Then detect all the strongly connected components - O(k2). Remove the edges of the strongly connected components - O(k2). Then take the transitive closure - I think this is O(k2) at least for a DAG, not sure.

February 2020

S M T W T F S
      1
2345678
9101112131415
16171819202122
23242526272829

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags