1

I'm wondering if I can use A* algorithm to check if the graph is K3 free?? if yes how can I do that? How can I deal with f, g , and h functions. if no what is the best algorithm to use except DFS and BFS.

Thanks

1
  • BFS. If there is K3 in graph, at least one edge will point to the vertice at the same level. Commented Mar 5, 2012 at 7:19

1 Answer 1

2

A* is not an appropriate tool for this problem. Iterate through the edges in the graph and check whether their endpoints have a neighbor in common. user482594's BFS solution fails to detect K3s consisting of vertices at equal depth in the BFS tree.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks for your answer. So which algorithm you suggest to solve this problem?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.