Bigraphs and bigraphical reactive systems are a well-known meta-model successfully used for formalizing a wide range of models and situations, such as process calculi, service oriented architectures, multi-agent systems, biological systems, etc. A key problem in the theory and the implementations of bigraphs is how to compute embeddings , i.e., structure-preserving mappings of a given bigraph (the pattern or guest ) inside another (the target or host ). In this paper, we present an algorithm for computing embeddings for directed bigraphs, an extension of Milner's bigraphs which take into account the request directions between controls and names. This algorithm solves the embedding problem by means of a reduction to a constraint satisfaction problem . We first prove soundness and completeness of this algorithm; then we present an implementation in jLibBig , a general Java library for manipulating bigraphical reactive systems. The effectiveness of this implementation is shown by several experimental results. Finally, we show that this algorithm can be readily adapted to find the optimal embeddings in a weighted variant of the embedding problem. • We introduce an algorithm for computing embeddings of directed bigraphs. • We prove the soundness and completeness of the algorithm. • We implement the algorithm and perform an empirical evaluation of the algorithm. • We adapt the algorithm to compute optimal embeddings in a weighted variant of the embedding problem.