作者DiLegend (JOU)
看板Grad-ProbAsk
标题[理工] 台大电机98 资结第12题
时间Tue Jan 31 20:42:59 2012
Any undirected graph with n nodes and n-1 edges,
where n>=1, is a tree
找到的答案是说false
但想半天想不出来是图长怎样会出错
Note:
Graphs
A graph does not contain self-circular edges,
e.g.,(u,u),nor multiple edges between two nodes,
i.e., at most one entry (u,v) in E for each distinct u and v
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 140.112.106.241
1F:→ love5566188:若graph为unconnected有两个components其一为4个点且 01/31 22:07
2F:→ love5566188:四个边有cycle另一为孤立点则 |E|=|V|-1 但不为tree 01/31 22:08
3F:推 bbhands:加上connected的条件才会对 02/01 00:54
4F:推 dunkjames:因单独一个点也能视为为无相图 所以可以画出: 02/01 01:01
5F:→ dunkjames:●一● 02/01 01:02
6F:→ dunkjames: \ / 02/01 01:03
7F:→ dunkjames: ● ● 02/01 01:03
8F:→ dunkjames: 02/01 01:03
9F:→ dunkjames:所以N=4 E=3 可是因为无Connected 所以不是tree 同3f 02/01 01:04
10F:→ DiLegend:原来如此 02/01 01:27