Klaus Schneider | 3878430 | 2019-08-31 18:26:36 -0700 | [diff] [blame^] | 1 | /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
| 2 | /** |
| 3 | * Copyright (c) 2019 Klaus Schneider, The University of Arizona |
| 4 | * |
| 5 | * This program is free software; you can redistribute it and/or modify |
| 6 | * it under the terms of the GNU General Public License version 2 as |
| 7 | * published by the Free Software Foundation; |
| 8 | * |
| 9 | * This program is distributed in the hope that it will be useful, |
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | * GNU General Public License for more details. |
| 13 | * |
| 14 | * You should have received a copy of the GNU General Public License |
| 15 | * along with this program; if not, write to the Free Software |
| 16 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 17 | * |
| 18 | * Author: Klaus Schneider <klaus@cs.arizona.edu> |
| 19 | */ |
| 20 | |
| 21 | #ifndef LFID_REMOVE_LOOPS_H |
| 22 | #define LFID_REMOVE_LOOPS_H |
| 23 | |
| 24 | #include <boost/graph/adjacency_list.hpp> |
| 25 | |
| 26 | #include "ns3/ndnSIM/helper/lfid/abstract-fib.hpp" |
| 27 | |
| 28 | namespace ns3 { |
| 29 | namespace ndn { |
| 30 | |
| 31 | // No Vertex Property |
| 32 | // Edge Property: Weight. |
| 33 | using DiGraph = |
| 34 | boost::adjacency_list<boost::listS, boost::vecS, boost::bidirectionalS, boost::no_property, |
| 35 | boost::property<boost::edge_weight_t, int>>; |
| 36 | |
| 37 | void |
| 38 | getDigraphFromFib(DiGraph& dg, const AbstractFib::AllNodeFib& allNodeFIB, const int dstId); |
| 39 | |
| 40 | int |
| 41 | removeLoops(AbstractFib::AllNodeFib& allNodeFIB, bool printOutput = true); |
| 42 | |
| 43 | int |
| 44 | removeDeadEnds(AbstractFib::AllNodeFib& allNodeFIB, bool printOutput = true); |
| 45 | |
| 46 | } // namespace ndn |
| 47 | } // namespace ns3 |
| 48 | |
| 49 | #endif //LFID_REMOVE_LOOPS_H |