第32行: |
第32行: |
| A graph data structure may also associate to each edge some edge value, such as a symbolic label or a numeric attribute (cost, capacity, length, etc.). | | A graph data structure may also associate to each edge some edge value, such as a symbolic label or a numeric attribute (cost, capacity, length, etc.). |
| | | |
− | 图形数据结构还可以为每个边关联一些边值,如符号标签或数字属性(成本、容量、长度等)。). | + | 图形数据结构还可以为每个边关联一些边值,如符号标签或数字属性(成本、容量、长度等)。 |
| | | |
| | | |
第43行: |
第43行: |
| The basic operations provided by a graph data structure G usually include: | | The basic operations provided by a graph data structure G usually include: |
| | | |
− | 图形数据结构 G 提供的基本操作通常包括:
| + | 图形''G'' 的数据结构提供的基本操作通常包括: |
| --[[用户:趣木木|趣木木]]([[用户讨论:趣木木|讨论]])变量斜体 | | --[[用户:趣木木|趣木木]]([[用户讨论:趣木木|讨论]])变量斜体 |
− | * <code>adjacent</code>(''''G'''', ''''x'''', ''''y''''): tests whether there is an edge from the vertex ''x'' to the vertex ''y''; | + | * <code>adjacent</code>(''''G'''', ''''x'''', ''''y''''): tests whether there is an edge from the vertex ''''x'''' to the vertex ''''y''''; |
| | | |
− | * <code>neighbors</code>(''G'', ''x''): lists all vertices ''y'' such that there is an edge from the vertex ''x'' to the vertex ''y''; | + | * <code>neighbors</code>(''''G'''', ''''x''''): lists all vertices ''''y'''' such that there is an edge from the vertex ''''x'''' to the vertex ''''y''''; |
| | | |
− | * <code>add_vertex</code>(''G'', ''x''): adds the vertex ''x'', if it is not there; | + | * <code>add_vertex</code>(''''G'''', ''''x''''): adds the vertex ''''x'''', if it is not there; |
| | | |
| * <code>remove_vertex</code>(''G'', ''x''): removes the vertex ''x'', if it is there; | | * <code>remove_vertex</code>(''G'', ''x''): removes the vertex ''x'', if it is there; |