Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3313966
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T22:10:36+00:00 2026-05-17T22:10:36+00:00

A similar question is posted here . I have an undirected graph with Vertex

  • 0

A similar question is posted here.

I have an undirected graph with Vertex V and Edge E. I am looking for an algorithm to identify all the cycle bases in that graph. An example of such a graph is shown below:

alt text

Now, all the vertex coordinates are known ( unlike previous question, and contrary to the explanation in the above diagram), therefore it is possible to find the smallest cycles that encompass the whole graph.

In this graph, it is possible that there are edges that don’t form any cycles.

What is the best algorithm to do this?

Here’s another example that you can take a look at:

Assuming that e1 is the edge that gets picked first, and the arrow shows the direction of the edge.

  • 1 1 Answer
  • 2 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T22:10:37+00:00Added an answer on May 17, 2026 at 10:10 pm

    I haven’t tried this and it is rather greedy but should work:

    1. Pick one node
    2. Go to one it’s neighbors’s
    3. Keep on going until you get back to your starting node, but you’re not allowed to visit an old node.
    4. If you get a cycle save it if it doesn’t already exist or a subset of those node make up a cycle. If the node in the cycle is a subset of the nodes in another cycle remove the larger cycle (or maybe split it in two?)
    5. Start over at 2 with a new neighbor.
    6. Start over at 1 with a new node.

    Comments: At 3 you should of course do the same thing as for step 2, so take all possible paths.

    Maybe that’s a start? As I said, I haven’t tried it so it is not optimized.

    EDIT: An undocumented and not optimized version of one implementation of the algorithm can be found here: https://gist.github.com/750015. But, it doesn’t solve the solution completely since it can only recognize “true” subsets.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Stumped here. Posted a similar question before. We have a pretty large WPF app
I have a similar question to the one posted here: I have an if
i have already posted a similar question here, but failed to get a response
I'm trying to solve interviewstreet's median challenge. I saw a similar question posted here:
I saw a similar question being posted here, yet it did not help me
I know that this question is very similar to the question posted here .
I've posted similar question here , but it was closed because I didn't explained
I have posted similar question previously, but this time I am providing some code
I have posted a similar question before why my local object destroyed twice? but
I had posted a similar question earlier - a slightly different requirement here. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.