POJ 3522 Slim Span(最小差值生成树)

该博客介绍了一个求解图的最小差值生成树问题,给出了一种通过排序边的权重并进行枚举的方法来找到最瘦的生成树,使得树中最大权重边和最小权重边的差值最小。博客提供了输入输出示例,并讨论了算法思路。
摘要由CSDN通过智能技术生成

Slim Span

Description

Given an undirected weighted graph G, you should find one of spanning trees specified as follows.

The graph G is an ordered pair (VE), where V is a set of vertices { v1v2, …, vn} and E is a set of undirected edges { e1e2, …, em}. Each edge e ∈ E has its weight w(e).

A spanning tree T is a tree (a connected subgraph without cycles) which connects all the n vertices with n − 1 edges. The slimness of a spanning tree T is defined as the difference between the largest weight and the smallest weight among the n − 1 edges of T.


Figure 5: A graph  G and the weights of the edges

For example, a graph G in Figure 5(a) has four vertices { v1v

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值