Advertisement
Guest User

Untitled

a guest
Oct 27th, 2016
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. // ConsoleApplication4.cpp : Defines the entry point for the console application.
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include <vector>
  6. #include <iostream>
  7. struct Edge {
  8. int to;
  9. int weight;
  10. Edge * opposite;
  11.  
  12. Edge(int end, int weight_param) : to(end), weight(weight_param) {}
  13.  
  14. void change_weight(int change) {
  15. weight = change;
  16. }
  17. };
  18.  
  19. class Graph{
  20.  
  21. std::vector<std::vector<Edge>> graph;
  22.  
  23. void make_nodes(int how_many) {
  24. std::vector<Edge> node;
  25. for (int i = 0; i < how_many; ++i) {
  26. graph.push_back(std::vector<Edge>());
  27. }
  28. }
  29.  
  30. void read_edges(int how_many) {
  31. for (int i = 0; i < how_many; ++i) {
  32. int from, to, weight;
  33. std::cin >> from >> to >> weight;
  34.  
  35. Edge(node_list[from], node_list[to], weight);
  36. Edge(node_list[to], node_list[from], 0);
  37. }
  38. }
  39.  
  40. void push_edge(int from, int to, int weight){
  41. Edge e1(to, weight);
  42. graph[from-1].push_back(e);
  43. Edge e2()
  44. }
  45. };
  46.  
  47.  
  48. int main() {
  49.  
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement