In this work, we show how to discover a semantic web service among a repository of web services. A new approach for web service discovery based on calculating the functions similarity. We define the Web service functions with Ontology Web Language (OWL). We wrote some rules for comparing two web services` parameters. Our algorithm compares the parameters of two web services` inputs/outputs by making a bipartite graph. We compute the similarity rate by using the Ford-Fulkerson algorithm. The higher the similarity, the less are the differences between their functions. At last, our algorithm chooses the service which has the highest similarity. As a consequence, our method is useful when we need to find a web service suitable to replace an existing one that has failed. Especially in autonomic systems, this situation is very common and important since we need to ensure the availability of the application which is based on the failed web service. We use Universal Description, Discovery and Integration (UDDI) compliant web service registry.