平面グラフで三角形を数える時間の複雑さ


16

一般的なグラフでの三角形のカウントは、時間で簡単に行うことができ、はるかに高速に行うのは難しいと思います(参考文献を歓迎します)。平面グラフはどうですか?次の簡単な手順は、時間で実行できることを示してい。私の質問は2つあります。O(n3)O(nlogn)

  • この手順のリファレンスは何ですか?
  • 時間を線形にすることはできますか?

リプトン・タージャンの平面分離定理のアルゴリズムによる証明から、グラフのサイズに時間的に比例して、グラフの頂点を3つのセット分割し、1つの端点を持つエッジがないようにすることができます。とのもう一方、サイズは制限され両方サイズは頂点の数のに制限されます。グラフ内の三角形は、完全に内にか、完全に内にか、少なくとも1 つの頂点をからの他の2つの頂点とともに使用するか、A,B,SABSO(n)A,B23ABSASBS. Thus it suffices to count the number of triangles in the graph on S and the neighbours of S in A (and similarly for B). Notice that S and its A-neighbours induce a k-outer planar graph (the said graph is a subgraph of a planar graph of diameter 4). Thus counting the number of triangles in such a graph can be done directly by dynamic programming or by an application of Courcelle's theorem (I know for sure that such a counting version exists in the Logspace world by Elberfeld et al and am guessing that it also exists in the linear time world) since forming an undirected triangle is an MSO1 property and since a bounded width tree decomposition is easy to obtain from an embedded k-outer planar graph.

Thus we have reduced the problem to a pair of problems which are each a constant fraction smaller at the expense of a linear time procedure.

Notice that the procedure can be extended to find the count of the number of instances of any fixed connected graph inside an input graph in O(nlogn) time.


6
You can count triangles in general graphs by taking the adjacency matrix A and computing tr(A3)/6. This takes nω time, where ω<2.373 is the matrix multiplication exponent.
Ryan Williams

@RyanWilliams You are correct, of course! I will update the question.
SamiD

回答:



19

Although Bart Jansen's answer solves the general case of subgraph counting, the problem of counting (or listing) all triangles in a planar graph (or more generally any graph of bounded arboricity) has been known to be linear time for much longer. See

C. Papadimitriou and M. Yannakakis, The clique problem for planar graphs, Inform. Proc. Letters 13 (1981), pp. 131–133.

and

N. Chiba and T.Nishizeki, Arboricity and subgraph listing algorithms, SIAM J. Comput. 14 (1985), pp. 210–223.

弊社のサイトを使用することにより、あなたは弊社のクッキーポリシーおよびプライバシーポリシーを読み、理解したものとみなされます。
Licensed under cc by-sa 3.0 with attribution required.