| 第181行: |
第181行: |
| | A similar reinterpretation of adjacency matrices may be used to show a one-to-one correspondence between directed graphs (on a given number of labeled vertices, allowing self-loops) and balanced bipartite graphs, with the same number of vertices on both sides of the bipartition. For, the adjacency matrix of a directed graph with vertices can be any (0,1) matrix of size <math>n\times n</math>, which can then be reinterpreted as the adjacency matrix of a bipartite graph with vertices on each side of its bipartition. | | A similar reinterpretation of adjacency matrices may be used to show a one-to-one correspondence between directed graphs (on a given number of labeled vertices, allowing self-loops) and balanced bipartite graphs, with the same number of vertices on both sides of the bipartition. For, the adjacency matrix of a directed graph with vertices can be any (0,1) matrix of size <math>n\times n</math>, which can then be reinterpreted as the adjacency matrix of a bipartite graph with vertices on each side of its bipartition. |
| | | | |
| − | 关于邻接矩阵adjacency matrices的另一个相似解释可以被用于展示有向图和均衡二分图(二分子集顶点数相等)之间的一一对应关系(在给定数量的标记顶点上,允许自循环)。例如,具有n个顶点的有向图的邻接矩阵可以是大小为nxn的任何(0,1)矩阵,然后可以将其重新解释为:具有相同顶点数n的同边子集的二分图的邻接矩阵。通过这种构建方式,二分图可以被解释为是一个有向图的二分双重覆盖bipartite double cover。
| + | 关于'''<font color="#ff8000"> 邻接矩阵adjacency matrices</font>'''的另一个相似解释可以被用于展示有向图和均衡二分图(二分子集顶点数相等)之间的一一对应关系(在给定数量的标记顶点上,允许自循环)。例如,具有n个顶点的有向图的邻接矩阵可以是大小为nxn的任何(0,1)矩阵,然后可以将其重新解释为:具有相同顶点数n的同边子集的二分图的邻接矩阵。通过这种构建方式,二分图可以被解释为是一个有向图的'''<font color="#ff8000"> 二分双重覆盖bipartite double cover</font>'''。 |
| | | | |
| | | | |
| 第192行: |
第192行: |
| | It is possible to test whether a graph is bipartite, and to return either a two-coloring (if it is bipartite) or an odd cycle (if it is not) in linear time, using depth-first search. The main idea is to assign to each vertex the color that differs from the color of its parent in the depth-first search forest, assigning colors in a preorder traversal of the depth-first-search forest. This will necessarily provide a two-coloring of the spanning forest consisting of the edges connecting vertices to their parents, but it may not properly color some of the non-forest edges. In a depth-first search forest, one of the two endpoints of every non-forest edge is an ancestor of the other endpoint, and when the depth first search discovers an edge of this type it should check that these two vertices have different colors. If they do not, then the path in the forest from ancestor to descendant, together with the miscolored edge, form an odd cycle, which is returned from the algorithm together with the result that the graph is not bipartite. However, if the algorithm terminates without detecting an odd cycle of this type, then every edge must be properly colored, and the algorithm returns the coloring together with the result that the graph is bipartite. | | It is possible to test whether a graph is bipartite, and to return either a two-coloring (if it is bipartite) or an odd cycle (if it is not) in linear time, using depth-first search. The main idea is to assign to each vertex the color that differs from the color of its parent in the depth-first search forest, assigning colors in a preorder traversal of the depth-first-search forest. This will necessarily provide a two-coloring of the spanning forest consisting of the edges connecting vertices to their parents, but it may not properly color some of the non-forest edges. In a depth-first search forest, one of the two endpoints of every non-forest edge is an ancestor of the other endpoint, and when the depth first search discovers an edge of this type it should check that these two vertices have different colors. If they do not, then the path in the forest from ancestor to descendant, together with the miscolored edge, form an odd cycle, which is returned from the algorithm together with the result that the graph is not bipartite. However, if the algorithm terminates without detecting an odd cycle of this type, then every edge must be properly colored, and the algorithm returns the coloring together with the result that the graph is bipartite. |
| | | | |
| − | 可以使用深度优先搜索Depth-first search来测试图是否为二分图,并在线性时间内返回双色(如果是二分图)或奇数环(如果不是二分图)。其方法的主要思想是为每个顶点分配与深度优先搜索林Depth-first search forest中其父级颜色不同的颜色,并在其中进行遍历。这必定会为生成森林spanning forest提供两种颜色,包括将顶点连接到其父级的边。不过它可能无法为非森林边正确着色。在深度优先搜索林中,每个非林边缘的两个顶点之一是另一个顶点的祖先,并且当深度优先搜索发现这种类型的边时,应检查这两个顶点是否具有不同的颜色。如果不是,则森林中从祖先到后代的路径与颜色不同的边一起会形成一个奇数环,该奇数环会从算法中返回,并输出非二分图的结果。但是,如果算法在未检测到此类奇数环的情况下终止,则必须对每个边进行适当的着色,并返回双色以及该图形为二分图的结果。
| + | 可以使用'''<font color="#ff8000"> 深度优先搜索Depth-first search</font>'''来测试图是否为二分图,并在线性时间内返回双色(如果是二分图)或奇数环(如果不是二分图)。其方法的主要思想是为每个顶点分配与'''<font color="#ff8000"> 深度优先搜索林Depth-first search forest</font>'''中其父级颜色不同的颜色,并在其中进行遍历。这必定会为'''<font color="#ff8000"> 生成森林spanning forest</font>'''提供两种颜色,包括将顶点连接到其父级的边。不过它可能无法为非森林边正确着色。在深度优先搜索林中,每个非林边缘的两个顶点之一是另一个顶点的祖先,并且当深度优先搜索发现这种类型的边时,应检查这两个顶点是否具有不同的颜色。如果不是,则森林中从祖先到后代的路径与颜色不同的边一起会形成一个奇数环,该奇数环会从算法中返回,并输出非二分图的结果。但是,如果算法在未检测到此类奇数环的情况下终止,则必须对每个边进行适当的着色,并返回双色以及该图形为二分图的结果。 |
| | | | |
| | | | |
| 第200行: |
第200行: |
| | Alternatively, a similar procedure may be used with breadth-first search in place of depth-first search. Again, each node is given the opposite color to its parent in the search forest, in breadth-first order. If, when a vertex is colored, there exists an edge connecting it to a previously-colored vertex with the same color, then this edge together with the paths in the breadth-first search forest connecting its two endpoints to their lowest common ancestor forms an odd cycle. If the algorithm terminates without finding an odd cycle in this way, then it must have found a proper coloring, and can safely conclude that the graph is bipartite. | | Alternatively, a similar procedure may be used with breadth-first search in place of depth-first search. Again, each node is given the opposite color to its parent in the search forest, in breadth-first order. If, when a vertex is colored, there exists an edge connecting it to a previously-colored vertex with the same color, then this edge together with the paths in the breadth-first search forest connecting its two endpoints to their lowest common ancestor forms an odd cycle. If the algorithm terminates without finding an odd cycle in this way, then it must have found a proper coloring, and can safely conclude that the graph is bipartite. |
| | | | |
| − | 又或者,可以使用广度优先搜索Breadth-first search来替代深度优先搜索进行检测。同样,在搜索林中,以广度优先的顺序为每个节点赋予与父级节点相反的颜色。如果在着色某个顶点时存在一条边,其连接了与先前着色的顶点相同的颜色。然后这条边沿着以广度优先搜索林中的路径,将其两个端点与其最低共有祖先lowest common ancestor相连,形成一条奇数环。当然,如果该算法最终没找到奇数环且终止,那么它肯定已经找到了正确的着色,可以安全返回并得出该图是二分图的结论。
| + | 又或者,可以使用'''<font color="#ff8000"> 广度优先搜索Breadth-first search</font>'''来替代深度优先搜索进行检测。同样,在搜索林中,以广度优先的顺序为每个节点赋予与父级节点相反的颜色。如果在着色某个顶点时存在一条边,其连接了与先前着色的顶点相同的颜色。然后这条边沿着以广度优先搜索林中的路径,将其两个端点与其'''<font color="#ff8000"> 最低共有祖先lowest common ancestor</font>'''相连,形成一条奇数环。当然,如果该算法最终没找到奇数环且终止,那么它肯定已经找到了正确的着色,可以安全返回并得出该图是二分图的结论。 |
| | | | |
| | | | |
| 第208行: |
第208行: |
| | For the intersection graphs of <math>n</math> line segments or other simple shapes in the Euclidean plane, it is possible to test whether the graph is bipartite and return either a two-coloring or an odd cycle in time <math>O(n\log n)</math>, even though the graph itself may have up to <math>O(n^2)</math> edges. | | For the intersection graphs of <math>n</math> line segments or other simple shapes in the Euclidean plane, it is possible to test whether the graph is bipartite and return either a two-coloring or an odd cycle in time <math>O(n\log n)</math>, even though the graph itself may have up to <math>O(n^2)</math> edges. |
| | | | |
| − | 对于n个线段的相交图或欧几里得平面Euclidean plane中的其他简单形状图,即使图本身可能具有多达O(N2)个边缘,也可以测试其是否而二分图,并在时间O(n lon n)中返回双色(判定为二分图)或奇数环(判定为非二分图)。
| + | 对于n个线段的相交图或'''<font color="#ff8000"> 欧几里得平面Euclidean plane</font>'''中的其他简单形状图,即使图本身可能具有多达O(N2)个边缘,也可以测试其是否而二分图,并在时间O(n lon n)中返回双色(判定为二分图)或奇数环(判定为非二分图)。 |
| | | | |
| | | | |
| 第218行: |
第218行: |
| | Odd cycle transversal is an NP-complete algorithmic problem that asks, given a graph G = (V,E) and a number k, whether there exists a set of k vertices whose removal from G would cause the resulting graph to be bipartite.[27] The problem is fixed-parameter tractable, meaning that there is an algorithm whose running time can be bounded by a polynomial function of the size of the graph multiplied by a larger function of k.[28] The name odd cycle transversal comes from the fact that a graph is bipartite if and only if it has no odd cycles. Hence, to delete vertices from a graph in order to obtain a bipartite graph, one needs to "hit all odd cycle", or find a so-called odd cycle transversal set. In the illustration, every odd cycle in the graph contains the blue (the bottommost) vertices, so removing those vertices kills all odd cycles and leaves a bipartite graph. | | Odd cycle transversal is an NP-complete algorithmic problem that asks, given a graph G = (V,E) and a number k, whether there exists a set of k vertices whose removal from G would cause the resulting graph to be bipartite.[27] The problem is fixed-parameter tractable, meaning that there is an algorithm whose running time can be bounded by a polynomial function of the size of the graph multiplied by a larger function of k.[28] The name odd cycle transversal comes from the fact that a graph is bipartite if and only if it has no odd cycles. Hence, to delete vertices from a graph in order to obtain a bipartite graph, one needs to "hit all odd cycle", or find a so-called odd cycle transversal set. In the illustration, every odd cycle in the graph contains the blue (the bottommost) vertices, so removing those vertices kills all odd cycles and leaves a bipartite graph. |
| | | | |
| − | 奇数循环遍历是一个NP完全算法问题NP-complete algorithmic problem(因不能用多项式算法而使问题无法解决的),在给定图形G =(V,E)和数字k的情况下,询问是否存在一组k个顶点,将其从G移除会导致生成为二分图。这个问题是固定参数可解的fixed-parameter tractable,这意味着存在一种算法,其运行时间可以由图形大小的多项式函数乘以增大系数k来确定。奇数循环遍历的名称源于:当且仅当图没有奇数环时,该图是二分图。因此,为了从图中删除顶点来获得二分图,就需要“命中所有奇数环”或找到所谓的技术循环遍历集合。例如在图示中,图中的每个奇数环都包含蓝色(最底部)顶点,因此删除这些顶点就相当于删除了所有奇数环并留下一个二分图。
| + | 奇数循环遍历是一个'''<font color="#ff8000"> NP完全算法问题NP-complete algorithmic problem</font>'''(因不能用多项式算法而使问题无法解决的),在给定图形G =(V,E)和数字k的情况下,询问是否存在一组k个顶点,将其从G移除会导致生成为二分图。这个问题是'''<font color="#ff8000"> 固定参数可解fixed-parameter tractable</font>'''的,这意味着存在一种算法,其运行时间可以由图形大小的多项式函数乘以增大系数k来确定。奇数循环遍历的名称源于:当且仅当图没有奇数环时,该图是二分图。因此,为了从图中删除顶点来获得二分图,就需要“命中所有奇数环”或找到所谓的技术循环遍历集合。例如在图示中,图中的每个奇数环都包含蓝色(最底部)顶点,因此删除这些顶点就相当于删除了所有奇数环并留下一个二分图。 |
| | | | |
| | | | |
| 第226行: |
第226行: |
| | The edge bipartization problem is the algorithmic problem of deleting as few edges as possible to make a graph bipartite and is also an important problem in graph modification algorithmics. This problem is also fixed-parameter tractable, and can be solved in time, where k is the number of edges to delete and m is the number of edges in the input graph. | | The edge bipartization problem is the algorithmic problem of deleting as few edges as possible to make a graph bipartite and is also an important problem in graph modification algorithmics. This problem is also fixed-parameter tractable, and can be solved in time, where k is the number of edges to delete and m is the number of edges in the input graph. |
| | | | |
| − | 边二分化问题Edge bipartization problem是删除尽可能少的边以使其成为二分图的问题,也是图修改算法中的重要问题。此问题同样是固定参数可解的,可以在时间O(2k m2)内解决,其中k是要删除的边数,m是输入图中的边数。 | + | '''<font color="#ff8000"> 边二分化问题Edge bipartization problem</font>'''是删除尽可能少的边以使其成为二分图的问题,也是图修改算法中的重要问题。此问题同样是固定参数可解的,可以在时间O(2k m2)内解决,其中k是要删除的边数,m是输入图中的边数。 |
| | | | |
| | | | |
| 第238行: |
第238行: |
| | A matching in a graph is a subset of its edges, no two of which share an endpoint. Polynomial time algorithms are known for many algorithmic problems on matchings, including maximum matching (finding a matching that uses as many edges as possible), maximum weight matching, and stable marriage.In many cases, matching problems are simpler to solve on bipartite graphs than on non-bipartite graphs,[31] and many matching algorithms such as the Hopcroft–Karp algorithm for maximum cardinality matching[32] work correctly only on bipartite inputs. | | A matching in a graph is a subset of its edges, no two of which share an endpoint. Polynomial time algorithms are known for many algorithmic problems on matchings, including maximum matching (finding a matching that uses as many edges as possible), maximum weight matching, and stable marriage.In many cases, matching problems are simpler to solve on bipartite graphs than on non-bipartite graphs,[31] and many matching algorithms such as the Hopcroft–Karp algorithm for maximum cardinality matching[32] work correctly only on bipartite inputs. |
| | | | |
| − | 一个图中的匹配是其边集的一个子集,其中任意两个边均不共享一个端点。多项式时间算法Polynomial time algorithms素以解决很多关于匹配的算法问题而得名,包括最大匹配maximum matching(查找使用尽可能多的边的匹配),最大权重匹配maximum weight matching和稳定婚姻问题stable marriage。在许多情况下,与非二分图相比,二分图上的匹配问题更容易解决,并且许多匹配算法(例如用于最大基数匹配的Hopcroft-Karp算法)仅在二分图输入的时候才能正确运行。
| + | 一个图中的匹配是其边集的一个子集,其中任意两个边均不共享一个端点。'''<font color="#ff8000"> 多项式时间算法Polynomial time algorithms</font>'''素以解决很多关于匹配的算法问题而得名,包括'''<font color="#ff8000"> 最大匹配maximum matching</font>'''(查找使用尽可能多的边的匹配),'''<font color="#ff8000"> 最大权重匹配maximum weight matching</font>'''和'''<font color="#ff8000"> 稳定婚姻问题stable marriage</font>'''。在许多情况下,与非二分图相比,二分图上的匹配问题更容易解决,并且许多匹配算法(例如用于最大基数匹配的'''<font color="#ff8000"> Hopcroft-Karp算法</font>''')仅在二分图输入的时候才能正确运行。 |
| | | | |
| | | | |
| 第246行: |
第246行: |
| | As a simple example, suppose that a set <math>P</math> of people are all seeking jobs from among a set of <math>J</math> jobs, with not all people suitable for all jobs. This situation can be modeled as a bipartite graph <math>(P,J,E)</math> where an edge connects each job-seeker with each suitable job. A perfect matching describes a way of simultaneously satisfying all job-seekers and filling all jobs; Hall's marriage theorem provides a characterization of the bipartite graphs which allow perfect matchings. The National Resident Matching Program applies graph matching methods to solve this problem for U.S. medical student job-seekers and hospital residency jobs. | | As a simple example, suppose that a set <math>P</math> of people are all seeking jobs from among a set of <math>J</math> jobs, with not all people suitable for all jobs. This situation can be modeled as a bipartite graph <math>(P,J,E)</math> where an edge connects each job-seeker with each suitable job. A perfect matching describes a way of simultaneously satisfying all job-seekers and filling all jobs; Hall's marriage theorem provides a characterization of the bipartite graphs which allow perfect matchings. The National Resident Matching Program applies graph matching methods to solve this problem for U.S. medical student job-seekers and hospital residency jobs. |
| | | | |
| − | 举一个简单的例子,假设一组P的所有人都在一组J的职位中寻找工作,但并不是所有人都适合所有职位。可以将这种情况建模为一个二分图(P,J,E),其中当每个求职者找到其合适的工作时产生的关系就作为连边。一个完美的匹配描述的是所有求职者同时找到所有工作的情况;霍尔的婚姻定理Hall's marriage theorem阐述的就是二分图允许完美匹配的特征。美国国民住院医师匹配项目采用的就是图形匹配法来解决美国医学生求职者和医院实习工作的匹配问题。
| + | 举一个简单的例子,假设一组P的所有人都在一组J的职位中寻找工作,但并不是所有人都适合所有职位。可以将这种情况建模为一个二分图(P,J,E),其中当每个求职者找到其合适的工作时产生的关系就作为连边。一个完美的匹配描述的是所有求职者同时找到所有工作的情况;'''<font color="#ff8000"> 霍尔的婚姻定理Hall's marriage theorem</font>'''阐述的就是二分图允许完美匹配的特征。美国国民住院医师匹配项目采用的就是图形匹配法来解决美国医学生求职者和医院实习工作的匹配问题。 |
| | | | |
| | | | |
| 第254行: |
第254行: |
| | The Dulmage–Mendelsohn decomposition is a structural decomposition of bipartite graphs that is useful in finding maximum matchings. | | The Dulmage–Mendelsohn decomposition is a structural decomposition of bipartite graphs that is useful in finding maximum matchings. |
| | | | |
| − | Dulmage–Mendelsohn 分解是二分图的结构分解,可用于寻找最大匹配。 | + | '''<font color="#ff8000"> Dulmage–Mendelsohn 分解</font>'''是二分图的结构分解,可用于寻找最大匹配。 |
| | | | |
| | == Additional applications 其他应用 == | | == Additional applications 其他应用 == |
| 第262行: |
第262行: |
| | Bipartite graphs are extensively used in modern coding theory, especially to decode codewords received from the channel. Factor graphs and Tanner graphs are examples of this. A Tanner graph is a bipartite graph in which the vertices on one side of the bipartition represent digits of a codeword, and the vertices on the other side represent combinations of digits that are expected to sum to zero in a codeword without errors. | | Bipartite graphs are extensively used in modern coding theory, especially to decode codewords received from the channel. Factor graphs and Tanner graphs are examples of this. A Tanner graph is a bipartite graph in which the vertices on one side of the bipartition represent digits of a codeword, and the vertices on the other side represent combinations of digits that are expected to sum to zero in a codeword without errors. |
| | | | |
| − | 二分图在现代编码理论中被广泛使用,尤其是对从通道接收到的密码进行解码。例如因子图Factor graphs和坦纳图Tanner graphs。Tanner图是二分图,其中二分的一侧顶点表示一个密码数字,另一侧顶点表示一个数字的组合,这些数字的总和期望为零且不存在误差。因子图与置信网络密切相关,用于LDPC和Turbo码的概率解码。
| + | 二分图在现代编码理论中被广泛使用,尤其是对从通道接收到的密码进行解码。例如'''<font color="#ff8000"> 因子图Factor graphs</font>'''和'''<font color="#ff8000"> 坦纳图Tanner graphs</font>'''。Tanner图是二分图,其中二分的一侧顶点表示一个密码数字,另一侧顶点表示一个数字的组合,这些数字的总和期望为零且不存在误差。因子图与置信网络密切相关,用于LDPC和Turbo码的概率解码。 |
| | | | |
| | | | |
| 第270行: |
第270行: |
| | In computer science, a Petri net is a mathematical modeling tool used in analysis and simulations of concurrent systems. A system is modeled as a bipartite directed graph with two sets of nodes: A set of "place" nodes that contain resources, and a set of "event" nodes which generate and/or consume resources. There are additional constraints on the nodes and edges that constrain the behavior of the system. Petri nets utilize the properties of bipartite directed graphs and other properties to allow mathematical proofs of the behavior of systems while also allowing easy implementation of simulations of the system. | | In computer science, a Petri net is a mathematical modeling tool used in analysis and simulations of concurrent systems. A system is modeled as a bipartite directed graph with two sets of nodes: A set of "place" nodes that contain resources, and a set of "event" nodes which generate and/or consume resources. There are additional constraints on the nodes and edges that constrain the behavior of the system. Petri nets utilize the properties of bipartite directed graphs and other properties to allow mathematical proofs of the behavior of systems while also allowing easy implementation of simulations of the system. |
| | | | |
| − | 在计算机科学中,Petri网是用于分析和模拟并发系统的数学建模工具。该系统被建模为具有两组点集的二分有向图:一组“库所”点集用于容纳资源,以及一组“事件”点集用于生成和(或)消耗资源。他们通过约束节点和连边的传递来进一步限制系统的行为。Petri网利用二分有向图的属性和其他属性来允许对系统行为进行数学证明,同时还可以轻松实现系统仿真。
| + | 在计算机科学中,'''<font color="#ff8000"> Petri网</font>'''是用于分析和模拟并发系统的数学建模工具。该系统被建模为具有两组点集的二分有向图:一组“库所”点集用于容纳资源,以及一组“事件”点集用于生成和(或)消耗资源。他们通过约束节点和连边的传递来进一步限制系统的行为。Petri网利用二分有向图的属性和其他属性来允许对系统行为进行数学证明,同时还可以轻松实现系统仿真。 |
| | | | |
| | | | |
| 第278行: |
第278行: |
| | In projective geometry, Levi graphs are a form of bipartite graph used to model the incidences between points and lines in a configuration. Corresponding to the geometric property of points and lines that every two lines meet in at most one point and every two points be connected with a single line, Levi graphs necessarily do not contain any cycles of length four, so their girth must be six or more. | | In projective geometry, Levi graphs are a form of bipartite graph used to model the incidences between points and lines in a configuration. Corresponding to the geometric property of points and lines that every two lines meet in at most one point and every two points be connected with a single line, Levi graphs necessarily do not contain any cycles of length four, so their girth must be six or more. |
| | | | |
| − | 在射影几何中,Levi图是二分图的一种形式,用于对配置点和线之间的入射进行建模。对应于点和线的几何特性,即每两条线最多相交一个点,并且每两个点都由一条线连接,因此Levi图不一定包含任何长度为4的环,进而其周长必须为6或更大。
| + | 在射影几何中,'''<font color="#ff8000"> Levi图</font>'''是二分图的一种形式,用于对配置点和线之间的入射进行建模。对应于点和线的几何特性,即每两条线最多相交一个点,并且每两个点都由一条线连接,因此Levi图不一定包含任何长度为4的环,进而其周长必须为6或更大。 |
| | | | |
| | == See also 其他参考资料 == | | == See also 其他参考资料 == |