Fig 1: Graph SLAM illustration in 2D. The blue triangles represent robot poses, and the red diamonds the landmarks positions. The solid lines represent the robot motion and the dashed lines the robot measurements [source]
![]()
Where, ziis the observations or predicted measurements.
The goal is to find the Find the state x* which minimizes the error given all measurements.

![]()
A general solution is to derive the global error function and find its nulls. Then solve the problem by iterative local linearization.
- Solving via iterative linearization: Linearize the error terms around the current solution (or the initial guess). Approximate the error functions around an initial guess x via Taylor expansion.
![]()
Now compute the first derivative of the squared error function which can be set to zero and the resulting linear system can be solved. Obtain the new state and keep iterating till we obtain a new state closer to the minimum.
Intuition behind Graph SLAM
- Use a graph to represent the problem
- Every node in the graph will correspond to a pose of the robot
- Every edge between two nodes represents a spatial constraint between them
- A Graph-Based SLAM builds the graph and finds a node configuration that minimizes the error due to constraints. This best configuration will ensure that the real and predicted observations are as similar as possible.

Fig 2: Graphical explanation [source]
Algorithm Break-down
Graph SLAM algorithm involves the following steps:
- Map initialization: The map is initialized with some prior knowledge or assumptions about the environment. The robot’s initial pose estimate is also obtained through some means, such as GPS, odometry, or motion sensors. Map initialization is important to provide a starting point for the optimization algorithm and to reduce the uncertainty in the robot’s pose estimate.
- Graph construction: The robot moves in the environment and takes sensor measurements, which are used to construct the graph. Each node in the graph represents a pose estimate, and each edge represents a measurement or a motion estimate between two poses.






