diff --git a/nlsr.cpp b/nlsr.cpp
index 99cc450..5a873df 100644
--- a/nlsr.cpp
+++ b/nlsr.cpp
@@ -56,7 +56,6 @@
 
 int 
 main(int argc, char **argv){
-
 	nlsr nlsr;
 	string programName(argv[0]);
 	nlsr.setConfFileName("nlsr.conf");
diff --git a/nlsr.hpp b/nlsr.hpp
index f131ab6..52d5277 100644
--- a/nlsr.hpp
+++ b/nlsr.hpp
@@ -162,6 +162,26 @@
 	{
 		return apiPort;
 	}
+
+	int getIsRoutingTableCalculating()
+	{
+		return isRoutingTableCalculating;
+	}
+
+	void setIsRoutingTableCalculating(int irtc)
+	{
+		isRoutingTableCalculating=irtc;
+	}
+
+	int getIsRouteCalculationScheduled()
+	{
+		return isRouteCalculationScheduled;
+	}
+
+	void setIsRouteCalculationScheduled(int ircs)
+	{
+		isRouteCalculationScheduled=ircs;
+	}
 	
 private:
 	ConfParameter confParam;
diff --git a/nlsr_adl.cpp b/nlsr_adl.cpp
index 0f4be8f..55cbb29 100644
--- a/nlsr_adl.cpp
+++ b/nlsr_adl.cpp
@@ -147,7 +147,7 @@
 	}
 }
 
-std::list<Adjacent> 
+std::list<Adjacent>& 
 Adl::getAdjList(){
 	return adjList;
 }
diff --git a/nlsr_adl.hpp b/nlsr_adl.hpp
index eac8245..70e250d 100644
--- a/nlsr_adl.hpp
+++ b/nlsr_adl.hpp
@@ -17,7 +17,7 @@
 	int insert(Adjacent& adj);
 	int updateAdjacentStatus(string adjName, int s);
 	int updateAdjacentLinkCost(string adjName, double lc);	
-	std::list<Adjacent> getAdjList();
+	std::list<Adjacent>& getAdjList();
 	bool isNeighbor(string adjName);
 	void incrementTimedOutInterestCount(string& neighbor);
 	int getTimedOutInterestCount(string& neighbor);
diff --git a/nlsr_lsdb.cpp b/nlsr_lsdb.cpp
index 062a2b1..ffd49b1 100644
--- a/nlsr_lsdb.cpp
+++ b/nlsr_lsdb.cpp
@@ -346,8 +346,13 @@
 		// add Adj LSA
 		addAdjLsa(alsa);
 		// schedule routing table calculation
-		pnlsr.getScheduler().scheduleEvent(ndn::time::seconds(15),
-							ndn::bind(&RoutingTable::calculate, &pnlsr.getRoutingTable()));
+		if ( pnlsr.getIsRouteCalculationScheduled() != 1 )
+		{
+			pnlsr.getScheduler().scheduleEvent(ndn::time::seconds(15),
+								ndn::bind(&RoutingTable::calculate, 
+								&pnlsr.getRoutingTable(),boost::ref(pnlsr)));
+			pnlsr.setIsRouteCalculationScheduled(1);
+		}
 	}
 	else
 	{
@@ -403,6 +408,12 @@
 	return true;
 }
 
