第63行: |
第63行: |
| * <code>set_vertex_value</code>(''G'', ''x'', ''v''): sets the value associated with the vertex ''x'' to ''v''. | | * <code>set_vertex_value</code>(''G'', ''x'', ''v''): sets the value associated with the vertex ''x'' to ''v''. |
| | | |
| + | * <code>adjacent</code>(" G ", " x ", " y "):检验顶点" x "到顶点" y "是否有边; |
| | | |
| + | * <code>neighbors</code>(“G”,“x”):列出所有顶点“y”,使顶点“x”有一条边到顶点“y”; |
| + | |
| + | * <code> add_vertex > < /代码(“G”、“x”):添加顶点“x”,如果它是不存在的; |
| + | |
| + | * <code>remove_vertex</code>(" G ", " x "):删除顶点" x "(如果存在的话); |
| + | |
| + | * <code>add_edge</code>(" G ", " x ", " y "):将顶点" x "的边添加到顶点" y "(如果不存在的话); |
| + | |
| + | * <code>remove_edge</code>(" G ", " x ", " y "):将顶点" x "的边移到顶点" y "的边(如果存在的话); |
| + | |
| + | * <code>get_vertex_value</code>(" G ", " x "):返回与顶点" x "相关的值; |
| + | |
| + | * <code> set_vertex_value > </code>(“G”、“x”、“v”):设置顶点的值与“x”“v”。 |
| | | |
| Structures that associate values to the edges usually also provide:<ref name="gt-ops"/> | | Structures that associate values to the edges usually also provide:<ref name="gt-ops"/> |
第74行: |
第88行: |
| | | |
| * <code>set_edge_value</code>(''G'', ''x'', ''y'', ''v''): sets the value associated with the edge (''x'', ''y'') to ''v''. | | * <code>set_edge_value</code>(''G'', ''x'', ''y'', ''v''): sets the value associated with the edge (''x'', ''y'') to ''v''. |
| + | * <code>get_edge_value</code>(''G'', ''x'', ''y''): 连接点 (''x'', ''y'')的返回值; |
| + | |
| + | * <code>set_edge_value</code>(''G'', ''x'', ''y'', ''v''): 连接点(''x'', ''y'') 到 ''v''的设置值. |
| | | |
| ==Representations 表示== | | ==Representations 表示== |