public interface Graph extends BaseGraph
BaseGraph| 限定符和类型 | 方法和说明 |
|---|---|
void |
addEdge(int vi,
int vj,
double weight)
add an edge to the graph
|
void |
addVertex(int vi)
add a vertex to the graph
|
void |
clear()
clear all vertices and edges in the graph.
|
void |
removeEdge(int vi,
int vj)
remove the edge that is specified by ordered index pair <i, j>
|
void |
removeVertex(int vi)
remove the vertex
|
void |
updateEdge(int vi,
int vj,
double weight)
update the weight of edge that is specified by ordered index pair <i, j>
|
adjacentVertices, edgeWeight, isDirected, verticesvoid addEdge(int vi,
int vj,
double weight)
vi - the index of vertex i, if vi equals vj, do nothingvj - the index of vertex j, if vj equals vi, no nothingweight - the weight of the edge to be added, must be non-negativevoid removeEdge(int vi,
int vj)
vi - the index of vertex i, if vi equals vj, do nothingvj - the index of vertex j, if vj equals vi, no nothingvoid updateEdge(int vi,
int vj,
double weight)
vi - the index of vertex i, if vi equals vj, do nothingvj - the index of vertex j, if vj equals vi, no nothingweight - the weight of edge that is to be updated, must be non-negativevoid addVertex(int vi)
vi - the index of vertex vivoid removeVertex(int vi)
vi - the index of vertex which is to be removedvoid clear()
Copyright © 2019. All rights reserved.