programming-examples/js/Algorithms/edge.js
2019-11-15 12:59:38 +01:00

21 lines
478 B
JavaScript

(function (exports) {
'use strict';
/**
* Graph edge.
*
* @constructor
* @public
* @param {Vertex} e Vertex which this edge connects.
* @param {Vertex} v Vertex which this edge connects.
* @param {Number} distance Weight of the edge.
* @module data-structures/edge
*/
exports.Edge = function (e, v, distance) {
this.from = e;
this.to = v;
this.distance = distance;
};
})(typeof window === 'undefined' ? module.exports : window);