It surprised me to learn that algorithms can be patented. If that's the case, why aren't famous algorithms like Dijkstra's algorithm patented? More importantly, how would they be enforced - wouldn't you need to look at the source code of all suspicious programs?
I think you've hit on a good point for those considering pursuing patents. Before investing large sums of money on patenting, it is important to figure out how you will identify infringement.
Often, product data sheets, technical specifications, user guides, administrator guides, white papers, case studies and/or other technical and marketing literature are of use, but other times the under-the-hood details are unavailable and reverse engineering and/or discovery is required to confirm infringement.
In general, I recommend considering at least the following factors in connection with performing a cost/benefit analysis before pursuing a particular patent: