作者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