Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ConsoleApplication4.cpp : Defines the entry point for the console application.
- //
- #include "stdafx.h"
- #include <vector>
- #include <iostream>
- struct Edge {
- int to;
- int weight;
- Edge * opposite;
- Edge(int end, int weight_param) : to(end), weight(weight_param) {}
- void change_weight(int change) {
- weight = change;
- }
- };
- class Graph{
- std::vector<std::vector<Edge>> graph;
- void make_nodes(int how_many) {
- std::vector<Edge> node;
- for (int i = 0; i < how_many; ++i) {
- graph.push_back(std::vector<Edge>());
- }
- }
- void read_edges(int how_many) {
- for (int i = 0; i < how_many; ++i) {
- int from, to, weight;
- std::cin >> from >> to >> weight;
- Edge(node_list[from], node_list[to], weight);
- Edge(node_list[to], node_list[from], 0);
- }
- }
- void push_edge(int from, int to, int weight){
- Edge e1(to, weight);
- graph[from-1].push_back(e);
- Edge e2()
- }
- };
- int main() {
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement