Graph

来源:互联网 发布:存储过程怎么执行sql 编辑:程序博客网 时间:2024/04/30 21:10

graph

graph is an abstract data type that is meant to implement the graph and hypergraph concepts from mathematics.

Edge

An edge represents a connection between nodes. Edges can be either directed or undirected, depending on the type of graph. Edges can also have weights, which may correspond to strength of relationship or distance between edges. (For instance, if a graph represents a map, then the weights of each edge will represent the distance between two nodes.) 

Directed Graph

A directed graph is one in which edges connect nodes in only one direction.

Undirected Graph

An undirected graph is one in which edges connect nodes bidirectionally (in both directions). Node: A node, usually drawn as a circle, represents an item that can be related to other items or nodes. Nodes are sometimes referred to as vertices.


Connected

A graph is connected if from any node you can reach any other node.

Disconnected

A graph is disconnected if certain groups of nodes form an island that has no connection to the rest of the graph.


Reference

http://www.cprogramming.com/tutorial/computersciencetheory/graphtheory.html


More on graph

http://web.cecs.pdx.edu/~sheard/course/Cs163/Doc/Graphs.html