diff --git a/include/hpp/manipulation/graph/edge.hh b/include/hpp/manipulation/graph/edge.hh
index c32940fb0aa99331009d5b336db394b512b26525..1e67e6e76ad288142c7cc2efa521c89d2696fab5 100644
--- a/include/hpp/manipulation/graph/edge.hh
+++ b/include/hpp/manipulation/graph/edge.hh
@@ -75,7 +75,7 @@ namespace hpp {
           NodePtr_t from () const;
 
           /// Get the node in which path is.
-          NodePtr_t node () const;
+          virtual NodePtr_t node () const;
 
           void isInNodeFrom (bool iinf)
           {
@@ -176,6 +176,9 @@ namespace hpp {
           ///       inner nodes are named bname + "_n" + pos
           void createWaypoint (const unsigned int depth, const std::string& bname = "WaypointEdge");
 
+          /// Get the node in which path after the waypoint is.
+          NodePtr_t node () const;
+
         protected:
           /// Initialization of the object.
           void init (const EdgeWkPtr_t& weak, const GraphWkPtr_t& graph, const NodeWkPtr_t& from,
diff --git a/src/graph/edge.cc b/src/graph/edge.cc
index 57892d2354d1f8cc638270be3cad5d4403d44330..02baecd8d18ebed3df6b980826e03376deb21f91 100644
--- a/src/graph/edge.cc
+++ b/src/graph/edge.cc
@@ -240,6 +240,12 @@ namespace hpp {
         config_ = Configuration_t(graph_.lock ()->robot ()->configSize ());
       }
 
+      NodePtr_t WaypointEdge::node () const
+      {
+        if (isInNodeFrom ()) return waypoint_.second;
+        else return to ();
+      }
+
       EdgePtr_t WaypointEdge::waypoint () const
       {
         return waypoint_.first;