Return-Path: X-Original-To: apmail-commons-issues-archive@minotaur.apache.org Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0425B6DE2 for ; Sat, 2 Jul 2011 20:22:48 +0000 (UTC) Received: (qmail 76582 invoked by uid 500); 2 Jul 2011 20:22:47 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 76447 invoked by uid 500); 2 Jul 2011 20:22:46 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 76438 invoked by uid 99); 2 Jul 2011 20:22:45 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 02 Jul 2011 20:22:45 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 02 Jul 2011 20:22:43 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id D23B4437F3A for ; Sat, 2 Jul 2011 20:22:21 +0000 (UTC) Date: Sat, 2 Jul 2011 20:22:21 +0000 (UTC) From: "Simone Tripodi (JIRA)" To: issues@commons.apache.org Message-ID: <1863002545.260.1309638141857.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <601596857.9066.1309539988439.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (SANDBOX-335) [Graph] Graph Coloring: Backtracking algorithm MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/SANDBOX-335?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13059118#comment-13059118 ] Simone Tripodi commented on SANDBOX-335: ---------------------------------------- Nice work Marco, very nice work! I have anyway some minor note I'd like you fix before applying the patch: * in the {{GraphColoringBacktraking#backtraking(int)}} the {{else}} clause can be moved outside the _else_, I think you can group the boolean clauses in just one; * just a hint/idea: in the {{GraphColoring#backTrackingColoring()}} method, can we use a {{Queue}} of colors instead of {{Lits}}? Consuming it would make easier to catch the case when available colors for the algorithm are exhausted; * in the {{GraphColoingBackTrackingTestCase#testSudokuWithConstraints()}} method you used a {{StringBuilder}} but inside the {{add(String)}} method you used the string concatenation, you can safely continue use the {{add(String)}} method instead; * javadoc for {{}} are missing in the bigger part of cases, you can copy them from {{Graph}} interface. Many thanks in advance!!! > [Graph] Graph Coloring: Backtracking algorithm > ---------------------------------------------- > > Key: SANDBOX-335 > URL: https://issues.apache.org/jira/browse/SANDBOX-335 > Project: Commons Sandbox > Issue Type: Improvement > Components: Graph > Reporter: Marco Speranza > Priority: Minor > Attachments: GraphColoring-BackTrackingAlgo-Fixed.patch, GraphColoring-BackTrackingAlgo.patch > > > Here is an little enhancement for graph coloring problem. I implemented an bruteforce algorithm that uses the backtracking technique to find the exact solution for the m-coloring problem (m is the maximum number of usable colors). -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira