mirror of
https://github.com/trekhleb/javascript-algorithms.git
synced 2026-03-13 08:51:02 +08:00
Add graph.
This commit is contained in:
12
src/data-structures/graph/GraphEdge.js
Normal file
12
src/data-structures/graph/GraphEdge.js
Normal file
@@ -0,0 +1,12 @@
|
||||
export default class GraphEdge {
|
||||
/**
|
||||
* @param startVertex {GraphVertex}
|
||||
* @param endVertex {GraphVertex}
|
||||
* @param weight {number}
|
||||
*/
|
||||
constructor(startVertex, endVertex, weight = 1) {
|
||||
this.startVertex = startVertex;
|
||||
this.endVertex = endVertex;
|
||||
this.weight = weight;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user