#include #include #include "edge.h" using std::string; using std::ostream; edge::edge(const int v1, const int v2) : from(v1), to(v2), weight(1.0) {} edge::edge(const int v1, const int v2, const double w) : from(v1), to(v2), weight(w) {} edge::edge(const edge& e) : from(e.from), to(e.to), weight(e.weight) {} edge& edge::operator=(const edge& e) { from = e.from; to = e.to; weight = e.weight; return *this; } bool edge::operator==(const edge& e) const { return from==e.from && to==e.to && weight==e.weight; } bool edge::operator!=(const edge& e) const { return from!=e.from || to!=e.to || weight!=e.weight; }