diff --git a/src/route/map.cpp b/src/route/map.cpp
index a1828af..17b7113 100644
--- a/src/route/map.cpp
+++ b/src/route/map.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2022,  The University of Memphis,
+ * Copyright (c) 2014-2024,  The University of Memphis,
  *                           Regents of the University of California
  *
  * This file is part of NLSR (Named-data Link State Routing).
@@ -23,51 +23,45 @@
 #include "adjacent.hpp"
 #include "lsa/lsa.hpp"
 #include "lsdb.hpp"
-#include "logger.hpp"
 
 namespace nlsr {
 
-INIT_LOGGER(route.Map);
-
 void
 Map::addEntry(const ndn::Name& rtrName)
 {
-  MapEntry me {rtrName, m_mappingIndex};
-  if (addEntry(me)) {
-    m_mappingIndex++;
-  }
-}
-
-bool
-Map::addEntry(MapEntry& mpe)
-{
-  return m_entries.insert(mpe).second;
+  int32_t mappingNo = static_cast<int32_t>(m_bimap.size());
+  m_bimap.by<ndn::Name>().insert({rtrName, mappingNo});
 }
 
 std::optional<ndn::Name>
 Map::getRouterNameByMappingNo(int32_t mn) const
 {
-  auto&& mappingNumberView = m_entries.get<detail::byMappingNumber>();
-  auto it = mappingNumberView.find(mn);
-  return it == mappingNumberView.end() ? std::nullopt : std::optional(it->router);
+  auto it = m_bimap.by<MappingNo>().find(mn);
+  if (it == m_bimap.by<MappingNo>().end()) {
+    return std::nullopt;
+  }
+  return it->get<ndn::Name>();
 }
 
 std::optional<int32_t>
 Map::getMappingNoByRouterName(const ndn::Name& rName)
 {
-  auto&& routerNameView = m_entries.get<detail::byRouterName>();
-  auto it = routerNameView.find(rName);
-  return it == routerNameView.end() ? std::nullopt : std::optional(it->mappingNumber);
+  auto it = m_bimap.by<ndn::Name>().find(rName);
+  if (it == m_bimap.by<ndn::Name>().end()) {
+    return std::nullopt;
+  }
+  return it->get<Map::MappingNo>();
 }
 
-void
-Map::writeLog()
+std::ostream&
+operator<<(std::ostream& os, const Map& map)
 {
-  NLSR_LOG_DEBUG("---------------Map----------------------");
-  for (const auto& entry : m_entries.get<detail::byRouterName>()) {
-    NLSR_LOG_DEBUG("MapEntry: ( Router: " << entry.router << " Mapping No: " <<
-                   entry.mappingNumber << " )");
+  os << "---------------Map----------------------";
+  for (const auto& entry : map.m_bimap) {
+    os << "\nMapEntry: ( Router: " << entry.get<ndn::Name>()
+       << " Mapping No: " << entry.get<Map::MappingNo>() << " )";
   }
+  return os;
 }
 
 } // namespace nlsr
diff --git a/src/route/map.hpp b/src/route/map.hpp
index f2e8eae..c43a777 100644
--- a/src/route/map.hpp
+++ b/src/route/map.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2022,  The University of Memphis,
+ * Copyright (c) 2014-2024,  The University of Memphis,
  *                           Regents of the University of California
  *
  * This file is part of NLSR (Named-data Link State Routing).
@@ -24,48 +24,16 @@
 #include "common.hpp"
 #include "lsa/adj-lsa.hpp"
 
-#include <boost/multi_index_container.hpp>
-#include <boost/multi_index/hashed_index.hpp>
-#include <boost/multi_index/member.hpp>
-#include <boost/multi_index/tag.hpp>
+#include <boost/bimap.hpp>
+#include <boost/bimap/unordered_set_of.hpp>
 
 #include <optional>
 
 namespace nlsr {
 
-struct MapEntry
-{
-  ndn::Name router;
-  int32_t mappingNumber = -1;
-};
-
-namespace detail {
-
-  using namespace boost::multi_index;
-  // Define tags so that we can search by different indices.
-  struct byRouterName {};
-  struct byMappingNumber{};
-  using entryContainer = multi_index_container<
-    MapEntry,
-    indexed_by<
-      hashed_unique<tag<byRouterName>,
-                    member<MapEntry, ndn::Name, &MapEntry::router>,
-                    std::hash<ndn::Name>>,
-      hashed_unique<tag<byMappingNumber>,
-                    member<MapEntry, int32_t, &MapEntry::mappingNumber>>
-      >
-    >;
-
-} // namespace detail
-
 class Map
 {
 public:
-  Map()
-    : m_mappingIndex(0)
-  {
-  }
-
   /*! \brief Add a map entry to this map.
     \param rtrName The name of the router.
 
@@ -114,22 +82,30 @@
   getMappingNoByRouterName(const ndn::Name& rName);
 
   size_t
-  getMapSize() const
+  size() const
   {
-    return m_entries.size();
+    return m_bimap.size();
   }
 
-  void
-  writeLog();
-
 private:
-  bool
-  addEntry(MapEntry& mpe);
+  struct MappingNo;
+  boost::bimap<
+    boost::bimaps::unordered_set_of<
+      boost::bimaps::tagged<ndn::Name, ndn::Name>,
+      std::hash<ndn::Name>
+    >,
+    boost::bimaps::unordered_set_of<
+      boost::bimaps::tagged<int32_t, MappingNo>
+    >
+  > m_bimap;
 
-  int32_t m_mappingIndex;
-  detail::entryContainer m_entries;
+  friend std::ostream&
+  operator<<(std::ostream& os, const Map& map);
 };
 
+std::ostream&
+operator<<(std::ostream& os, const Map& map);
+
 } // namespace nlsr
 
 #endif // NLSR_MAP_HPP
diff --git a/src/route/routing-table.cpp b/src/route/routing-table.cpp
index 7fd8a7a..fa7dee7 100644
--- a/src/route/routing-table.cpp
+++ b/src/route/routing-table.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2022,  The University of Memphis,
+ * Copyright (c) 2014-2024,  The University of Memphis,
  *                           Regents of the University of California
  *
  * This file is part of NLSR (Named-data Link State Routing).
@@ -130,9 +130,9 @@
   Map map;
   auto lsaRange = m_lsdb.getLsdbIterator<AdjLsa>();
   map.createFromAdjLsdb(lsaRange.first, lsaRange.second);
-  map.writeLog();
+  NLSR_LOG_DEBUG(map);
 
-  size_t nRouters = map.getMapSize();
+  size_t nRouters = map.size();
 
   LinkStateRoutingTableCalculator calculator(nRouters);
 
@@ -156,9 +156,9 @@
   Map map;
   auto lsaRange = m_lsdb.getLsdbIterator<CoordinateLsa>();
   map.createFromCoordinateLsdb(lsaRange.first, lsaRange.second);
-  map.writeLog();
+  NLSR_LOG_DEBUG(map);
 
-  size_t nRouters = map.getMapSize();
+  size_t nRouters = map.size();
 
   HyperbolicRoutingCalculator calculator(nRouters, isDryRun, m_confParam.getRouterPrefix());
 
