Assuming you're asking about computer algorithms, a system with enough historical data on heart disease could compare the current patient's profile and assess the risk based on how they compare to the numbers of those with serious heart problems in the past.