+std::list<AdjLsa>& 
+Lsdb::getAdjLsdb()
+{
+		return adjLsdb;
+}
+
 void 
 Lsdb::printAdjLsdb()
 {
diff --git a/nlsr_lsdb.hpp b/nlsr_lsdb.hpp
index 3451c71..1225969 100644
--- a/nlsr_lsdb.hpp
+++ b/nlsr_lsdb.hpp
@@ -29,12 +29,13 @@
 	bool removeCorLsa(string& key);
 	void printCorLsdb(); //debugging
 
-	//function related to Cor LSDB
+	//function related to Adj LSDB
 	void scheduledAdjLsaBuild(nlsr& pnlsr);
 	bool buildAndInstallOwnAdjLsa(nlsr& pnlsr);
 	bool removeAdjLsa(string& key);
 	bool installAdjLsa(nlsr& pnlsr, AdjLsa &alsa);
 	AdjLsa& getAdjLsa(string key);
+	std::list<AdjLsa>& getAdjLsdb();
 	void printAdjLsdb();
 	
 private:
diff --git a/nlsr_map.cpp b/nlsr_map.cpp
new file mode 100644
index 0000000..3c4ee86
--- /dev/null
+++ b/nlsr_map.cpp
@@ -0,0 +1,117 @@
+#include<iostream>
+#include<list>
+
+#include "nlsr.hpp"
+#include "nlsr_adjacent.hpp"
+#include "nlsr_lsa.hpp"
+#include "nlsr_lsdb.hpp"
+#include "nlsr_map.hpp"
+
+
+using namespace std;
+
+ostream&
+operator<<(ostream& os, MapEntry& mpe)
+{
+	os<<"MapEntry: ( Router: "<<mpe.getRouter()<<" Mapping No: ";
+	os<<mpe.getMappingNumber()<<" )"<<endl;
+
+	return os;
+}
+
+static bool
+mapEntryCompareByRouter(MapEntry& mpe1, string& rtrName){
+	return mpe1.getRouter()==rtrName;
+}
+
+static bool
+mapEntryCompareByMappingNo(MapEntry& mpe1, int mappingNo){
+	return mpe1.getMappingNumber()==mappingNo;
+}
+
+void 
+Map::addMapElement(string& rtrName)
+{
+	MapEntry me(rtrName,mappingIndex);
+	if (  addMapElement(me) )
+	{
+		mappingIndex++;
+	}
+}
+
+bool 
+Map::addMapElement(MapEntry& mpe)
+{
+	//cout << mpe;
+	std::list<MapEntry >::iterator it = std::find_if( rMap.begin(), 
+								rMap.end(),	
+   								bind(&mapEntryCompareByRouter, _1, mpe.getRouter()));
+	if ( it == rMap.end() ){
+		rMap.push_back(mpe);
+		return true;
+	}
+	return false;
+}
+
+string 
+Map::getRouterNameByMappingNo(int mn)
+{
+	std::list<MapEntry >::iterator it = std::find_if( rMap.begin(), 
+								rMap.end(),	
+   								bind(&mapEntryCompareByMappingNo, _1, mn));
+	if ( it != rMap.end() ){
+		return (*it).getRouter();
+	}
+	return "";
+}
+
+int 
+Map::getMappingNoByRouterName(string& rName)
+{
+	std::list<MapEntry >::iterator it = std::find_if( rMap.begin(), 
+								rMap.end(),	
+   								bind(&mapEntryCompareByRouter, _1, rName));
+	if ( it != rMap.end() ){
+		return (*it).getMappingNumber();
+	}
+	return -1;
+}
+
+void 
+Map::createMapFromAdjLsdb(nlsr& pnlsr)
+{
+	std::list<AdjLsa> adjLsdb=pnlsr.getLsdb().getAdjLsdb();
+	for( std::list<AdjLsa>::iterator it=adjLsdb.begin(); 
+	                                                 it!= adjLsdb.end() ; it++)
+	{
+		string linkStartRouter=(*it).getOrigRouter();
+		addMapElement(linkStartRouter);
+		std::list<Adjacent> adl=(*it).getAdl().getAdjList();
+		for( std::list<Adjacent>::iterator itAdl=adl.begin(); 
+																								itAdl!= adl.end() ; itAdl++)
+		{
+			string linkEndRouter=(*itAdl).getAdjacentName();
+			addMapElement(linkEndRouter);
+		}
+		
+	}
+}
+
+void 
+Map::resetMap()
+{
+	rMap.clear();
+	mappingIndex=0;
+}
+
+ostream&
+operator<<(ostream& os, Map& rMap)
+{
+	os<<"---------------Map----------------------"<<endl;
+	std::list< MapEntry > ml=rMap.getMapList();
+	for( std::list<MapEntry>::iterator it=ml.begin(); it!= ml.end() ; it++){
+		os<< (*it);
+	}
+
+	return os;
+}
diff --git a/nlsr_map.hpp b/nlsr_map.hpp
new file mode 100644
index 0000000..c02104a
--- /dev/null
+++ b/nlsr_map.hpp
@@ -0,0 +1,84 @@
+#ifndef NLSR_MAP_HPP
+#define NLSR_MAP_HPP
+
+#include <iostream>
+#include <list>
+
+#include <ndn-cpp-dev/face.hpp>
+
+class nlsr;
+
+using namespace std;
+
+class MapEntry
+{
+public:
+	MapEntry()
+		: router()
+		, mappingNumber(-1)
+	{
+	}
+
+	~MapEntry()
+	{
+	}
+	
+	MapEntry(string rtr, int mn)
+	{
+		router=rtr;
+		mappingNumber=mn;
+	}
+
+	string getRouter()
+	{
+		return router;
+	}
+
+	int getMappingNumber()
+	{
+		return mappingNumber;
+	}
+private:
+	string router;
+	int mappingNumber;
+};
+
+ostream&
+operator<<(ostream& os, MapEntry& mpe);
+
+class Map
+{
+public:
+	Map()
+		: mappingIndex(0)
+	{
+	}
+
+	
+	void addMapElement(string& rtrName);
+	void createMapFromAdjLsdb(nlsr& pnlsr);
+	string getRouterNameByMappingNo(int mn);
+	int getMappingNoByRouterName(string& rName);
+	void resetMap();
+	std::list< MapEntry >& getMapList()
+	{
+		return rMap;
+	}
+
+	int getMapSize()
+	{
+		return rMap.size();
+	}
+
+	
+private:
+	bool addMapElement(MapEntry& mpe);
+	
+	int mappingIndex;
+	std::list< MapEntry > rMap;
+};
+
+ostream&
+operator<<(ostream& os, Map& rMap);
+
+#endif
diff --git a/nlsr_rt.cpp b/nlsr_rt.cpp
index bcf5af0..b2cc8b9 100644
--- a/nlsr_rt.cpp
+++ b/nlsr_rt.cpp
@@ -1,10 +1,112 @@
 #include<iostream>
 #include<string>
+#include<list>
 
 #include "nlsr_rt.hpp"
 #include "nlsr.hpp"
+#include "nlsr_map.hpp"
+#include "nlsr_rtc.hpp"
 
 using namespace std;
 
+void
+RoutingTable::calculate(nlsr& pnlsr)
+{
 
+	if ( 	pnlsr.getIsRoutingTableCalculating() == 0 )
+	{
+		pnlsr.setIsRoutingTableCalculating(1); //setting routing table calculation
+		
+		if ( pnlsr.getLsdb().doesLsaExist(
+						pnlsr.getConfParameter().getRouterPrefix()+"/"+"2",2) )
+		{
+			if(pnlsr.getIsBuildAdjLsaSheduled() != 1)
+			{
+				clearRoutingTable();
+				clearDryRoutingTable(); // for dry run options
+				// calculate Link State routing
+				if( (pnlsr.getConfParameter().getIsHyperbolicCalc() == 0 ) 
+						|| (pnlsr.getConfParameter().getIsHyperbolicCalc() == 2 ) )
+				{
+					calculateLsRoutingTable(pnlsr);
+				}
+				//calculate hyperbolic routing
+				if ( pnlsr.getConfParameter().getIsHyperbolicCalc() == 1 )
+				{
+					calculateHypRoutingTable(pnlsr);
+				}
+				//calculate dry hyperbolic routing
+				if ( pnlsr.getConfParameter().getIsHyperbolicCalc() == 2 )
+				{
+					calculateHypDryRoutingTable(pnlsr);
+				}
+
+				//need to update NPT here
+			}
+			else
+			{
+				cout<<"Adjacency building is scheduled, so ";
+				cout<<"routing table can not be calculated :("<<endl;
+			}
+		}
+		else
+		{
+			cout<<"No Adj LSA of router itself,";
+			cout<<	" so Routint table can not be calculated :("<<endl;	
+			clearRoutingTable();
+		  clearDryRoutingTable(); // for dry run options
+		  // need to update NPT here
+		}
+
+		pnlsr.setIsRouteCalculationScheduled(0); //clear scheduled flag
+		pnlsr.setIsRoutingTableCalculating(0); //unsetting routing table calculation
+	}
+	else
+	{
+		pnlsr.getScheduler().scheduleEvent(ndn::time::seconds(15),
+									 ndn::bind(&RoutingTable::calculate,this,boost::ref(pnlsr)));
+		pnlsr.setIsRouteCalculationScheduled(1);
+	}
+}
+
+
+void 
+RoutingTable::calculateLsRoutingTable(nlsr& pnlsr)
+{
+	Map vMap;
+	vMap.createMapFromAdjLsdb(pnlsr);
+	int numOfRouter=vMap.getMapSize();
+
+	LinkStateRoutingTableCalculator lsrtc(numOfRouter);
+	lsrtc.allocateAdjMatrix();
+	lsrtc.makeAdjMatrix(pnlsr,vMap);
+	lsrtc.calculatePath(vMap,boost::ref(*this),pnlsr);
+	lsrtc.freeAdjMatrix();
+	
+	
+}
+
+void 
+RoutingTable::calculateHypRoutingTable(nlsr& pnlsr)
+{
+	
+}
+
+void 
+RoutingTable::calculateHypDryRoutingTable(nlsr&pnlsr)
+{
+	
+}
+
+void 
+RoutingTable::clearRoutingTable()
+{
+	rTable.clear();
+}
+
+void 
+RoutingTable::clearDryRoutingTable()
+{
+	dryTable.clear();
+}
 
diff --git a/nlsr_rt.hpp b/nlsr_rt.hpp
index ac9ccfa..05beda4 100644
--- a/nlsr_rt.hpp
+++ b/nlsr_rt.hpp
@@ -6,6 +6,8 @@
 
 #include "nlsr_rte.hpp"
 
+class nlsr;
+
 using namespace std;
 
 class RoutingTable
@@ -14,13 +16,18 @@
 	RoutingTable()
 	{
 	}
-	void calculate()
-	{
-		cout<<"Routing Table Calculating......"<<endl;
-	}
+	void calculate(nlsr& pnlsr);
 
 private:
+	void calculateLsRoutingTable(nlsr& pnlsr);
+	void calculateHypRoutingTable(nlsr& pnlsr);
+	void calculateHypDryRoutingTable(nlsr&pnlsr);
+	
+	void clearRoutingTable();
+	void clearDryRoutingTable();
+	
 	std::list< RoutingTableEntry > rTable;
+	std::list< RoutingTableEntry > dryTable;
 };
 
 #endif
