Grid Graphs
Consider a directed graph made from an orthogonal lattice of nodes. The edges are the horizontal and vertical connections between adjacent nodes. vertical directed lines are drawn and all the edges on these lines inherit that direction. Similarly, horizontal directed lines are drawn and all the edges on these lines inherit that direction.
Two nodes, and in a directed graph, are strongly connected if there is both a path, along the directed edges, from to as well as from to . Note that every node is strongly connected to itself.
A strongly connected component in a directed graph is a non-empty set of nodes satisfying the following two properties:
- All nodes in are strongly connected to each other.
- is maximal, in the sense that no node in is strongly connected to any node outside of .
There are ways of drawing the directed lines. Each way gives a directed graph . We define to be the number of strongly connected components in .
The illustration below shows a directed graph with and that consists of four different strongly connected components (indicated by the different colours).

Define to be the sum of for all possible graphs on a grid of . You are given , and .
Find giving your answer modulo .
格阵图
考虑一张基于个结点组成的格阵所构成的有向图,图中的边水平或竖直连接着相邻的结点。在格阵上可以画出条竖直的有向直线,所有落在直线上的边和相应直线的方向一致;同理,在格阵上可以画出条水平的有向直线,所有落在直线上的边和相应直线的方向也一致。
在有向图中,如果在两个结点和之间,存在一条沿着有向边由到的路径,同时也存在一条沿着有向边由到的路径,则称这两个结点是强连通的。注意每个结点和其自身都是强连通的。
有向图中的一个强连通分支是指满足以下两条性质的非空结点集:
- 中的任意两个结点之间都是强连通的。
- 是极大的,这意味着不存在之内的结点和之外的结点之间是
共有种绘制有向直线的方式,每种方式确定了一张有向图。记为中强连通分支的数目。
下图展示了、时的一张有向图,这张图有四个不同的强连通分支(用不同颜色表示)。

记为所有基于的格阵的有向图对应之和。已知,,。
求并将你的答案对取余。
Be the first person to leave a comment!