Today, with the emergence of semantic web technologies and increasing of information quantity, searching for information based on the semantic web has become a fertile area of research. For this reason, a large number of studies are performed based on the measure of semantic similarity. Therefore, in this paper, we propose a new method of semantic similarity measuring which uses the dynamic programming to compute the semantic distance between any two concepts defined in the same hierarchy of ontology. Then, we base on this result to compute the semantic similarity. Finally, we present an experimental comparison between our method and other methods of similarity measuring. Where we will show the limits of these methods and how we avoid them with our method. This one bases on a function of weight allocation, which allows finding different rate of semantic similarity between a given concept and two other sibling concepts which is impossible using the other methods.