diff --git a/nlsr_rtc.cpp b/nlsr_rtc.cpp
new file mode 100644
index 0000000..fecc6bc
--- /dev/null
+++ b/nlsr_rtc.cpp
@@ -0,0 +1,69 @@
+#include <iostream>
+#include "nlsr_lsdb.hpp"
+#include "nlsr_rtc.hpp"
+#include "nlsr_map.hpp"
+#include "nlsr_lsa.hpp"
+#include "nlsr.hpp"
+
+using namespace std;
+
+void 
+RoutingTableCalculator::allocateAdjMatrix()
+{
+	adjMatrix = new double*[numOfRouter];
+	for(int i = 0; i < numOfRouter; ++i) 
+	{
+    adjMatrix[i] = new double[numOfRouter];
+	}
+}
+
+void
+RoutingTableCalculator::makeAdjMatrix(nlsr& pnlsr, Map pMap)
+{
+	std::list<AdjLsa> adjLsdb=pnlsr.getLsdb().getAdjLsdb();
+	for( std::list<AdjLsa>::iterator it=adjLsdb.begin(); 
+	                                                 it!= adjLsdb.end() ; it++)
+	{
+		string linkStartRouter=(*it).getOrigRouter();
+		int row=pMap.getMappingNoByRouterName(linkStartRouter);
+		std::list<Adjacent> adl=(*it).getAdl().getAdjList();
+		for( std::list<Adjacent>::iterator itAdl=adl.begin(); 
+																								itAdl!= adl.end() ; itAdl++)
+		{
+			string linkEndRouter=(*itAdl).getAdjacentName();
+			int col=pMap.getMappingNoByRouterName(linkEndRouter);
+			double cost=(*itAdl).getLinkCost();
+			if ( (row >= 0 && row<numOfRouter) && (col >= 0 && col<numOfRouter) )
+			{
+				adjMatrix[row][col]=cost;
+			}
+		}
+		
+	}
+}
+
+void 
+RoutingTableCalculator::freeAdjMatrix()
+{
+	for(int i = 0; i < numOfRouter; ++i) 
+	{
+    	delete [] adjMatrix[i];
+	}
+	delete [] adjMatrix;
+}
+
+void
+LinkStateRoutingTableCalculator::calculatePath(Map& pMap, RoutingTable& rt, nlsr& pnlsr)
+{
+}
+
+void
+HypRoutingTableCalculator::calculatePath(Map& pMap, RoutingTable& rt, nlsr& pnlsr)
+{
+}
+
+void
+HypDryRoutingTableCalculator::calculatePath(Map& pMap, RoutingTable& rt, nlsr& pnlsr)
+{
+}
+
diff --git a/nlsr_rtc.hpp b/nlsr_rtc.hpp
new file mode 100644
index 0000000..5b5cc3b
--- /dev/null
+++ b/nlsr_rtc.hpp
@@ -0,0 +1,72 @@
+#ifndef NLSR_RTC_HPP
+#define NLSR_RTC_HPP
+
+#include <list>
+#include <iostream>
+
+
+
+class Map;
+class RoutingTable;
+class nlsr;
+
+
+using namespace std;
+
+class RoutingTableCalculator
+{
+public:
+	RoutingTableCalculator()
+	{
+	}
+	RoutingTableCalculator(int rn)
+	{
+		numOfRouter=rn;
+	}
+
+	void allocateAdjMatrix();
+	void makeAdjMatrix(nlsr& pnlsr,Map pMap);
+	void freeAdjMatrix();
+
+protected:
+	double ** adjMatrix;
+	int numOfRouter;
+};
+
+class LinkStateRoutingTableCalculator: public RoutingTableCalculator
+{
+public:
+	LinkStateRoutingTableCalculator(int rn)
+	{
+		numOfRouter=rn;
+	}
+
+	void calculatePath(Map& pMap, RoutingTable& rt, nlsr& pnlsr);
+
+};
+
+class HypRoutingTableCalculator: public RoutingTableCalculator
+{
+public:
+	HypRoutingTableCalculator(int rn)
+	{
+		numOfRouter=rn;
+	}
+
+	void calculatePath(Map& pMap, RoutingTable& rt, nlsr& pnlsr);
+
+};
+
+class HypDryRoutingTableCalculator: public RoutingTableCalculator
+{
+	public:
+	HypDryRoutingTableCalculator(int rn)
+	{
+		numOfRouter=rn;
+	}
+
+	void calculatePath(Map& pMap, RoutingTable& rt, nlsr& pnlsr);
+
+};
+
+#endif
diff --git a/nlsr_rte.hpp b/nlsr_rte.hpp
index eeaf48c..6f64836 100644
--- a/nlsr_rte.hpp
+++ b/nlsr_rte.hpp
@@ -17,6 +17,10 @@
 		
 	}
 
+	~RoutingTableEntry()
+	{
+	}
+
 	RoutingTableEntry(string dest)
 		: nhl()
 	{
