0

An intransitive set can have members A B and C where A > B > C but C > A. Such a set might be photos ordered by a person's preference.

I can relatively easily find algorithms for finding the maximum of a transitive set with minimal work, and even for sorting an intransitive set, but it's hard to see how to combine the two.

Is there a known solution for this problem?

bukzor
  • 37,539
  • 11
  • 77
  • 111
  • 1
    Never mind an algorithm; how does one even _define_ the maximum? In particular, what's the maximum of the example set you posted? It seems completely circular in `A`, `B`, and `C`. – Ted Hopp May 08 '13 at 22:05
  • You might be interested in reading about partially ordered sets, and Pareto Optimum. Or you might give some more details what you want to solve with sorting. If you have multiple numerical criteria, then multidimensional optimization will help (removing dominated elements etc.) – flaschenpost May 08 '13 at 22:08
  • 1
    there cannot be one maximum in an intransitive set, in fact, in the example you just provided, there is no maximum at all... – Nir Alfasi May 08 '13 at 22:16
  • A partially ordered set admits multiple valid topological sorts. The given example does not even have one. – chepner May 08 '13 at 23:21

1 Answers1

0

What you have is basically a preorder, which can be represented by a directed graph. Since it's not acylcic, there isn't a unique sort. But you can perform a depth first traversal, which will give you the topological ordering of some subforest of the graph.

You can also find the strongly connected components through various algorithms (Tarjan's is my favorite).

Antimony
  • 37,781
  • 10
  • 100
  • 107
  • You're assuming that the entire graph is available. Finding each edge of the graph has a cost which should be minimized. Also, not every edge in the graph must be known in order to determine a topological ordering. Given these constraints, I think this is a different problem. – bukzor May 09 '13 at 22:41