图(一):基本概念

6 篇文章 0 订阅

图是一组顶点和连接这些顶点的边的集合
在图中,路径是由边顺序连接的一系列顶点。简单路径是一条没有重复顶点的路径。是一条至少含有一条边且起点和终点相同的路径。简单环是一条(除了起点和终点必须相同之外)不含有重复顶点和边的环。路径或者环的长度为其中所包含的边数。
如果从任意一个顶点都存在一条路径到达另一个任意顶点,我们称这幅图是连通图。一副非连通的图由若干连通的部分组成,它们都是其极大连通子图。
树是一幅无环连通图。互不相连的树组成的集合称为森林。连通图的生成树是它的一幅子图,它含有图中所有顶点且是一颗树。图的生成树森林是它的所有连通子图的生成树的集合。
Definition. A graph is a set of vertices and a collection of edges that each connect a pair of vertices.
Definition. A path in a graph is a sequence of vertices connected by edges. A simple path is one with no repeated vertices. A cycle is a path with at least one edge whose first and last vertices are the same. A simple cycle is a cycle with no repeated edges or vertices (except the requisite repetition of the first and last vertices). The length of a path or a cycle is its number of edges.
Definition. A graph is connected if there is a path from every vertex to every other vertex in the graph. A graph that is not connected consists of a set of connected components, which are maximal connected subgraphs.
Definition. A tree is an acyclic connected graph. A disjoint set of trees is called a forest. A spanning tree of a connected graph is a subgraph that contains all of that graph’s vertices and is a single tree. A spanning forest of a graph is the union of spanning trees of its connected components.

有向图是由一组顶点和一组有方向的边组成,每条有方向的边都连接着有序的一对顶点。
在一幅有向图中,有向路径由一些列顶点组成,对于其中的每个顶点都存在一条有向边从它指向序列中的下一个顶点。有向环为一条至少含有一条边且起点和终点相同的有向路径。简单有向环是一条(除了起点和终点必须相同外)不含有重复的顶点和边的环。路径或者环的长度即为其中所包含的边数。
如果两个顶点v和w是互相可达的,则称它们为强连通的。也就是说,既存在一条从v到w的有向路径,也存在一条从w到v的有向路径。如果一幅有向图中的任意两个顶点都是强连通的,则称这幅有向图也是强连通的。
有向无环图就是一幅不含有环的有向图。 
Definition. A directed graph (or digraph) is a set of vertices and a collection of directed edges. Each directed edge connects an ordered pair of vertices.
Definition. A directed path in a digraph is a sequence of vertices in which there is a (directed) edge pointing from each vertex in the sequence to its successor in the sequence. A directed cycle is a directed path with at least one edge whose first and last vertices are the same. A simple cycle is a cycle with no repeated edges or vertices (except the requisite repetition of the first and last vertices). The length of a path or a cycle is its number of edges.
Definition. Two vertices v and w are strongly connected if they are mutually reachable: that is, if there is a directed path from v to w and a directed path from w to v. A digraph is strongly connected if all its vertices are strongly connected to one another.
Definition. A directed acyclic graph (DAG) is a digraph with no directed cycles.

图的生成树是它的一棵含有其所有顶点的无环连通子图。一幅加权无向图的最小生成树(MST)是它的一棵权值(树中所有边的权值之和)最小的生成树。
Definition. Recall that a spanning tree of a graph is a connected subgraph with no cycles that includes all the vertices. A minimum spanning tree (MST) of an edge-weighted graph is a spanning tree whose weight (the sum of the weights of its edges) is no larger than the weight of any other spanning tree.

在一幅加权有向图中,从顶点s到顶点t的最短路径是所有从s到t的路径中权重最小者。
Definition. A shortest path from vertex s to vertex t in an edge-weighted digraph is a directed path from s to t with the property that no other such path has a lower weight.

给定一幅加权有向图和一个顶点s,以s为起点的一棵最短路径树是图的一幅子图,它包含s和从s可达的所有顶点。这棵有向树的根结点为s,树的每条路径都是有向图中的一条最短路径。
Definition. Given an edge-weighted digraph and a designated vertex s, a shortest-paths tree for a source s is a subgraph containing s and all the vertices reachable from s that forms a directed tree rooted at s such that every tree path is a shortest path in the digraph.
图的密度是指已经连接的顶点对(边)占所有可能被连接的顶点对的比例。
一幅有向无环图的拓扑排序即所有顶点的逆后序排列。
引理:一个有向图G是无回路的,当且仅当对G进行深度优先搜索时没有反向边
特使情况(anomalies)
(1)自环(self-loop):边的两个顶点(起始点、终止点)为同一个顶点。
(2)平行边(parallel edges):连接同一对顶点的边。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
UML活动是一种描述系统行为的形化工具,它主要用于描述业务流程、工作流程和操作流程等。活动由一系列活动和控制流程组成,其中活动表示系统中的操作或任务,控制流程表示这些操作或任务之间的关系。活动基本概念和组成如下: 1. 活动(Activity):表示系统中的操作或任务,通常用矩形框表示,框内写明活动的名称。 2. 控制流(Control Flow):表示活动之间的关系,通常用箭头表示,箭头从一个活动指向另一个活动,表示执行顺序。 3. 分支(Decision):表示在某个活动执行过程中,根据某个条件的不同,可能会有不同的执行路径。通常用菱形表示,菱形内写明条件。 4. 合并(Merge):表示在某个活动执行过程中,不同的执行路径会汇聚到同一个活动中。通常用菱形表示。 5. 开始(Initial):表示活动的开始,通常用一个实心圆表示。 6. 结束(Final):表示活动的结束,通常用一个实心圆表示。 7. 泳道(Partition):将活动中的活动划分为若干组,并把每一组指定给负责这组活动的业务组织,即对象。在活动中,泳道区分了负责活动的对象,它明确地表示了哪些活动是由哪些对象进行的。 下面是一个简单的活动示例,用于描述一个简单的购物流程: ```uml @startuml |客户| start :选择商品; if (库存是否充足?) then (yes) :下单; else (no) :等待补货; endif |商家| :发货; |物流公司| :派送; |客户| :签收; stop @enduml ```

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值