2

I understand that from here and the docs that find_vertex runs at O(N). I'm using the function to check if a vertex with a String property I'm adding already exists. Is this the optimal method to check if a graph already contains a vertex with a string property?

I'm trying to figure if I can use Property Maps like a dictionary to see if a string exists already before adding a vertex. Is it possible to access a Property Map by its value rather than its key since my Property Map values are unique anyway?

1 Answer 1

1

As recommended in the answer of your linked question, a faster option is to create a python dict to store string and vertex pairs. Then you only need O(1) for the check.

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

Comments

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.