You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Marco Speranza (Created) (JIRA)" <ji...@apache.org> on 2012/01/30 23:29:15 UTC

[jira] [Created] (SANDBOX-374) Kruskal's algorithm doesn't accept sparse graph

Kruskal's algorithm doesn't accept sparse graph
-----------------------------------------------

                 Key: SANDBOX-374
                 URL: https://issues.apache.org/jira/browse/SANDBOX-374
             Project: Commons Sandbox
          Issue Type: Bug
          Components: Graph
            Reporter: Marco Speranza


Hi guys,

I found a little problem into Kruskal's algorithm when the input graph is not connected and/or  it's a graph without the edges.

I created a test case that produces the follow error:

{code}
Running org.apache.commons.graph.spanning.KruskalTestCase
Tests run: 2, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.096 sec <<< FAILURE!
verifyNotConnectedMinimumSpanningTree(org.apache.commons.graph.spanning.KruskalTestCase)  Time elapsed: 0.007 sec  <<< ERROR!
java.util.NoSuchElementException
        at java.util.AbstractQueue.remove(AbstractQueue.java:90)
        at org.apache.commons.graph.spanning.DefaultSpanningTreeAlgorithmSelector.applyingKruskalAlgorithm(DefaultSpanningTreeAlgorithmSelector.java:87)
{code}


ciao
Marco

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (SANDBOX-374) Kruskal's algorithm doesn't accept sparse graph

Posted by "Marco Speranza (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SANDBOX-374?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Marco Speranza updated SANDBOX-374:
-----------------------------------

    Attachment: SANDBOX-374-Kruskal-NotConnectGraph_problem.patch

Hi here is a patch that resolve the problem and the relative test case.

ciao
                
> Kruskal's algorithm doesn't accept sparse graph
> -----------------------------------------------
>
>                 Key: SANDBOX-374
>                 URL: https://issues.apache.org/jira/browse/SANDBOX-374
>             Project: Commons Sandbox
>          Issue Type: Bug
>          Components: Graph
>            Reporter: Marco Speranza
>         Attachments: SANDBOX-374-Kruskal-NotConnectGraph_problem.patch
>
>
> Hi guys,
> I found a little problem into Kruskal's algorithm when the input graph is not connected and/or  it's a graph without the edges.
> I created a test case that produces the follow error:
> {code}
> Running org.apache.commons.graph.spanning.KruskalTestCase
> Tests run: 2, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.096 sec <<< FAILURE!
> verifyNotConnectedMinimumSpanningTree(org.apache.commons.graph.spanning.KruskalTestCase)  Time elapsed: 0.007 sec  <<< ERROR!
> java.util.NoSuchElementException
>         at java.util.AbstractQueue.remove(AbstractQueue.java:90)
>         at org.apache.commons.graph.spanning.DefaultSpanningTreeAlgorithmSelector.applyingKruskalAlgorithm(DefaultSpanningTreeAlgorithmSelector.java:87)
> {code}
> ciao
> Marco

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (SANDBOX-374) Kruskal's algorithm doesn't accept sparse graph

Posted by "Simone Tripodi (Resolved) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SANDBOX-374?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Simone Tripodi resolved SANDBOX-374.
------------------------------------

    Resolution: Fixed
      Assignee: Simone Tripodi

fixed on r1238355, thanks!
                
> Kruskal's algorithm doesn't accept sparse graph
> -----------------------------------------------
>
>                 Key: SANDBOX-374
>                 URL: https://issues.apache.org/jira/browse/SANDBOX-374
>             Project: Commons Sandbox
>          Issue Type: Bug
>          Components: Graph
>            Reporter: Marco Speranza
>            Assignee: Simone Tripodi
>         Attachments: SANDBOX-374-Kruskal-NotConnectGraph_problem.patch
>
>
> Hi guys,
> I found a little problem into Kruskal's algorithm when the input graph is not connected and/or  it's a graph without the edges.
> I created a test case that produces the follow error:
> {code}
> Running org.apache.commons.graph.spanning.KruskalTestCase
> Tests run: 2, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.096 sec <<< FAILURE!
> verifyNotConnectedMinimumSpanningTree(org.apache.commons.graph.spanning.KruskalTestCase)  Time elapsed: 0.007 sec  <<< ERROR!
> java.util.NoSuchElementException
>         at java.util.AbstractQueue.remove(AbstractQueue.java:90)
>         at org.apache.commons.graph.spanning.DefaultSpanningTreeAlgorithmSelector.applyingKruskalAlgorithm(DefaultSpanningTreeAlgorithmSelector.java:87)
> {code}
> ciao
> Marco

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira