Description: 求图的顶点连通度算法。方法就是先对源和汇做枚举,之后对每个枚举情况,把除去源汇两点的其余所有顶点看成是容量限制为1的点,求网络的最大流,就是此点对的顶点连通度,之后对枚举的所有点对找连通度最小的当成图的连通度。
带有顶点容量限制的最大流方法:将带容量限制的顶点u拆成两个点u 和u*,原顶点u的入边为u 的入边,原顶点u的出边为u*的出边,之后在u 和u*之间连接双向边,边的容量为顶点的容量限制。-plans for the vertex connectivity algorithms. First is the method of sources and sinks so enumerated, after the enumeration of each, two sources and sinks to remove all remaining vertices as capacity constraints to a point, seeking the largest network flow, this is the apex of connectivity, followed by enumeration of all points of connectivity for the smallest of the plan as connectivity. Vertex capacity constraints with the biggest flow method : with the capacity constraints of the vertex is split into two u u and u *, the original entry point u u edge of the income side, the original point out u * u edge of the edge out after the u and u * a two-way link between the edge, while the capacity for the top point of the capacity constraints. Platform: |
Size: 1515 |
Author:吴地瓜 |
Hits:
Description: Euler 回路问题
.问题描述:
对于给定的图G 和G 中的2 个顶点v 和w,连接顶点v 和w 且经过图中每条边恰好1 次
的路径称为顶点v 和w 之间的1 条Euler 路。当v=w 时得到一条首尾相接的Euler 回路。
.编程任务:
对于给定的图G,编程计算图G 的一条Euler 回路。
.数据输入:
由文件input.txt 给出输入数据。第1 行有2 个正整数n 和m,表示给定的图G 有n 个
顶点和m 条边,顶点编号为1,2,…,n。接下来的m 行中,每行有2 个正整数u,v ,表示
图G 的一条边(u,v) 。
.结果输出:
将编程计算出的Euler 回路输出到文件output.txt 。如果不存在Euler 回路,则输出-1。-Euler circuit problem. Problem description : for a given graph G and G of two vertices v, w, connectivity and vertex v w map through which each side precisely the path to a meeting called vertices v, w between a Euler Road. When v = w be an end-to-end circuit Euler. . Programming tasks : for a given graph G, programming terms of a graph G Euler circuit. . Data input : from the document input.txt given input data. Line 1 has two positive integers n and m, to the graph G with n vertices and m edges and vertices numbered 1, 2, ..., n. Next m OK, every trip has two positive integer u, v, said of a graph G edge (u, v). . Results output : Programming will be calculated by Euler circuit output to a file output.txt. If there is no Euler circuit, the output 1. Platform: |
Size: 62019 |
Author:无翼 |
Hits:
Description: 给定一棵树T,树中每个顶点u都有一个权w(u),权可以是负数。现在要找到树T的一个连通子图使该子图的权之和最大。-given a tree T, tree each vertex u have a right to w (u), the right to be negative. Now to find a tree T connectivity graph so that the graph of the rights and the largest. Platform: |
Size: 150268 |
Author:wu |
Hits:
Description: 求图的顶点连通度算法。方法就是先对源和汇做枚举,之后对每个枚举情况,把除去源汇两点的其余所有顶点看成是容量限制为1的点,求网络的最大流,就是此点对的顶点连通度,之后对枚举的所有点对找连通度最小的当成图的连通度。
带有顶点容量限制的最大流方法:将带容量限制的顶点u拆成两个点u 和u*,原顶点u的入边为u 的入边,原顶点u的出边为u*的出边,之后在u 和u*之间连接双向边,边的容量为顶点的容量限制。-plans for the vertex connectivity algorithms. First is the method of sources and sinks so enumerated, after the enumeration of each, two sources and sinks to remove all remaining vertices as capacity constraints to a point, seeking the largest network flow, this is the apex of connectivity, followed by enumeration of all points of connectivity for the smallest of the plan as connectivity. Vertex capacity constraints with the biggest flow method : with the capacity constraints of the vertex is split into two u u and u*, the original entry point u u edge of the income side, the original point out u* u edge of the edge out after the u and u* a two-way link between the edge, while the capacity for the top point of the capacity constraints. Platform: |
Size: 1024 |
Author:吴地瓜 |
Hits:
Description: Euler 回路问题
.问题描述:
对于给定的图G 和G 中的2 个顶点v 和w,连接顶点v 和w 且经过图中每条边恰好1 次
的路径称为顶点v 和w 之间的1 条Euler 路。当v=w 时得到一条首尾相接的Euler 回路。
.编程任务:
对于给定的图G,编程计算图G 的一条Euler 回路。
.数据输入:
由文件input.txt 给出输入数据。第1 行有2 个正整数n 和m,表示给定的图G 有n 个
顶点和m 条边,顶点编号为1,2,…,n。接下来的m 行中,每行有2 个正整数u,v ,表示
图G 的一条边(u,v) 。
.结果输出:
将编程计算出的Euler 回路输出到文件output.txt 。如果不存在Euler 回路,则输出-1。-Euler circuit problem. Problem description : for a given graph G and G of two vertices v, w, connectivity and vertex v w map through which each side precisely the path to a meeting called vertices v, w between a Euler Road. When v = w be an end-to-end circuit Euler. . Programming tasks : for a given graph G, programming terms of a graph G Euler circuit. . Data input : from the document input.txt given input data. Line 1 has two positive integers n and m, to the graph G with n vertices and m edges and vertices numbered 1, 2, ..., n. Next m OK, every trip has two positive integer u, v, said of a graph G edge (u, v). . Results output : Programming will be calculated by Euler circuit output to a file output.txt. If there is no Euler circuit, the output 1. Platform: |
Size: 61440 |
Author:无翼 |
Hits:
Description: 给定一棵树T,树中每个顶点u都有一个权w(u),权可以是负数。现在要找到树T的一个连通子图使该子图的权之和最大。-given a tree T, tree each vertex u have a right to w (u), the right to be negative. Now to find a tree T connectivity graph so that the graph of the rights and the largest. Platform: |
Size: 149504 |
Author:wu |
Hits:
Description: prim算法是从连通网中的某一个顶点开始,以此作为生成树的初始状态,然后不断的将网中的其他顶点添加到生成树上,直到最后一个顶点添加到生成数上时得到最小生成树.-prim algorithm is network connectivity from a vertex to start, as a spanning tree of the initial state, and then continuing to network other vertex added to the spanning tree until the last vertex added to the generated number to be the smallest when Spanning Tree. Platform: |
Size: 8192 |
Author:陈冰晶 |
Hits:
Description: 尋找SINK。
SINK:
7 * 由一些顶点和有向边组成的一个图,如果两个顶点x,y之间有一条路连通,则称x到y是连通的。
8 * 对于所有顶点集合的一个子集,如果任意两点之间是连通的,则称为一个“强连通子集”。
9 * 一个强连通子集,如果没有任何指向其他顶点的边(各个顶点有且只有一个输出方向),则称为一个“SINK”。-Find SINK. SINK: 7* by a number of vertex and edge components to have a map, if two vertices x, y has a way connectivity between, say x to y is connected. 8* For all vertices of a subset of the collection, if any is connected between two points is called a Platform: |
Size: 65536 |
Author:詹庆锋 |
Hits:
Description: 设计一个医院选址程序。一个城市里有n个社区给定n个社区之间的交通图。若社区i与社区j之间有路可通,则将顶点i与顶点j之间用边连接,边上的权值Wij表示这条道路的长度。现打算在这n个社区中选定一个小区建一所医院,那么这间医院的所在的社区应该使这个城市的所有居民都能方便的到达(即使距离医院最远的小区到医院的路程最短)。-Design of a hospital site selection process. A city where there are n communities for a given n traffic between communities map. If the community i and community j can be a road between the pass, will be between vertex i and vertex j with edge connectivity, edge weights Wij that this path length. It is intended in the n communities selected a district build a hospital, this hospital where the community should make all residents of the city easy to reach (even if the cell farthest away from the hospital to the hospital the shortest distance) . Platform: |
Size: 2048 |
Author:九狼 |
Hits:
Description: 数据结构大作业
Choose_Best_Address_For_Hospital
寻径问题:
给定n个村庄之间的交通图,若村庄i和村庄j之间有道路,则将顶点i和顶点j用边连接,边上的权Wij 表示这条道路的长度。现在要从这n个村庄选择一个村庄建一所医院,问这所医院应建在哪个村庄,才能使离医院最远的村庄到医院的距离最短?试设计一个算法来解决该问题。
-Great job data structure Choose_Best_Address_For_Hospital routing problem: Given n traffic between villages map of the village if the village i and j between the roads, will be vertex i and vertex j with edge connectivity, the edge of the right to express this Wij The length of the road. Now select from this n-a village in the village build a hospital, and asked the hospital to be built in which the village in order to make the furthest away from the hospital' s distance from the village to the hospital the shortest? Try to design an algorithm to solve the problem. Platform: |
Size: 52224 |
Author:harlant |
Hits:
Description: 此代码是基于数据结构算法分析的代码,用到图论中的深度优先收索法来求连通分支的问题,只要给出顶点、边数和相应的边就可以求出连通分支的数目-This code is based on the analysis of the code of the data structure algorithms used in graph theory depth-first closing cable method, as long as the given vertex connectivity of the branch, the number of edges and the corresponding side you can find the number of connected components Platform: |
Size: 1024 |
Author:韦龙 |
Hits: