Evaluating Generalized Path Queries by Integrating Algebraic Path Problem Solving with Graph Pattern Matching