@@ -1539,12 +1539,14 @@ SCIP_RETCODE SCIPcomputeSymgraphColors(
1539
1539
{
1540
1540
SCIPsort (perm , SYMsortEdges , (void * ) graph , graph -> nedges );
1541
1541
1542
- /* check whether edges are colored; due to sorting, only check first edge */
1543
- if ( SCIPisInfinity (scip , graph -> edgevals [perm [0 ]]) )
1542
+ /* check for uncolored or uniformly colored edges, which is easy due to sorting */
1543
+ if ( SCIPisInfinity (scip , graph -> edgevals [perm [0 ]]) ||
1544
+ SCIPisEQ (scip , graph -> edgevals [perm [0 ]], graph -> edgevals [perm [graph -> nedges - 1 ]]) )
1544
1545
{
1545
- /* all edges are uncolored */
1546
+ /* when all edges are uncolored or uniformly colored, we can ignore edge colors */
1547
+ graph -> uniqueedgetype = TRUE;
1546
1548
for ( i = 0 ; i < graph -> nedges ; ++ i )
1547
- graph -> edgecolors [perm [ i ] ] = -1 ;
1549
+ graph -> edgecolors [i ] = -1 ;
1548
1550
}
1549
1551
else
1550
1552
{
@@ -1567,10 +1569,6 @@ SCIP_RETCODE SCIPcomputeSymgraphColors(
1567
1569
prevval = thisval ;
1568
1570
}
1569
1571
1570
- /* check whether all edges are equivalent */
1571
- if ( i == graph -> nedges && graph -> edgecolors [perm [0 ]] == graph -> edgecolors [perm [i - 1 ]] )
1572
- graph -> uniqueedgetype = TRUE;
1573
-
1574
1572
/* assign uncolored edges color -1 */
1575
1573
for ( ; i < graph -> nedges ; ++ i )
1576
1574
graph -> edgecolors [perm [i ]] = -1 ;
0 commit comments