Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Algorithms
  4. Special minimum spanning tree

Special minimum spanning tree

Scheduled Pinned Locked Moved Algorithms
data-structures
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Andy Oct2021
    wrote on last edited by
    #1

    All algorithms for MST I meet, uses indirect graph and search minimum weight. I need a bit other: my graph is directed, weights are unimportant, all are = 1. Is not necessary find minimal tree, but ANY tree without cycles, although tree with minimal number of edges will be nice. Most important is - graph must be directed.

    A A 2 Replies Last reply
    0
    • A Andy Oct2021

      All algorithms for MST I meet, uses indirect graph and search minimum weight. I need a bit other: my graph is directed, weights are unimportant, all are = 1. Is not necessary find minimal tree, but ANY tree without cycles, although tree with minimal number of edges will be nice. Most important is - graph must be directed.

      A Offline
      A Offline
      Andy Oct2021
      wrote on last edited by
      #2

      Problem is with directed graph, because is possible many vertex links to one. It is reverse tree. This means,that is impossible leaving spanning tree. Question is another: how detect cycles and remove all cycles?

      1 Reply Last reply
      0
      • A Andy Oct2021

        All algorithms for MST I meet, uses indirect graph and search minimum weight. I need a bit other: my graph is directed, weights are unimportant, all are = 1. Is not necessary find minimal tree, but ANY tree without cycles, although tree with minimal number of edges will be nice. Most important is - graph must be directed.

        A Offline
        A Offline
        akratirawat
        wrote on last edited by
        #3

        #include
        #include
        int a,b,u,v,n,i,j,ne=1;
        int visited[10]= {
        0
        }
        ,min,mincost=0,cost[10][10];
        void main() {
        clrscr();
        printf("\n Enter the number of nodes:");
        scanf("%d",&n);
        printf("\n Enter the adjacency matrix:\n");
        for (i=1;i<=n;i++)
        for (j=1;j<=n;j++) {
        scanf("%d",&cost[i][j]);
        if(cost[i][j]==0)
        cost[i][j]=999;
        }
        visited[1]=1;
        printf("\n");
        while(ne

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups