g
2
o: A general Framework for (Hyper) Graph Optimization
Giorgio Grisetti, Rainer K¨ummerle, Hauke Strasdat, Kurt Konolige
email: {grisetti,kuemmerl}@informatik.uni-freiburg.de
strasdat@gmail.com konolige@willowgarage.com
March 11, 2017
In this document we describe a C++ framework for performing the optimization of nonlinear least
squares problems that can be embedded as a graph or in a hyper-graph. A hyper-graph is an extension
of a graph where an edge can connect multiple nod e s and not only two. Several problems in robotics and
in computer vision require to find the optimum of an error function with respect of a set of parameter s .
Examples include, popular applications like SLAM and Bundle adjustment.
In the literature, many approaches have been proposed to address this class of problems. The naive
implementation of standard methods, like Levenberg-Marquardt or Gauss -Ne wton can lead to acceptable
results for most applications, when the correct parameterization is chosen. However, to achieve the
maximum performances substantial efforts might b e required.
g
2
o stand s for General (Hyper) Graph Optimization. The purposes of this framework are the follow-
ing:
• To provide an easy-to-extend and easy-to-use general library for graph optimization that can be
easily applied to different problems,
• To provide p eopl e who want to understand SLAM or BA with an easy-to-read implementation that
focuses on the relevant details of the problem specification.
• Achieve state-of-the-art per for mance s , while being as general as possible.
In the remainder of this do cu ment we will first characterize the (hyper) graph-embeddable problems,
and we will give an introduction to their solution via the popular Levenberg-Marquardt or Gauss-Newton
algorithms implemented in this library. Subsequently, we will describe the high-level behavior of the
library, and the basic structures. Finally, we will introduce how to implement 2D SLAM as a simple
example.
This document is not a replacement for the in-line do cu mentation. Instead, it is a d i gest
to help the user/reader to read/browse and extend the code.
Please cite this when using g
2
o:
R. K¨ummerle, G. Gr is et ti , H. Strasdat, K. Konolige, and W. Burgard. g2o: A General Framework for
Graph Optimization. In Proc. of the IEEE Int. Conf. on Robotics an d Automation (ICRA). Shanghai,
China, May 2011.
1 (Hyper)Graph-Embe ddabl e Optimization Problems
A least squares minimization problem can be described by the following equation:
F(x) =
X
k∈C
e
k
(x
k
, z
k
)
T
Ω
k
e
k
(x
k
, z
k
)
|
{z }
F
k
(1)
x
∗
= argmin
x
F(x). (2)
1