-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtestDriver.cpp
More file actions
601 lines (522 loc) · 23.2 KB
/
testDriver.cpp
File metadata and controls
601 lines (522 loc) · 23.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
#include "./Algorithms/include/SubgraphMatching.hpp"
#include "./Algorithms/include/TotalCycleDecomposition.hpp"
#include "./GraphStructure/include/Edge.hpp"
#include "./GraphStructure/include/Graph.hpp"
#include "./GraphStructure/include/Node.hpp"
#include "./LazyPrints/LazyPrinters.hpp"
#include "Algorithms/include/ConnectivityIdentifier.hpp"
#include <map>
#include <set>
using namespace glygraph;
class Atom : public Node<Atom>
{
public:
inline Atom(std::string inName) : Node(inName) //, atomNodePtr_(std::shared_ptr<Atom>(this))
{
}
virtual ~Atom()
{
// shows our double delete issue
// lazyInfo(__LINE__, __func__, "Destroying Atom: " + this->getName());
// std::cout << "\tMem Addr: " << this << "\n\n";
}
// copy constructor
inline Atom(const Atom &rhs) : Node(rhs) //, atomNodePtr_(std::shared_ptr<Atom>(this))
{
// lazyInfo(__LINE__, __func__, "Atom copy constructor: " + this->getName());
// std::cout << "\tMem Addr: " << this << "\n\n";
}
// move constructor
inline Atom(Atom &&rhs) { lazyInfo(__LINE__, __func__, "Calling atom move constructor"); }
// copy assignment
inline Atom &operator=(const Atom &rhs)
{
lazyInfo(__LINE__, __func__, "Calling atom copy assignment");
return *this = Atom(rhs);
}
// move assignment
inline Atom &operator=(Atom &&rhs)
{
lazyInfo(__LINE__, __func__, "Calling atom move assignment");
// this->atomNodePtr_ = std::move(rhs.getSharedAtom());
lazyInfo(__LINE__, __func__, "Post move");
// delete &rhs;
return *this;
}
inline void addBond(Atom *otherAtom)
{
this->addNeighbor(this->getName() + " -> " + otherAtom->getName(), otherAtom);
}
inline void removeBond(Atom *otherAtom) { this->removeEdgeBetween(otherAtom); }
inline std::vector<Atom *> getBondedAtoms()
{
std::vector<Atom *> bondedAtomVec;
for (Node<Atom> *currAtom : this->getNeighbors())
{
bondedAtomVec.push_back(currAtom->getDeriviedClass());
}
return bondedAtomVec;
}
private:
// std::shared_ptr<Node<Atom>> atomNodePtr_;
};
// endAtom
int main()
{
std::unique_ptr<Atom> atom0 = std::unique_ptr<Atom>(new Atom("Bobie"));
std::unique_ptr<Atom> atom1 = std::unique_ptr<Atom>(new Atom("Steve"));
std::unique_ptr<Atom> atom2 = std::unique_ptr<Atom>(new Atom("Ronne"));
std::unique_ptr<Atom> atom3 = std::unique_ptr<Atom>(new Atom("Bingo"));
std::unique_ptr<Atom> atom4 = std::unique_ptr<Atom>(new Atom("Marsh"));
std::unique_ptr<Atom> atom5 = std::unique_ptr<Atom>(new Atom("Delux"));
std::unique_ptr<Atom> atom6 = std::unique_ptr<Atom>(new Atom("Frank"));
std::unique_ptr<Atom> atom7 = std::unique_ptr<Atom>(new Atom("Bingo1"));
std::unique_ptr<Atom> atom8 = std::unique_ptr<Atom>(new Atom("Marsh1"));
std::unique_ptr<Atom> atom9 = std::unique_ptr<Atom>(new Atom("Bridge1"));
std::unique_ptr<Atom> atom10 = std::unique_ptr<Atom>(new Atom("cycle1"));
std::unique_ptr<Atom> atom11 = std::unique_ptr<Atom>(new Atom("cycle2"));
std::unique_ptr<Atom> atom12 = std::unique_ptr<Atom>(new Atom("cycle3"));
// test vector for our graph constructor overload using a vec of nodes
// std::vector<std::shared_ptr<Node<Atom>>> testGraphVec;
/*testGraphVec.push_back(atom0->getSharedAtom());
testGraphVec.push_back(atom1->getSharedAtom());
testGraphVec.push_back(atom2->getSharedAtom());
testGraphVec.push_back(atom3->getSharedAtom());
testGraphVec.push_back(atom4->getSharedAtom());
testGraphVec.push_back(atom5->getSharedAtom());
testGraphVec.push_back(atom6->getSharedAtom());
testGraphVec.push_back(atom7->getSharedAtom());
testGraphVec.push_back(atom8->getSharedAtom());
testGraphVec.push_back(atom9->getSharedAtom());
testGraphVec.push_back(atom10->getSharedAtom());
testGraphVec.push_back(atom11->getSharedAtom());
testGraphVec.push_back(atom12->getSharedAtom());*/
// to show our mega cycle decomp works
// b 1 -> cyc 1
// atom9->AddBond(atom10);
atom9->addBond(atom10.get());
// cyc 1 -> cyc 2
atom10->addBond(atom11.get());
// cyc 2 -> cyc 3
atom11->addBond(atom12.get());
// cyc 1 -> cyc 3
atom10->addBond(atom12.get());
// our mini cycle to the normal cycle
atom10->addBond(atom1.get());
atom0->addBond(atom1.get());
atom1->addBond(atom2.get());
atom2->addBond(atom3.get());
atom3->addBond(atom4.get());
atom4->addBond(atom5.get());
atom1->addBond(atom6.get());
atom5->addBond(atom6.get());
atom2->addBond(atom5.get());
atom2->addBond(atom6.get());
atom5->addBond(atom3.get());
atom2->addBond(atom7.get());
atom7->addBond(atom8.get());
atom6->addBond(atom3.get());
atom6->addBond(atom4.get());
// show copy & shared ptr works
std::shared_ptr<Atom> copyTester = std::shared_ptr<Atom>(new Atom(*atom6));
copyTester->setName("copied_frank");
// showing the scoping deal I discussed, instead of holder dude we would end up using a vector or something
std::vector<std::shared_ptr<Atom>> holderDude;
if (copyTester->getName() == "copied_frank")
{
std::shared_ptr<Atom> dudeWhat = std::shared_ptr<Atom>(new Atom("dudeWhat"));
holderDude.push_back(dudeWhat);
}
lazyInfo(__LINE__, __func__, "Showing our node didnt die: " + holderDude.back()->getName());
// show unique ptr works
std::unique_ptr<Atom> uniqueTester = std::unique_ptr<Atom>(new Atom("jeff"));
uniqueTester->addBond(atom0.get());
// show bonded implementation works
lazyInfo(__LINE__, __func__, "Show our get bonded atoms implementation works to get the derived class");
std::cout << "Atoms bonded to: " << atom6->getName() << "\n\tBonded to: ";
for (Atom *currAtom : atom6->getBondedAtoms())
{
std::cout << currAtom->getName() + ", ";
}
std::cout << "\n\n";
Graph<Atom> *g1 = new Graph<Atom>(atom0.get());
id_connectivity::identifyConnectivity(*g1);
// connectivity checking my dude
std::set<Edge<Atom> *> unknownEdges;
std::set<Edge<Atom> *> leafEdges;
std::set<Edge<Atom> *> bridgeEdges;
std::set<Edge<Atom> *> cycleEdges;
std::set<Node<Atom> *> unknownNodes;
std::set<Node<Atom> *> leafNodes;
std::set<Node<Atom> *> bridgeNodes;
std::set<Node<Atom> *> cycleNodes;
for (Node<Atom> *currNode : g1->getNodes())
{
for (Edge<Atom> *currEdge : currNode->getEdges())
{
switch (currEdge->getConnectivityTypeIdentifier())
{
case ConnectivityType::UNKNOWN:
unknownEdges.insert(currEdge);
break;
case ConnectivityType::BRIDGE:
bridgeEdges.insert(currEdge);
break;
case ConnectivityType::LEAF:
leafEdges.insert(currEdge);
break;
case ConnectivityType::INCYCLE:
cycleEdges.insert(currEdge);
break;
default:
badBehavior(__LINE__, __func__, "couldnt get edge conn type");
}
}
switch (currNode->getConnectivityTypeIdentifier())
{
case ConnectivityType::UNKNOWN:
unknownNodes.insert(currNode);
break;
case ConnectivityType::BRIDGE:
bridgeNodes.insert(currNode);
break;
case ConnectivityType::LEAF:
leafNodes.insert(currNode);
break;
case ConnectivityType::INCYCLE:
cycleNodes.insert(currNode);
break;
default:
badBehavior(__LINE__, __func__, "couldnt get node conn type");
}
}
std::cout << "\n";
lazyInfo(__LINE__, __func__, "Printing out objects with unkown conn type");
std::cout << "Nodes: ";
for (Node<Atom> *currDude : unknownNodes)
{
std::cout << currDude->getName() + ", ";
}
std::cout << "\nEdges: ";
for (Edge<Atom> *currDude : unknownEdges)
{
std::cout << currDude->getName() + ", ";
}
std::cout << "\n";
lazyInfo(__LINE__, __func__, "Printing out objects with leaf conn type");
std::cout << "Nodes: ";
for (Node<Atom> *currDude : leafNodes)
{
std::cout << currDude->getName() + ", ";
}
std::cout << "\nEdges: ";
for (Edge<Atom> *currDude : leafEdges)
{
std::cout << currDude->getName() + ", ";
}
std::cout << "\n";
lazyInfo(__LINE__, __func__, "Printing out objects with bridge conn type");
std::cout << "Nodes: ";
for (Node<Atom> *currDude : bridgeNodes)
{
std::cout << currDude->getName() + ", ";
}
std::cout << "\nEdges: ";
for (Edge<Atom> *currDude : bridgeEdges)
{
std::cout << currDude->getName() + ", ";
}
std::cout << "\n";
lazyInfo(__LINE__, __func__, "Printing out objects with cycle conn type");
std::cout << "Nodes: ";
for (Node<Atom> *currDude : cycleNodes)
{
std::cout << currDude->getName() + ", ";
}
std::cout << "\nEdges: ";
for (Edge<Atom> *currDude : cycleEdges)
{
std::cout << currDude->getName() + ", ";
}
std::cout << "\n";
lazyInfo(__LINE__, __func__, "Graph 1 grapviz link: \n\t" + g1->getGraphvizLink());
std::shared_ptr<Atom> atomA = std::shared_ptr<Atom>(new Atom("Ronne"));
std::shared_ptr<Atom> atomB = std::shared_ptr<Atom>(new Atom("Bingo"));
std::shared_ptr<Atom> atomC = std::shared_ptr<Atom>(new Atom("Marsh"));
std::shared_ptr<Atom> atomD = std::shared_ptr<Atom>(new Atom("Delux"));
atomA->addBond(atomB.get());
atomB->addBond(atomC.get());
atomA->addBond(atomD.get());
Graph<Atom> *g2 = new Graph<Atom>(atomA.get());
id_connectivity::identifyConnectivity(*g2);
lazyInfo(__LINE__, __func__, "Graph 2 grapviz link: \n\t" + g2->getGraphvizLink());
// Showing cycle decomp works
std::vector<std::pair<std::unordered_set<glygraph::Node<Atom> *>, std::unordered_set<glygraph::Edge<Atom> *>>>
g1Cycles = cycle_decomp::totalCycleDetect(*g1);
// Showing subgraph matching works
std::unordered_map<glygraph::Node<Atom> *,
std::pair<std::vector<glygraph::Node<Atom> *>, std::vector<glygraph::Edge<Atom> *>>>
g2MatchesIng1 = subgraph_match::findSubgraphs(*g1, *g2);
lazyInfo(__LINE__, __func__, "Printing out all cycles of g1\n");
int prettyCounter = 0;
for (std::pair<std::unordered_set<glygraph::Node<Atom> *>, std::unordered_set<glygraph::Edge<Atom> *>>
currCyclePair : g1Cycles)
{
std::cout << "Cycle #" + std::to_string(prettyCounter) + "\n\tNodes: ";
for (Node<Atom> *currAtom : currCyclePair.first)
{
std::cout << currAtom->getName() + ", ";
}
std::cout << "\n\tEdges: ";
for (Edge<Atom> *currEdge : currCyclePair.second)
{
std::cout << currEdge->getName() + ", ";
}
std::cout << "\n";
prettyCounter++;
}
prettyCounter = 0;
std::cout << "\n\n";
lazyInfo(__LINE__, __func__, "Printing out our nodes in g1 that match g2");
for (std::pair<glygraph::Node<Atom> *,
std::pair<std::vector<glygraph::Node<Atom> *>, std::vector<glygraph::Edge<Atom> *>>>
currMatchPair : g2MatchesIng1)
{
std::cout << "Node Key: " + currMatchPair.first->getName() + "\n\tNodes: ";
for (Node<Atom> *currAtom : currMatchPair.second.first)
{
std::cout << currAtom->getName() + ", ";
}
std::cout << "\n\tEdges: ";
for (Edge<Atom> *currEdge : currMatchPair.second.second)
{
std::cout << currEdge->getName() + ", ";
}
std::cout << "\n\n";
}
// Graph<Atom> queryGraph(atomA->GetNode());
// SubgraphMatcher<Atom> sumthin(&atomGraph, &queryGraph);
/*std::cout << "Deleting " << atom6->GetName() << "\n";
delete atom6;
std::cout << "Deleting " << atom4->GetName() << "\n";
delete atom4;
//std::cout << "Graph:\n" << atomGraph.Print() << "\n\n";
std::cout
<< "Visualize the graph
here:\nhttps://dreampuf.github.io/GraphvizOnline/#digraph%20G%20%7B%0ABobie-%3ESteve%0A%7D\n";
//CycleDetector<Atom> cycleDetector(atom0->GetNode());
//cycleDetector.DetectCyclesInDFSGraph();
std::cout << "Deleting " << atom5->GetName() << "\n";
delete atom5;
// std::cout << "Graph:\n" << atomGraph.Print() << "\n\n";
std::cout << "Deleting bonds: \n";
//atom1->RemoveBond(atom6);
//std::string neighMsg =
// (atom1->GetNode().get()->isNeighbor(atom2->GetNode())) ?
// "is Neighbor" : "is not neighbor";
atom1->RemoveBond(atom2);
*/
// lazyInfo(__LINE__, __func__, neighMsg);
// atom3->RemoveBond(atom4);
// std::cout << "Graph:\n" << atomGraph.Print() << "\n\n";
// std::cout << "Deleting atoms.\n";
// // delete atom3;
// delete atom4;
// delete atom5;
// delete atom6;
// std::cout << "Graph:\n" << atomGraph.Print() << "\n\n";
std::cout << "Finished atom section\n\n";
// Graph<Atom> queryAtomGraph(atomA->GetNode());
// std::cout << "queryGraph:\n" << queryAtomGraph.Print() << "\n\n";
// // std::vector<SubGraph<Atom>> foundSubGraphs = atomGraph.SubGraphMatch(queryAtomGraph);
// std::cout << "Found these subgraphs:\n";
// for (auto &subGraph : foundSubGraphs)
// {
// std::cout << "SubGraph:\n" << subGraph.Print() << "\n\n";
// }
std::cout << "********************************************\n";
// SubGraphMatcher<Atom> steveTheSubGraphFinder(atomGraph, queryAtomGraph);
// for (auto &subGraph : steveTheSubGraphFinder.GetMatches())
// {
// std::cout << "Steve SubGraph:\n" << subGraph.Print() << "\n\n";
// }
// std::cout << "********************************************\n";
// std::vector<Graph<int>> matchingSubGraphs = mainGraph.SubGraphMatch(queryGraph);
// std::cout << "Found " << matchingSubGraphs.size() << " subgraphs that matched\n";
// //atom1.atomNodePtr_ = std::make_shared<Node<Atom>>(&atom1);
// std::vector<std::shared_ptr<Node<int>> > vectorOfNodes;
// // Graph<int> intGraph1;
// std::vector<int> vect1(18);
// for (int i = 0; i < vect1.size(); ++i)
// {
// vect1.at(i) = i;
// vectorOfNodes.push_back(std::make_shared<Node<int>>(&(vect1.at(i))));
// }
// vectorOfNodes.at(1)->AddEdge(vectorOfNodes.at(2));
// for (auto &neighbor : vectorOfNodes.at(2)->GetNeighbors())
// {
// std::cout << "Neighbor index: " << neighbor->GetIndex() << "\n";
// }
// for (auto &neighbor : vectorOfNodes.at(1)->GetNeighbors())
// {
// std::cout << "Other side Neighbor index: " << neighbor->GetIndex() << "\n";
// }
// vectorOfNodes.at(1)->RemoveEdge(vectorOfNodes.at(2));
// for (auto &neighbor : vectorOfNodes.at(2)->GetNeighbors())
// {
// std::cout << "And now Neighbor index: " << neighbor->GetIndex() << "\n";
// }
// for (auto &neighbor : vectorOfNodes.at(1)->GetNeighbors())
// {
// std::cout << "And now Other side Neighbor index: " << neighbor->GetIndex() << "\n";
// }
delete g1;
delete g2;
std::cout << "Finishing!" << std::endl;
// //BFS
// // intGraph1.AddEdge(new Edge<int>(vectorOfNodes.at(1), vectorOfNodes.at(2)));
// // intGraph1.AddEdge(new Edge<int>(vectorOfNodes.at(2), vectorOfNodes.at(3)));
// // intGraph1.AddEdge(new Edge<int>(vectorOfNodes.at(2), vectorOfNodes.at(16)));
// // intGraph1.AddEdge(new Edge<int>(vectorOfNodes.at(3), vectorOfNodes.at(4)));
// // intGraph1.AddEdge(new Edge<int>(vectorOfNodes.at(16), vectorOfNodes.at(17)));
// // intGraph1.AddEdge(new Edge<int>(vectorOfNodes.at(16), vectorOfNodes.at(15)));
// // intGraph1.AddEdge(new Edge<int>(vectorOfNodes.at(4), vectorOfNodes.at(5)));
// // intGraph1.AddEdge(new Edge<int>(vectorOfNodes.at(4), vectorOfNodes.at(7)));
// // intGraph1.AddEdge(new Edge<int>(vectorOfNodes.at(17), vectorOfNodes.at(13)));
// // intGraph1.AddEdge(new Edge<int>(vectorOfNodes.at(15), vectorOfNodes.at(14)));
// // intGraph1.AddEdge(new Edge<int>(vectorOfNodes.at(5), vectorOfNodes.at(6)));
// // intGraph1.AddEdge(new Edge<int>(vectorOfNodes.at(7), vectorOfNodes.at(6)));
// // intGraph1.AddEdge(new Edge<int>(vectorOfNodes.at(14), vectorOfNodes.at(13)));
// // intGraph1.AddEdge(new Edge<int>(vectorOfNodes.at(13), vectorOfNodes.at(11)));
// // intGraph1.AddEdge(new Edge<int>(vectorOfNodes.at(13), vectorOfNodes.at(12)));
// // intGraph1.AddEdge(new Edge<int>(vectorOfNodes.at(6), vectorOfNodes.at(8)));
// // intGraph1.AddEdge(new Edge<int>(vectorOfNodes.at(11), vectorOfNodes.at(10)));
// // intGraph1.AddEdge(new Edge<int>(vectorOfNodes.at(12), vectorOfNodes.at(10)));
// // intGraph1.AddEdge(new Edge<int>(vectorOfNodes.at(8), vectorOfNodes.at(9)));
// // intGraph1.AddEdge(new Edge<int>(vectorOfNodes.at(8), vectorOfNodes.at(10)));
// // DFS
// intGraph1.AddEdge(new Edge<int>(vectorOfNodes.at(1), vectorOfNodes.at(2)));
// intGraph1.AddEdge(new Edge<int>(vectorOfNodes.at(2), vectorOfNodes.at(3)));
// intGraph1.AddEdge(new Edge<int>(vectorOfNodes.at(2), vectorOfNodes.at(16)));
// intGraph1.AddEdge(new Edge<int>(vectorOfNodes.at(3), vectorOfNodes.at(4)));
// intGraph1.AddEdge(new Edge<int>(vectorOfNodes.at(4), vectorOfNodes.at(5)));
// intGraph1.AddEdge(new Edge<int>(vectorOfNodes.at(4), vectorOfNodes.at(7)));
// intGraph1.AddEdge(new Edge<int>(vectorOfNodes.at(5), vectorOfNodes.at(6)));
// intGraph1.AddEdge(new Edge<int>(vectorOfNodes.at(6), vectorOfNodes.at(7)));
// intGraph1.AddEdge(new Edge<int>(vectorOfNodes.at(6), vectorOfNodes.at(8)));
// intGraph1.AddEdge(new Edge<int>(vectorOfNodes.at(8), vectorOfNodes.at(9)));
// intGraph1.AddEdge(new Edge<int>(vectorOfNodes.at(8), vectorOfNodes.at(10)));
// intGraph1.AddEdge(new Edge<int>(vectorOfNodes.at(10), vectorOfNodes.at(11)));
// intGraph1.AddEdge(new Edge<int>(vectorOfNodes.at(10), vectorOfNodes.at(12)));
// intGraph1.AddEdge(new Edge<int>(vectorOfNodes.at(11), vectorOfNodes.at(13)));
// intGraph1.AddEdge(new Edge<int>(vectorOfNodes.at(12), vectorOfNodes.at(13)));
// intGraph1.AddEdge(new Edge<int>(vectorOfNodes.at(13), vectorOfNodes.at(14)));
// intGraph1.AddEdge(new Edge<int>(vectorOfNodes.at(14), vectorOfNodes.at(15)));
// intGraph1.AddEdge(new Edge<int>(vectorOfNodes.at(15), vectorOfNodes.at(16)));
// intGraph1.AddEdge(new Edge<int>(vectorOfNodes.at(13), vectorOfNodes.at(17)));
// intGraph1.AddEdge(new Edge<int>(vectorOfNodes.at(16), vectorOfNodes.at(17)));
// // intGraph1.AddEdge(new Edge<int>(vectorOfNodes.at(1), vectorOfNodes.at(2)
// // intGraph1.AddEdge(new Edge<int>(vectorOfNodes.at(1), vectorOfNodes.at(3)));
// // intGraph1.AddEdge(new Edge<int>(vectorOfNodes.at(1), vectorOfNodes.at(7)));
// // intGraph1.AddEdge(new Edge<int>(vectorOfNodes.at(2), vectorOfNodes.at(3)));
// // intGraph1.AddEdge(new Edge<int>(vectorOfNodes.at(2), vectorOfNodes.at(4)));
// // intGraph1.AddEdge(new Edge<int>(vectorOfNodes.at(3), vectorOfNodes.at(4)));
// // intGraph1.AddEdge(new Edge<int>(vectorOfNodes.at(3), vectorOfNodes.at(5)));
// // intGraph1.AddEdge(new Edge<int>(vectorOfNodes.at(3), vectorOfNodes.at(6)));
// // intGraph1.AddEdge(new Edge<int>(vectorOfNodes.at(3), vectorOfNodes.at(7)));
// // intGraph1.AddEdge(new Edge<int>(vectorOfNodes.at(4), vectorOfNodes.at(5)));
// // intGraph1.AddEdge(new Edge<int>(vectorOfNodes.at(5), vectorOfNodes.at(6)));
// // intGraph1.AddEdge(new Edge<int>(vectorOfNodes.at(6), vectorOfNodes.at(7)));
// // int count = 1;
// // for (auto it1 = vectorOfNodes.begin(); it1 != (vectorOfNodes.end()-1); it1++)
// // {
// // auto it2 = (it1 + 1);
// // intGraph1.AddEdge(new Edge<int>(*it1, *it2));
// // if ((count % 6) == 0)
// // {
// // auto it3 = (it1 - 5);
// // intGraph1.AddEdge(new Edge<int>(*it1, *it3));
// // }
// // count++;
// // }
// // intGraph1.AddEdge(new Edge<int>(vectorOfNodes.at(11), vectorOfNodes.at(5)));
// for(auto &edge : intGraph1.GetEdges())
// {
// //std::cout << "Edge: " << *(edge->GetSource()->GetObjectPtr()) << "-->" <<
// *(edge->GetTarget()->GetObjectPtr()) << std::endl;
// std::cout << "Edge: " << edge->GetSource()->GetIndex() << "-->" << edge->GetTarget()->GetIndex() <<
// std::endl;
// }
// intGraph1.DetectCyclesInDFSGraph();
// // Graphs of graphs
// Graph<int> intGraph2;
// Node<Graph<int>> graphNode1(&intGraph1);
// Node<Graph<int>> graphNode2(&intGraph2);
// Graph<Graph<int>> garyTheGraphGraph;
// garyTheGraphGraph.AddEdge(new Edge<Graph<int>>(&graphNode1, &graphNode2));
// // Subgraph matching tNULLest
// int intStance = 1, intStance2 = 24, intStance3 = 999;
// Graph<int> mainGraph, queryGraph;
// Node<int> mana(&intStance, "Man");
// Node<int> gala(&intStance2, "Gal");
// Node<int> man(&intStance, "Man");
// Node<int> gal(&intStance2, "Gal");
// Node<int> glc(&intStance3, "Glc");
// Node<int> roh(&intStance3, "ROH");
// Node<int> man1(&intStance, "Man");
// Node<int> gal2(&intStance2, "Gal");
// //intNode.SetObjectPtr(&intStance);
// // int *test = intNode.GetObjectPtr();
// // std::cout << "Test is " << *test << " while intStance is " << intStance << std::endl;
// // intStance = 2;
// // std::cout << "Test is " << *test << " while intStance is " << intStance << std::endl;
// Edge<int> edge1(&man, &gal);
// Edge<int> edge2(&glc, &gal);
// Edge<int> edge3(&mana, &gala);
// Edge<int> edge4(&gala, &man);
// Edge<int> edge5(&gal, &rohNULL);
// edge1.AddLabel("1-4");
// edge2.AddLabel("1-3");
// edge3.AddLabel("1-4");
// edge4.AddLabel("1-2");
// edge5.AddLabel("1-");
// mainGraph.AddEdge(&edge1);
// mainGraph.AddEdge(&edge2);
// mainGraph.AddEdge(&edge3);
// mainGraph.AddEdge(&edge4);
// mainGraph.AddEdge(&edge5);
// Edge<int> edge9(&man1, &gal2);
// edge9.AddLabel("1-4");
// queryGraph.AddEdge(&edge9);
// std::vector<Graph<int>> matchingSubGraphs = mainGraph.SubGraphMatch(queryGraph);
// std::cout << "Found " << matchingSubGraphs.size() << " subgraphs that matched\n";
// // Testing deletion of Nodes or edges:
// for (auto &element : vectorOfNodes)
// {
// delete element;
// }
// //mana.~Node();
// std::cout << "\n\nNODE HAS BEEN DELETED\n\n" << std::endl;
// int *test2 = edgier.GetTarget()->GetObjectPtr();
// std::cout << "Test2 is " << *test2 << std::endl;
// std::vector<Node<int>*> neighbors;
// neighbors.push_back(edgier.GetTarget());
// neighbors = intNode.GetNeighbors();
// std::vector<int*> allDaNeighborObjects = intNode.GetNodesNeighborsObjects();
// std::cout << "Neighbors are: ";
// for (auto & element : allDaNeighborObjects)
// {
// std::cout << *element << ", ";
// }
// std::cout << std::endl;
// std::vector<std::shared_ptr<int*>> steve = intNode.GetNodesNeighborsObjects();
// std::vector<std::shared_ptr<TemplateGraph::Node<int>>> steve = intNode.GetNodesNeighbors();
// Graph<Graph<Atom>> residueGraph;
// Edge<int> edgeA(Node<int> intNode1(1), &intNoder);
// std::vector<Edge<int>* > vectorOfEdges = {&edger, &edgier};
// Graph<int> theBestGraph(vectorOfEdges);
return 0;
}
// bool compareLabel(TemplateGraph::Edge<int> &edge, TemplateGraph::Edge<int> &otherEdge) {
// return (edge.GetLabel() == otherEdge.GetLabel());
// }