The phrase "use case" is a specialized synonym for the noun "use" found in business, but it does have a specific meaning:
A business use-case instance is a sequence of actions performed in a business that produces a result of observable value to an individual actor of the business. A business use case defines a set of business use-case instances. A business use case has a name. (Source)
Whether or not you require that context is important because there are easier or clearer ways to express the ideas in your examples — if the phrase "use case" is not important. Let's begin with the assumption that it is.
The noun "use" (in the context of your question, pronounced "yus" vs. the verb, which is pronounced "yuz") is an attribute or characteristic of your algorithms. Attributes are something that belong to the object. Thus, it would be grammatically correct to say:
They are similar, but they have different use cases.
It is important to know if your use of the phrase "use case" was intentional or required. If you are trying to express the idea that the algorithms serve the same purpose, but are used in different ways, then the correction noted above is appropriate. If, however, you are trying to say that the algorithms are similar but serve different purposes, then there are simpler ways to express the idea.
If we assume you were talking about different purposes for the algorithms, then we're talking about something that invokes servitude. A "use case" is not "served," but a purpose is.
They are similar, but they serve different purposes.
More generally, you may be talking about opportunities. An opportunity suggests that while the basic result of using each algorithm is identical, each algorithm has a unique set of benefits the other does not have. If this is the case, an opportunity is something that can be given or offered.
They are similar, but they offer different opportunities.
It is worth noting that those last two examples are clear and specific, but they're also formal. They're not uncomfortable to read, but they might be unusual to read. A more common phrase in this case would be:
They are similar, but they have different uses.
Whether or not that last example is preferred over my first example depends on whether or not your audience is expecting a discussion of "use cases" or "uses."
My thanks to @Lambie for suggesting the simpler phrase, finding the definition of "use case," and encouraging this improved answer.