Active Inference for Graph Exploration and Searching in Unknown Environments