数据结构之图- 图的表示方法(6)

Graphs is composed by vertices and edges. We can look at Internet as a graph, which webpage are vertices and hyperlinks are edges.


Why doesn't the Java Collections API include a Graph implementation?

I don’t know why there is no graph library within the JDK , but I guess Sun decided to leave this to developers, since most applications that require graphs also require very unique implementations.  Also as graphs can have so many different forms and flavours with wildly different characteristics, a general Graph might not turn out to be very useful. But we can use Graph libraries like:JGraphT

0 Graph Types

1) Unconnected graph and connected graph(非连通图和连通图)


2) undirected graph and directed graph(无向图和有向图)

3) graph with cycles and graph without cycles(有环图和无环图)

graph with cycles:  a path that ends up where it started. Like the following figure, the path B-C-D-B forms a cycle. (Notice that A-B-C-A is not a cycle because you can’t go from C to A.). 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值