Someone once pointed out that a whole mess of hard rock tunes ultimately seemed to derive from La Bamba. You Really Got Me, Louie Louie, Blitzkrieg Bop, forget what else. Smells Like Teen Spirit of course was a takeoff on More Than A Feeling. You don't need an algorithm for this stuff. John Fogerty was famously sued by Credence's record label for ripping himself off - the ultimate in legal intervention in this instance - the case was dismissed. Haven't really heard of musical litigation since that happened in the late 80s.
I don't know what "artists" are ripping off any more; I can't remember a single chart topping melody from the last 15 years, it doesn't seem to be necessary anymore. I think the music serves other functions well now, i.e., inducing tweens to scream in delight, giving young men soundtracks for their strutting/posing, etc. Why burden it with actual tunes?