Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Model analysis #939

Merged
merged 20 commits into from
Dec 2, 2022
Merged

Model analysis #939

merged 20 commits into from
Dec 2, 2022

Conversation

ArthurGodet
Copy link
Collaborator

@ArthurGodet ArthurGodet commented Oct 4, 2022

Here is a proposal for the discussion #933 on model analysis. This is a first version and can still be improved.

Among ideas to improve the analysis are the following:

  • Allow for a JSON export (with more details, if useful, and if different from the Model export)
  • Allow for constraint network representation and analysis: variable-oriented graph (one node for each variable, two nodes being linked if variables are sharing a constraint) and constraint-oriented graph (one node for each constraint, two nodes being linked if constraints are sharing variables)
  • Use weighted versions of the above graphs to improve the analysis ?

Here is an example of what it does on the MarioKart example:

################################################################################################
#################################### BEGIN OF MODEL ANALYSIS ###################################
################################################################################################

################################################
############## VARIABLES ANALYSIS ##############
################################################

BoolVar
	BoolNotView = 15
		- Nb unconstrained: 2
		- By domain size: {2: 15}
		- By number of propagators: {0: 2, 1: 13}

	BoolVarImpl = 225
		- By domain size: {2: 225}
		- By number of propagators: {3: 16, 5: 27, 6: 182}
		- By number of views: {0: 210, 1: 15}

	FixedBoolVarImpl = 2
		- Nb instantiated: 2
		- Nb constants: 2
		- Nb unconstrained: 2
		- By domain size: {1: 2}


IntVar
	BitsetIntVarImpl = 73
		- By domain size: {15: 16, 533: 1, 589: 1, 603: 1, 729: 1, 785: 1, 799: 1, 883: 1, 925: 1, 953: 1, 1009: 1, 1107: 1, 1247: 1, 2001: 15, 4801: 2, 5264: 2, 5345: 2, 6107: 2, 6156: 2, 6232: 2, 6261: 2, 6278: 2, 6336: 2, 6359: 2, 6981: 2, 7183: 2, 7247: 2, 8448: 2, 8485: 2}
		- By number of propagators: {2: 58, 7: 14, 8: 1}

	FixedIntVarImpl = 2
		- Nb instantiated: 2
		- Nb constants: 2
		- Nb unconstrained: 2
		- By domain size: {1: 2}

	IntervalIntVarImpl = 4
		- By domain size: {14: 1, 16: 1, 2001: 1, 500001: 1}
		- By number of propagators: {2: 3, 4: 1}


################################################
############# CONSTRAINTS ANALYSIS #############
################################################

SumConstraint
	PropScalar = 41
		- By arity: {14: 1, 15: 40}

	PropSum = 2
		- By arity: {16: 2}

	PropSumBoolIncr = 1
		- By arity: {15: 1}


Constraint
	PropAllDiffAC = 1
		- Nb entailed: 1
		- By arity: {15: 1}

	PropAllDiffInst = 1
		- By arity: {15: 1}

	PropElement = 15
		- By arity: {2: 15}

	PropEnumDomainChanneling = 15
		- By arity: {16: 15}

	PropEqualXC = 1
		- By arity: {1: 1}

	PropEqualXY_C = 1
		- By arity: {2: 1}

	PropKLoops = 1
		- By arity: {16: 1}

	PropKnapsack = 1
		- By arity: {226: 1}

	PropKnapsackKatriel01 = 1
		- Nb entailed: 1
		- By arity: {226: 1}

	PropLargeGACSTRPos = 2
		- By arity: {14: 2}

	PropScalar = 41
		- By arity: {14: 1, 15: 40}

	PropSubcircuit = 1
		- By arity: {16: 1}

	PropSubcircuitDominatorFilter = 1
		- Nb entailed: 1
		- By arity: {15: 1}

	PropSum = 4
		- By arity: {14: 1, 15: 1, 16: 2}

	PropSumBoolIncr = 1
		- By arity: {15: 1}

	PropTrue = 2
		- Nb entailed: 2
		- Nb completely instantiated: 2
		- By arity: {0: 2}


Arithmetic
	PropEqualXC = 1
		- By arity: {1: 1}

	PropEqualXY_C = 1
		- By arity: {2: 1}


################################################################################################
##################################### END OF MODEL ANALYSIS ####################################
################################################################################################

@ArthurGodet ArthurGodet requested a review from cprudhom October 4, 2022 23:00
@ArthurGodet ArthurGodet self-assigned this Oct 4, 2022
@sonatype-lift
Copy link

sonatype-lift bot commented Oct 4, 2022

⚠️ 87 God Classes were detected by Lift in this project. Visit the Lift web console for more details.

@cprudhom
Copy link
Member

cprudhom commented Oct 5, 2022

I think this is a good first step, but before coding something maybe we can simply:

  • list some expected functionalities,
  • suggest some formatting rules (I think JSON is a good idea)

In addition, this code should certainly be defined in an other class than Model.

Can this discussion be continued in the #933?

@cprudhom
Copy link
Member

Can you share with us an example of data displayed (I think it has changed since the 1st proposal)?

@ArthurGodet
Copy link
Collaborator Author

ArthurGodet commented Oct 17, 2022

Here is an example of display for the Mario Kart example :

################################################################################################
#################################### BEGIN OF MODEL ANALYSIS ###################################
################################################################################################

################################################
######### BEGIN OF VARIABLES ANALYSIS ##########
################################################

BoolVar
    BoolNotView = 15
        - Nb instantiated: 0
        - Nb constants: 0
        - Nb unconstrained: 2
        - By domain size: {2: 15}
        - By number of propagators: {0: 2, 1: 13}
        - By number of views: {0: 15}

    BoolVarImpl = 225
        - Nb instantiated: 0
        - Nb constants: 0
        - Nb unconstrained: 0
        - By domain size: {2: 225}
        - By number of propagators: {3: 16, 5: 27, 6: 182}
        - By number of views: {0: 210, 1: 15}

    FixedBoolVarImpl = 2
        - Nb instantiated: 2
        - Nb constants: 2
        - Nb unconstrained: 2
        - By domain size: {1: 2}
        - By number of propagators: {0: 2}
        - By number of views: {0: 2}


IntVar
    BitsetIntVarImpl = 73
        - Nb instantiated: 0
        - Nb constants: 0
        - Nb unconstrained: 0
        - By domain size: {10-100: 16, 101-1000: 9, >1001: 48}
        - By number of propagators: {2: 58, 7: 14, 8: 1}
        - By number of views: {0: 73}

    FixedIntVarImpl = 2
        - Nb instantiated: 2
        - Nb constants: 2
        - Nb unconstrained: 2
        - By domain size: {1: 2}
        - By number of propagators: {0: 2}
        - By number of views: {0: 2}

    IntervalIntVarImpl = 4
        - Nb instantiated: 0
        - Nb constants: 0
        - Nb unconstrained: 0
        - By domain size: {10-100: 2, >1001: 2}
        - By number of propagators: {2: 3, 4: 1}
        - By number of views: {0: 4}


################################################
########## END OF VARIABLES ANALYSIS ###########
################################################


################################################
######### BEGIN OF CONSTRAINTS ANALYSIS ########
################################################

ARITHM
    PropEqualXC = 1
        - Nb entailed: 0
        - Nb passive: 0
        - Nb completely instantiated: 0
        - Nb reified: 0
        - By arity: {1: 1}

    PropEqualXY_C = 1
        - Nb entailed: 0
        - Nb passive: 0
        - Nb completely instantiated: 0
        - Nb reified: 0
        - By arity: {2: 1}


BOOLCHANNELING
    PropEnumDomainChanneling = 15
        - Nb entailed: 0
        - Nb passive: 0
        - Nb completely instantiated: 0
        - Nb reified: 0
        - By arity: {16: 15}


ELEMENT
    PropElement = 15
        - Nb entailed: 0
        - Nb passive: 0
        - Nb completely instantiated: 0
        - Nb reified: 0
        - By arity: {2: 15}


KNAPSACK
    PropKnapsack = 1
        - Nb entailed: 0
        - Nb passive: 0
        - Nb completely instantiated: 0
        - Nb reified: 0
        - By arity: {226: 1}

    PropKnapsackKatriel01 = 1
        - Nb entailed: 1
        - Nb passive: 0
        - Nb completely instantiated: 0
        - Nb reified: 0
        - By arity: {226: 1}

    PropSum = 2
        - Nb entailed: 0
        - Nb passive: 0
        - Nb completely instantiated: 0
        - Nb reified: 0
        - By arity: {14: 1, 15: 1}


SUBCIRCUIT
    PropAllDiffAC = 1
        - Nb entailed: 1
        - Nb passive: 0
        - Nb completely instantiated: 0
        - Nb reified: 0
        - By arity: {15: 1}

    PropAllDiffInst = 1
        - Nb entailed: 0
        - Nb passive: 0
        - Nb completely instantiated: 0
        - Nb reified: 0
        - By arity: {15: 1}

    PropKLoops = 1
        - Nb entailed: 0
        - Nb passive: 0
        - Nb completely instantiated: 0
        - Nb reified: 0
        - By arity: {16: 1}

    PropSubcircuit = 1
        - Nb entailed: 0
        - Nb passive: 0
        - Nb completely instantiated: 0
        - Nb reified: 0
        - By arity: {16: 1}

    PropSubcircuitDominatorFilter = 1
        - Nb entailed: 1
        - Nb passive: 0
        - Nb completely instantiated: 0
        - Nb reified: 0
        - By arity: {15: 1}


SUM
    PropScalar = 41
        - Nb entailed: 0
        - Nb passive: 0
        - Nb completely instantiated: 0
        - Nb reified: 0
        - By arity: {14: 1, 15: 40}

    PropSum = 2
        - Nb entailed: 0
        - Nb passive: 0
        - Nb completely instantiated: 0
        - Nb reified: 0
        - By arity: {16: 2}

    PropSumBoolIncr = 1
        - Nb entailed: 0
        - Nb passive: 0
        - Nb completely instantiated: 0
        - Nb reified: 0
        - By arity: {15: 1}


TABLE
    PropLargeGACSTRPos = 2
        - Nb entailed: 0
        - Nb passive: 0
        - Nb completely instantiated: 0
        - Nb reified: 0
        - By arity: {14: 2}


TRUE
    PropTrue = 2
        - Nb entailed: 2
        - Nb passive: 0
        - Nb completely instantiated: 2
        - Nb reified: 0
        - By arity: {0: 2}


################################################
########## END OF CONSTRAINTS ANALYSIS #########
################################################

################################################################################################
##################################### END OF MODEL ANALYSIS ####################################
################################################################################################

@ArthurGodet
Copy link
Collaborator Author

And here is the associated JSON file :

{
    "varsTypeStats" : [
        {
            "varType" : "BoolVar",
            "classVarType" : "BoolNotView",
            "nbVariables" : 15,
            "nbInstantiatedVariables" : 0,
            "nbConstantVariables" : 0,
            "byDomainSize" : {
                "2" : 15
            },
            "byNbPropagators" : {
                "0" : 2,
                "1" : 13
            },
            "byNbViews" : {
                "0" : 15
            }
        },
        {
            "varType" : "BoolVar",
            "classVarType" : "BoolVarImpl",
            "nbVariables" : 225,
            "nbInstantiatedVariables" : 0,
            "nbConstantVariables" : 0,
            "byDomainSize" : {
                "2" : 225
            },
            "byNbPropagators" : {
                "3" : 16,
                "5" : 27,
                "6" : 182
            },
            "byNbViews" : {
                "0" : 210,
                "1" : 15
            }
        },
        {
            "varType" : "BoolVar",
            "classVarType" : "FixedBoolVarImpl",
            "nbVariables" : 2,
            "nbInstantiatedVariables" : 2,
            "nbConstantVariables" : 2,
            "byDomainSize" : {
                "1" : 2
            },
            "byNbPropagators" : {
                "0" : 2
            },
            "byNbViews" : {
                "0" : 2
            }
        },
        {
            "varType" : "IntVar",
            "classVarType" : "BitsetIntVarImpl",
            "nbVariables" : 73,
            "nbInstantiatedVariables" : 0,
            "nbConstantVariables" : 0,
            "byDomainSize" : {
                "10-100" : 16,
                "101-1000" : 9,
                ">1001" : 48
            },
            "byNbPropagators" : {
                "2" : 58,
                "7" : 14,
                "8" : 1
            },
            "byNbViews" : {
                "0" : 73
            }
        },
        {
            "varType" : "IntVar",
            "classVarType" : "FixedIntVarImpl",
            "nbVariables" : 2,
            "nbInstantiatedVariables" : 2,
            "nbConstantVariables" : 2,
            "byDomainSize" : {
                "1" : 2
            },
            "byNbPropagators" : {
                "0" : 2
            },
            "byNbViews" : {
                "0" : 2
            }
        },
        {
            "varType" : "IntVar",
            "classVarType" : "IntervalIntVarImpl",
            "nbVariables" : 4,
            "nbInstantiatedVariables" : 0,
            "nbConstantVariables" : 0,
            "byDomainSize" : {
                "10-100" : 2,
                ">1001" : 2
            },
            "byNbPropagators" : {
                "2" : 3,
                "4" : 1
            },
            "byNbViews" : {
                "0" : 4
            }
        }
    ],
    "cstrsTypeStats" : [
        {
            "cstrType" : "ARITHM",
            "propType" : "PropEqualXC",
            "nbPropagators" : 1,
            "nbEntailedPropagators" : 0,
            "nbPassivePropagators" : 0,
            "nbCompletelyInstantiatedPropagators" : 0,
            "nbReifiedPropagators" : 0,
            "byArity" : {
                "1" : 1
            }
        },
        {
            "cstrType" : "ARITHM",
            "propType" : "PropEqualXY_C",
            "nbPropagators" : 1,
            "nbEntailedPropagators" : 0,
            "nbPassivePropagators" : 0,
            "nbCompletelyInstantiatedPropagators" : 0,
            "nbReifiedPropagators" : 0,
            "byArity" : {
                "2" : 1
            }
        },
        {
            "cstrType" : "BOOLCHANNELING",
            "propType" : "PropEnumDomainChanneling",
            "nbPropagators" : 15,
            "nbEntailedPropagators" : 0,
            "nbPassivePropagators" : 0,
            "nbCompletelyInstantiatedPropagators" : 0,
            "nbReifiedPropagators" : 0,
            "byArity" : {
                "16" : 15
            }
        },
        {
            "cstrType" : "ELEMENT",
            "propType" : "PropElement",
            "nbPropagators" : 15,
            "nbEntailedPropagators" : 0,
            "nbPassivePropagators" : 0,
            "nbCompletelyInstantiatedPropagators" : 0,
            "nbReifiedPropagators" : 0,
            "byArity" : {
                "2" : 15
            }
        },
        {
            "cstrType" : "KNAPSACK",
            "propType" : "PropKnapsack",
            "nbPropagators" : 1,
            "nbEntailedPropagators" : 0,
            "nbPassivePropagators" : 0,
            "nbCompletelyInstantiatedPropagators" : 0,
            "nbReifiedPropagators" : 0,
            "byArity" : {
                "226" : 1
            }
        },
        {
            "cstrType" : "KNAPSACK",
            "propType" : "PropKnapsackKatriel01",
            "nbPropagators" : 1,
            "nbEntailedPropagators" : 1,
            "nbPassivePropagators" : 0,
            "nbCompletelyInstantiatedPropagators" : 0,
            "nbReifiedPropagators" : 0,
            "byArity" : {
                "226" : 1
            }
        },
        {
            "cstrType" : "KNAPSACK",
            "propType" : "PropSum",
            "nbPropagators" : 2,
            "nbEntailedPropagators" : 0,
            "nbPassivePropagators" : 0,
            "nbCompletelyInstantiatedPropagators" : 0,
            "nbReifiedPropagators" : 0,
            "byArity" : {
                "14" : 1,
                "15" : 1
            }
        },
        {
            "cstrType" : "SUBCIRCUIT",
            "propType" : "PropAllDiffAC",
            "nbPropagators" : 1,
            "nbEntailedPropagators" : 1,
            "nbPassivePropagators" : 0,
            "nbCompletelyInstantiatedPropagators" : 0,
            "nbReifiedPropagators" : 0,
            "byArity" : {
                "15" : 1
            }
        },
        {
            "cstrType" : "SUBCIRCUIT",
            "propType" : "PropAllDiffInst",
            "nbPropagators" : 1,
            "nbEntailedPropagators" : 0,
            "nbPassivePropagators" : 0,
            "nbCompletelyInstantiatedPropagators" : 0,
            "nbReifiedPropagators" : 0,
            "byArity" : {
                "15" : 1
            }
        },
        {
            "cstrType" : "SUBCIRCUIT",
            "propType" : "PropKLoops",
            "nbPropagators" : 1,
            "nbEntailedPropagators" : 0,
            "nbPassivePropagators" : 0,
            "nbCompletelyInstantiatedPropagators" : 0,
            "nbReifiedPropagators" : 0,
            "byArity" : {
                "16" : 1
            }
        },
        {
            "cstrType" : "SUBCIRCUIT",
            "propType" : "PropSubcircuit",
            "nbPropagators" : 1,
            "nbEntailedPropagators" : 0,
            "nbPassivePropagators" : 0,
            "nbCompletelyInstantiatedPropagators" : 0,
            "nbReifiedPropagators" : 0,
            "byArity" : {
                "16" : 1
            }
        },
        {
            "cstrType" : "SUBCIRCUIT",
            "propType" : "PropSubcircuitDominatorFilter",
            "nbPropagators" : 1,
            "nbEntailedPropagators" : 1,
            "nbPassivePropagators" : 0,
            "nbCompletelyInstantiatedPropagators" : 0,
            "nbReifiedPropagators" : 0,
            "byArity" : {
                "15" : 1
            }
        },
        {
            "cstrType" : "SUM",
            "propType" : "PropScalar",
            "nbPropagators" : 41,
            "nbEntailedPropagators" : 0,
            "nbPassivePropagators" : 0,
            "nbCompletelyInstantiatedPropagators" : 0,
            "nbReifiedPropagators" : 0,
            "byArity" : {
                "14" : 1,
                "15" : 40
            }
        },
        {
            "cstrType" : "SUM",
            "propType" : "PropSum",
            "nbPropagators" : 2,
            "nbEntailedPropagators" : 0,
            "nbPassivePropagators" : 0,
            "nbCompletelyInstantiatedPropagators" : 0,
            "nbReifiedPropagators" : 0,
            "byArity" : {
                "16" : 2
            }
        },
        {
            "cstrType" : "SUM",
            "propType" : "PropSumBoolIncr",
            "nbPropagators" : 1,
            "nbEntailedPropagators" : 0,
            "nbPassivePropagators" : 0,
            "nbCompletelyInstantiatedPropagators" : 0,
            "nbReifiedPropagators" : 0,
            "byArity" : {
                "15" : 1
            }
        },
        {
            "cstrType" : "TABLE",
            "propType" : "PropLargeGACSTRPos",
            "nbPropagators" : 2,
            "nbEntailedPropagators" : 0,
            "nbPassivePropagators" : 0,
            "nbCompletelyInstantiatedPropagators" : 0,
            "nbReifiedPropagators" : 0,
            "byArity" : {
                "14" : 2
            }
        },
        {
            "cstrType" : "TRUE",
            "propType" : "PropTrue",
            "nbPropagators" : 2,
            "nbEntailedPropagators" : 2,
            "nbPassivePropagators" : 0,
            "nbCompletelyInstantiatedPropagators" : 2,
            "nbReifiedPropagators" : 0,
            "byArity" : {
                "0" : 2
            }
        }
    ]
}

@ArthurGodet
Copy link
Collaborator Author

Once we all agree on the format, I still need to add some documentation and comments in the code to help use the ModelAnalyser (most especially as printing can be parameterised)

@cprudhom
Copy link
Member

Thank you for the trace, it is easier to get an idea on the result.

IntVar
    BitsetIntVarImpl = 73
        - Nb instantiated: 0
        - Nb constants: 0
        - Nb unconstrained: 0
        - By domain size: {10-100: 16, 101-1000: 9, >1001: 48}
        - By number of propagators: {2: 58, 7: 14, 8: 1}
        - By number of views: {0: 73}
...

I think Nb constants is redundant with FixedIntVarImpl (well, that's because I know that those objects represent constant).
Otherwise, that quite readable and informative !

Copy link
Member

@cprudhom cprudhom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm just questioning the new dependency. I don't want the jar fie to be too big

@@ -651,6 +657,13 @@ public Settings getSettings() {
return this.settings;
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Javadoc is missing

solver/pom.xml Outdated
@@ -47,6 +47,11 @@
<artifactId>xchart</artifactId>
<version>3.8.1</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't adding this dependency increase the size of the final jar too much?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we do not need to embed the serialization inside choco-solver

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I guess we can let the user choose its own way of serializing the ModelAnalysis object.

}

public void printVariableAnalysis(PrintStream ps) {
ps.println("################################################");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not a huge fan of these long tags.
I would prefer something more discreet :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What would you suggest ? The idea was to make sure it was distinguishing from other prints, but I know it might not be the tast of everyone.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some time ago I added a Logger attached to Solver which can either print log with ANSI colors or not.
So I suggest to add colored tags:

solver.log().green().println("Variable analysis");

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated the ModelAnalyser printings using Solver.log(). Beginning of analysis are in green, types of constraints/variables in blue, and end of analysis in red.

}
}

public static class ModelAnalyserJson {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would not use "Json" in the class name.
You can serialize it into json, but you don't have to.

Also maybe ModelAnalysis is more appropriate than ModelAnalyser

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, ModelAnalysis is a more appropriate name for this class. I am changing it right away.

/////////////////////////////////////////////// JSON EXPORT ////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

private static void toFile(String path, Object toWrite) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe this and the jackson dependency do not need to belong to choco-solver
(but would be put in the project that uses it)

@ArthurGodet
Copy link
Collaborator Author

Thank you for the trace, it is easier to get an idea on the result.

IntVar
    BitsetIntVarImpl = 73
        - Nb instantiated: 0
        - Nb constants: 0
        - Nb unconstrained: 0
        - By domain size: {10-100: 16, 101-1000: 9, >1001: 48}
        - By number of propagators: {2: 58, 7: 14, 8: 1}
        - By number of views: {0: 73}
...

I think Nb constants is redundant with FixedIntVarImpl (well, that's because I know that those objects represent constant). Otherwise, that quite readable and informative !

Yes, given the current structure I gave to the analysis objects, the nbConstants statistics is never useful. I will remove it for now.

@ArthurGodet
Copy link
Collaborator Author

I have added the graph model analysis, using GraphViz format. Sadly, the graphs are not always easy to read as edges might be numerous and hide nodes.

}
}

private static class Graph<T> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, Gephi output should be removed too or be preferred to GraphViz (well, Gephi can read DOT files)?
https://github.com/chocoteam/choco-solver/blob/master/solver/src/main/java/org/chocosolver/solver/trace/IOutputFactory.java#L354

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code in ModelAnalyser is a bit redundant with the one in GraphvizGenerator, but it is necessary as the one in GraphvizGenerator is inheriting from the specificities of Searchviz.

I guess that, in order to avoid redundancy in code, we could implement a generic API to generate files for graphviz and Gephi. What do you think ? Should we keep the code as it is now, or should we implement this generic API and update the two use cases ?

@ArthurGodet ArthurGodet changed the title WIP: Model analysis Model analysis Nov 14, 2022
cprudhom
cprudhom previously approved these changes Nov 18, 2022
@mergify mergify bot dismissed cprudhom’s stale review November 18, 2022 09:02

Pull request has been modified.

@cprudhom
Copy link
Member

I think we can merge this PR and use it.
We can then make improvements later.
@jgFages @ArthurGodet do you agree?

@cprudhom cprudhom added this to the 4.10.11 milestone Dec 2, 2022
@cprudhom cprudhom merged commit 885b347 into master Dec 2, 2022
@cprudhom cprudhom deleted the modelAnalysis branch December 2, 2022 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants