The main topic of this work is the definition and investigation of a nonlinear energy for maps with values in trees and graphs and the analysis of the corresponding nonlinear Dirichlet problem. The nonlinear energy is defined using a semigroup approach based on Markov kernels and the nonlinear Dirichlet problem is given as a minimizing problem of the nonlinear energy. Conditions for the existence and uniqueness of a solution to the nonlinear Dirichlet problem are presented. A numerical algorithm is developed to solve the nonlinear Dirichlet problem for maps from a two dimensional Euclidean domain into trees. The problem is discretized using a suitable finite element approach and convergence of a corresponding iterative numerical method is proven. Furthermore, for graph targets homotopy problems are analyzed. For particular domain spaces the existence of a minimizer of the nonlinear energy in a given homotopy class is shown