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

  • Home
  • SEARCH
  • 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 3604646
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T21:01:29+00:00 2026-05-18T21:01:29+00:00

Given a directed graph, I need to find the minimum set of vertices from

  • 0

Given a directed graph, I need to find the minimum set of vertices from which all other vertices can be reached.

So the result of the function should be the smallest number of vertices, from which all other vertices can be reached by following the directed edges.

The largest result possible would be if there were no edges, so all nodes would be returned.

If there are cycles in the graph, for each cycle, one node is selected. It does not matter which one, but it should be consistent if the algorithm is run again.

I am not sure that there is an existing algorithm for this? If so does it have a name? I have tried doing my research and the closest thing seems to be finding a mother vertex
If it is that algorithm, could the actual algorithm be elaborated as the answer given in that link is kind of vague.

Given I have to implement this in javascript, the preference would be a .js library or javascript example code.

  • 1 1 Answer
  • 0 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-18T21:01:29+00:00Added an answer on May 18, 2026 at 9:01 pm

    From my understanding, this is just finding the strongly connected components in a graph. Kosaraju’s algorithm is one of the neatest approaches to do this. It uses two depth first searches as against some later algorithms that use just one, but I like it the most for its simple concept.

    Edit: Just to expand on that, the minimum set of vertices is found as was suggested in the comments to this post :
    1. Find the strongly connected components of the graph – reduce each component to a single vertex.
    2. The remaining graph is a DAG (or set of DAGs if there were disconnected components), the root(s) of which form the required set of vertices.

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

Sidebar

Related Questions

Given a weighted graph (directed or undirected) I need to find the cycle of
Given a directed graph with weighted edges, what algorithm can be used to give
I have a directed graph with millions of vertices and edges. A set of
In a directed graph with non-negative edge weights I can easily find shortest path
I can't find any way to draw a force directed graph where the weighting
I have a weighted, directed graph which is dense with around 20,000 nodes. Given
Given a directed graph, the goal is to combine the node with the nodes
Given a directed, connected graph with only positive edge weights, are there faster algorithms
Given a parameter k , I'm trying to delete k edges from a directed
I have a set of data on which I need to perform a topological

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.