digraphs (version Branch: Python3.10 $)
index
/home/bisdorff/Documents/GitHub/Digraph3/pyDoc/digraphs.py

Python3+ implementation of the digraphs module, root module of the Digraph3 resources.
 
Copyright (C) 2006-2023  Raymond Bisdorff
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
 
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License along
    with this program; if not, write to the Free Software Foundation, Inc.,
    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

 
Modules
       
itertools
collections.abc
decimal
json

 
Classes
       
builtins.object
Digraph
AsymmetricPartialDigraph
BipartitePartialDigraph
BreakAddCocsDigraph
BrokenChordlessCircuitsDigraph
BrokenCocsDigraph
CSVDigraph
CirculantDigraph
CoDualDigraph
CocaDigraph
CompleteDigraph
ConverseDigraph
CoverDigraph
CriteriaCorrelationDigraph
DualDigraph
EmptyDigraph
EquivalenceDigraph
FusionDigraph
FusionLDigraph
GraphBorder
GraphInner
GridDigraph
IndeterminateDigraph
KneserDigraph
PolarisedDigraph
RedhefferDigraph
StrongComponentsCollapsedDigraph
SymmetricPartialDigraph
XMCDA2Digraph
XORDigraph
kChoicesDigraph

 
class AsymmetricPartialDigraph(Digraph)
    AsymmetricPartialDigraph(digraph)
 
Renders the asymmetric part of a Digraph instance.
 
.. note::
 
     - The non asymmetric and the reflexive links are all put to the median indeterminate characteristic value!
     - The constructor makes a deep copy of the given Digraph instance!
 
 
Method resolution order:
AsymmetricPartialDigraph
Digraph
builtins.object

Methods defined here:
__init__(self, digraph)
Initialize self.  See help(type(self)) for accurate signature.

Methods inherited from Digraph:
MISgen(self, S, I)
generator of maximal independent choices (voir Byskov 2004):
    * S ::= remaining nodes;
    * I ::= current independent choice
 
.. note::
 
        Inititalize: self.MISgen(self.actions.copy(),set())
__invert__(self)
Make the inverting operator ~self available for Digraph instances. 
 
Returns a ConverseDigraph instance of self.
__neg__(self)
Make the negation operator -self available for Digraph instances. 
 
Returns a DualDigraph instance of self.
__repr__(self)
Default presentation method for Digraph instances.
absirred(self, choice)
Renders the crips -irredundance degree of a choice.
absirredundant(self, U)
Generates all -irredundant choices of a digraph.
absirredval(self, choice, relation)
Renders the valued -irredundance degree of a choice.
absirredx(self, choice, x)
Computes the crips -irredundance degree of node x in a choice.
abskernelrestrict(self, prekernel)
Parameter: prekernel
Renders absorbent prekernel restricted relation.
absorb(self, choice)
Renders the absorbency degree of a choice.
absorbentChoices(self, S)
Generates all minimal absorbent choices of a bipolar valued digraph.
addValuationAttribute(self)
Adds the numpy valuation attribute
agglomerationDistribution(self)
Output: aggloCoeffDistribution, meanCoeff
Renders the distribution of agglomeration coefficients.
aneighbors(self, node)
Renders the set of absorbed in-neighbors of a node.
automorphismGenerators(self)
Adds automorphism group generators to the digraph instance.
 
.. note::
 
    Dependency: Uses the dreadnaut command from the nauty software package. See https://www3.cs.stonybrook.edu/~algorith/implement/nauty/implement.shtml
 
    On Ubuntu Linux:
      ...$ sudo apt-get install nauty
averageCoveringIndex(self, choice, direction='out')
Renders the average covering index of a given choice in a set of objects,
ie the average number of choice members that cover each
non selected object.
bipolarKCorrelation(self, digraph, Debug=False)
Renders the bipolar Kendall correlation between two bipolar valued
digraphs computed from the average valuation of the
XORDigraph(self,digraph) instance.
 
.. warning::
 
     Obsolete! Is replaced by the self.computeBipolarCorrelation(other) Digraph method
bipolarKDistance(self, digraph, Debug=False)
Renders the bipolar crisp Kendall distance between two bipolar valued
digraphs.
 
.. warning::
 
     Obsolete! Is replaced by the self.computeBipolarCorrelation(other, MedianCut=True) Digraph method
chordlessPaths(self, Pk, n2, Odd=False, Comments=False, Debug=False)
New procedure from Agrum study April 2009
recursive chordless path extraction starting from path
Pk = [n2, ...., n1] and ending in node n2.
Optimized with marking of visited chordless P1s.
circuitAverageCredibility(self, circ)
Renders the average linking credibility of a Chordless Circuit.
circuitCredibilities(self, circuit, Debug=False)
Renders the average linking credibilities and the minimal link of a Chordless Circuit.
circuitMaxCredibility(self, circ)
Renders the maximal linking credibility of a Chordless Circuit.
circuitMinCredibility(self, circ)
Renders the minimal linking credibility of a Chordless Circuit.
closeSymmetric(self, InSite=True)
Produces the symmetric closure of self.relation.
closeTransitive(self, Reverse=False, InSite=True, Comments=False)
Produces the transitive closure of self.relation
 
*Parameters*:
 
    - If *Reverse* == True (False default) all transitive links are dropped, otherwise all transitive links are closed with min[r(x,y),r(y,z)];
    - If *Insite* == False (True by default) the methods return a modified copy of self.relation without altering the original self.relation, otherwise self.relation is modified.
components(self)
Renders the list of connected components.
computeAllDensities(self, choice=None)
parameter: choice in self
renders six densitiy parameters:
arc density, double arc density,
single arc density, strict single arc density,
absence arc density, strict absence arc densitiy.
computeArrowRaynaudOrder(self)
Renders a linear ordering from worst to best of the actions following Arrow&Raynaud's rule.
computeArrowRaynaudRanking(self)
renders a linear ranking from best to worst of the actions following Arrow&Raynaud's rule.
computeAverageValuation(self)
Computes the bipolar average correlation between
self and the crisp complete digraph of same order
of the irreflexive and determined arcs of the digraph
computeBadChoices(self, Comments=False)
Computes characteristic values for potentially bad choices.
 
.. note::
 
     Returns a tuple with following content:
 
     [(0)-determ,(1)degirred,(2)degi,(3)degd,(4)dega,(5)str(choice),(6)absvec]
computeBadPirlotChoices(self, Comments=False)
Characteristic values for potentially bad choices
using the Pirlot's fixpoint algorithm.
computeBestChoiceRecommendation(self, Verbose=False, Comments=False, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True)
Sets self.bestChoice, self.bestChoiceData, self.worstChoice and self.worstChoiceData
with the showBestChoiceRecommendation method.
 
First and last choices data is the following:
[(0)-determ,(1)degirred,(2)degi,(3)degd,(4)dega,(5)str(choice),(6)domvec,(7)cover]
 
self.bestChoice = self.bestChoiceData[5]
self.worstChoice = self.worstChoiceData[5]
computeBipolarCorrelation(self, other, MedianCut=False, filterRelation=None, Debug=False)
obsolete: dummy replacement for Digraph.computeOrdinalCorrelation method
computeChordlessCircuits(self, Odd=False, Comments=False, Debug=False)
Renders the set of all chordless circuits detected in a digraph.
Result is stored in <self.circuitsList>
holding a possibly empty list of tuples with at position 0 the
list of adjacent actions of the circuit and at position 1
the set of actions in the stored circuit.
 
When *Odd* is True, only chordless circuits with an odd length
are collected.
computeChordlessCircuitsMP(self, Odd=False, Threading=False, nbrOfCPUs=None, startMethod=None, Comments=False, Debug=False)
Multiprocessing version of computeChordlessCircuits().
 
Renders the set of all chordless odd circuits detected in a digraph.
Result (possible empty list) stored in <self.circuitsList>
holding a possibly empty list tuples with at position 0 the
list of adjacent actions of the circuit and at position 1
the set of actions in the stored circuit.
Inspired by Dias, Castonguay, Longo, Jradi, Algorithmica (2015).
 
Returns a possibly empty list of tuples (circuit,frozenset(circuit)).
 
If Odd == True, only circuits of odd length are retained in the result.
computeCoSize(self)
Renders the number of non validated non reflexive arcs
computeConcentrationIndex(self, X, N)
Renders the Gini concentration index of the X serie.
N contains the partial frequencies.
Based on the triangle summation formula.
computeConcentrationIndexTrapez(self, X, N)
Renders the Gini concentration index of the X serie.
N contains the partial frequencies.
Based on the triangles summation formula.
computeCondorcetLosers(self)
Wrapper for condorcetLosers().
computeCondorcetWinners(self)
Wrapper for condorcetWinners().
computeCopelandOrder(self)
renders a linear ordering from worst to best of the actions following Arrow&Raynaud's rule.
computeCopelandRanking(self)
renders a linear ranking from best to worst of the actions following Arrow&Raynaud's rule.
computeCutLevelDensities(self, choice, level)
parameter: choice in self, robustness level
renders three robust densitiy parameters:
robust double arc density,
robust single arc density,
robust absence arc densitiy.
computeDensities(self, choice)
parameter: choice in self
renders the four densitiy parameters:
arc density, double arc density, single arc density, absence arc density.
computeDeterminateness(self, InPercents=False)
Computes the Kendalll distance of self
with the all median-valued indeterminate digraph of order n.
 
Return the average determination of the irreflexive part of the digraph.
 
*determination* = sum_(x,y) { abs[ r(xRy) - Med ] } / n(n-1)
 
If *InPercents* is True, returns the average determination in percentage of
(Max - Med) difference.
 
>>> from outrankingDigraphs import BipolarOutrankingDigraph
>>> from randomPerfTabs import Random3ObjectivesPerformanceTableau
>>> t = Random3ObjectivesPerformanceTableau(numberOfActions=7,numberOfCriteria=7,seed=101)
>>> g = BipolarOutrankingDigraph(t,Normalized=True)
>>> g
*------- Object instance description ------*
Instance class      : BipolarOutrankingDigraph
Instance name       : rel_random3ObjectivesPerfTab
Actions             : 7
Criteria            : 7
Size                : 27
Determinateness (%) : 65.67
Valuation domain    : [-1.00;1.00]
>>> print(g.computeDeterminateness())
0.3134920634920634920634920638
>>> print(g.computeDeterminateness(InPercents=True))
65.67460317460317460317460320
>>> g.recodeValuation(0,1)
>>> g
*------- Object instance description ------*
Instance class      : BipolarOutrankingDigraph
Instance name       : rel_random3ObjectivesPerfTab
Actions             : 7
Criteria            : 7
Size                : 27
Determinateness (%) : 65.67
Valuation domain    : [0.00;1.00]
>>> print(g.computeDeterminateness())
0.1567460317460317460317460318
>>> print(g.computeDeterminateness(InPercents=True))
65.67460317460317460317460320
computeDiameter(self, Oriented=True)
Renders the (by default oriented) diameter of the digraph instance
computeDigraphCentres(self, WeakDistances=False, Comments=False)
The centers of a digraph are the nodes with finite minimal shortes path lengths.
 
The maximal neighborhood distances are stored in *self.maximalNeighborhoodDistances*.
 
The corresponding digraph radius and diameter are stored respectively  in *self.radius* and *self.diameter*.
 
With *Comments* = True, all these results are printed out.
 
*Source*: Claude Berge, *The Theory of Graphs*, Dover (2001) pp. 119, original in French Dunod (1958)
computeDynamicProgrammingStages(self, source, sink, Debug=False)
Renders the discrete stages of the optimal substructure for
dynamic pogramming digrahs from a given source node 
to a given sink sink node.
 
Returns a list of list of action identifyers.
computeGoodChoiceVector(self, ker, Comments=False)
| Computing Characteristic values for dominant pre-kernels
| using the von Neumann dual fixoint equation
computeGoodChoices(self, Comments=False)
Computes characteristic values for potentially good choices.
 
..note::
 
     Return a tuple with following content:
 
     [(0)-determ,(1)degirred,(2)degi,(3)degd,(4)dega,(5)str(choice),(6)domvec,(7)cover]
computeGoodPirlotChoices(self, Comments=False)
Characteristic values for potentially good choices
using the Pirlot fixpoint algorithm.
computeIncomparabilityDegree(self, InPercents=False, Comments=False)
Renders the incomparability degree (Decimal), i.e. the relative number of symmetric indeterminate relations of the irreflexive part of a digraph.
computeKemenyIndex(self, otherRelation)
renders the Kemeny index of the self.relation
compared with a given crisp valued relation of a compatible
other digraph (same nodes or actions).
computeKemenyOrder(self, orderLimit=7, Debug=False)
Renders a ordering from worst to best of the actions with maximal Kemeny index.
Return a tuple: kemenyOrder (from worst to best), kemenyIndex
computeKemenyRanking(self, orderLimit=7, seed=None, sampleSize=1000, Debug=False)
Renders a ranking from best to worst of the actions with maximal Kemeny index.
 
.. note::
 
     Returns a tuple: kemenyRanking (from best to worst), kemenyIndex.
computeKernelVector(self, kernel, Initial=True, Comments=False)
| Computing Characteristic values for dominant pre-kernels
| using the von Neumann dual fixpoint equation
computeKohlerOrder(self)
Renders an ordering (worst to best) of the actions following Kohler's rule.
computeKohlerRanking(self)
Renders a ranking (best to worst) of the actions following Kohler's rule.
computeMaxHoleSize(self, Comments=False)
Renders the length of the largest chordless cycle
in the corresponding disjunctive undirected graph.
computeMeanInDegree(self)
Renders the mean indegree of self.
!!! self.size must be set previously !!!
computeMeanOutDegree(self)
Renders the mean degree of self.
!!! self.size must be set previously !!!
computeMeanSymDegree(self)
Renders the mean degree of self.
!!! self.size must be set previously !!!
computeMedianOutDegree(self)
Renders the median outdegree of self.
!!! self.size must be set previously !!!
computeMedianSymDegree(self)
Renders the median symmetric degree of self.
!!! self.size must be set previously !!!
computeMoreOrLessUnrelatedPairs(self)
Renders a list of more or less unrelated pairs.
computeNetFlowsOrder(self)
Renders an ordered list (from best to worst) of the actions
following the net flows ranking rule.
computeNetFlowsOrderDict(self)
Renders an ordered list (from worst to best) of the actions
following the net flows ranking rule.
computeNetFlowsRanking(self)
Renders an ordered list (from best to worst) of the actions
following the net flows ranking rule.
computeNetFlowsRankingDict(self)
Renders an ordered list (from best to worst) of the actions
following the net flows ranking rule.
computeODistance(self, op2, comments=False)
renders the squared normalized distance of
two digraph valuations.
 
.. note::
 
     op2 = digraphs of same order as self.
computeOrbit(self, choice, withListing=False)
renders the set of isomorph copies of a choice following
the automorphism of the digraph self
computeOrderCorrelation(self, order, Debug=False)
Renders the ordinal correlation K of a digraph instance
when compared with a given linear order (from worst to best) of its actions
 
K = sum_{x != y} [ min( max(-self.relation(x,y)),other.relation(x,y), max(self.relation(x,y),-other.relation(x,y)) ]
 
K /= sum_{x!=y} [ min(abs(self.relation(x,y),abs(other.relation(x,y)) ]
 
.. note::
 
     Renders a dictionary with the key 'correlation' containing the actual bipolar correlation index and the key 'determination' containing the minimal determination level D of self and the other relation.
 
     D = sum_{x != y} min(abs(self.relation(x,y)),abs(other.relation(x,y)) / n(n-1)
 
     where n is the number of actions considered.
 
     The correlation index with a completely indeterminate relation
     is by convention 0.0 at determination level 0.0 .
 
.. warning::
 
     self must be a normalized outranking digraph instance !
computeOrdinalCorrelation(self, other, MedianCut=False, filterRelation=None, Debug=False)
Renders the bipolar correlation K of a
self.relation when compared
with a given compatible (same actions set)) digraph or
a [-1,1] valued compatible relation (same actions set).
 
If MedianCut=True, the correlation is computed on the median polarized relations.
 
If filterRelation is not None, the correlation is computed on the partial domain corresponding to the determined part of the filter relation.
 
.. warning::
 
     Notice that the 'other' relation and/or the 'filterRelation',
     the case given, must both be normalized, ie [-1,1]-valued !
 
K = sum_{x != y} [ min( max(-self.relation[x][y]),other.relation[x][y]), max(self.relation[x][y],-other.relation[x][y]) ]
 
K /= sum_{x!=y} [ min(abs(self.relation[x][y]),abs(other.relation[x][y])) ]
 
.. note::
 
     Renders a tuple with at position 0 the actual bipolar correlation index
     and in position 1 the minimal determination level D of self and
     the other relation.
 
     D = sum_{x != y} min(abs(self.relation[x][y]),abs(other.relation[x][y])) / n(n-1)
 
     where n is the number of actions considered.
 
     The correlation index with a completely indeterminate relation
     is by convention 0.0 at determination level 0.0 .
computeOrdinalCorrelationMP(self, other, MedianCut=False, Threading=False, nbrOfCPUs=None, startMethod=None, Comments=False, Debug=False)
Multi processing version of the digraphs.computeOrdinalCorrelation() method.
 
.. note::
     The relation filtering and the MedinaCut option are not implemented in the MP version.
computePairwiseClusterComparison(self, K1, K2, Debug=False)
Computes the pairwise cluster comparison credibility vector
from bipolar-valued digraph g. with K1 and K2 disjoint
lists of action keys from g actions disctionary.
Returns the dictionary
{'I': Decimal(),'P+':Decimal(),'P-':Decimal(),'R' :Decimal()}
where one and only one item is strictly positive.
computePreKernels(self)
computing dominant and absorbent preKernels:
    Result in self.dompreKernels and self.abspreKernels
computePreRankingRelation(self, preRanking, Normalized=True, Debug=False)
Renders the bipolar-valued relation obtained from
a given preRanking in decreasing levels (list of lists) result.
computePreorderRelation(self, preorder, Normalized=True, Debug=False)
Renders the bipolar-valued relation obtained from
a given preordering in increasing levels (list of lists) result.
computePrincipalOrder(self, Colwise=False, Comments=False)
Rendesr an ordering from wrost to best of the decision actions.
computePrincipalRanking(self, Colwise=False, Comments=False)
Rendesr a ranking from best to worst of the decision actions.
computePrincipalScores(self, plotFileName=None, Colwise=False, imageType=None, tempDir=None, bgcolor='cornsilk', Comments=False, Debug=False)
Renders a ordered list of the first principal eigenvector of the covariance of the valued outdegrees of self.
 
.. note::
 
   The method, relying on writing and reading temporary files by default in a temporary directory is threading and multiprocessing safe !
   (see Digraph.exportPrincipalImage method)
computePrudentBetaLevel(self, Debug=False)
computes alpha, ie the lowest valuation level, for which the
bipolarly polarised digraph doesn't contain a chordless circuit.
computeRankingByBestChoosing(self, CoDual=False, Debug=False)
Computes a weak preordering of the self.actions by recursive
best choice elagations.
 
Stores in self.rankingByBestChoosing['result'] a list of (P+,bestChoice) tuples
where P+ gives the best choice complement outranking
average valuation via the computePairwiseClusterComparison
method.
 
If self.rankingByBestChoosing['CoDual'] is True, 
the ranking-by-choosing was computed on the codual of self.
computeRankingByBestChoosingRelation(self, rankingByBestChoosing=None, Debug=False)
Renders the bipolar-valued relation obtained from
the self.rankingByBestChoosing result.
computeRankingByChoosing(self, actionsSubset=None, Debug=False, CoDual=False)
Computes a weak preordring of the self.actions by iterating
jointly first and last choice elagations.
 
Stores in self.rankingByChoosing['result'] a list of ((P+,bestChoice),(P-,worstChoice)) pairs
where P+ (resp. P-) gives the best (resp. worst) choice complement outranking
(resp. outranked) average valuation via the computePairwiseClusterComparison
method.
 
If self.rankingByChoosing['CoDual'] is True, the ranking-by-choosing was computed on the codual of self.
computeRankingByChoosingRelation(self, rankingByChoosing=None, actionsSubset=None, Debug=False)
Renders the bipolar-valued relation obtained from
the self.rankingByChoosing result.
computeRankingByLastChoosing(self, CoDual=False, Debug=False)
Computes a weak preordring of the self.actions by iterating
worst choice elagations.
 
Stores in self.rankingByLastChoosing['result'] a list of (P-,worstChoice) pairs
where P- gives the worst choice complement outranked
average valuation via the computePairwiseClusterComparison
method.
 
If self.rankingByChoosing['CoDual'] is True, the ranking-by-last-chossing 
was computed on the codual of self.
computeRankingByLastChoosingRelation(self, rankingByLastChoosing=None, Debug=False)
Renders the bipolar-valued relation obtained from
the self.rankingByLastChoosing result.
computeRankingCorrelation(self, ranking, Debug=False)
Renders the ordinal correlation K of a digraph instance
when compared with a given linear ranking of its actions
 
K = sum_{x != y} [ min( max(-self.relation(x,y)),other.relation(x,y), max(self.relation(x,y),-other.relation(x,y)) ]
 
K /= sum_{x!=y} [ min(abs(self.relation(x,y),abs(other.relation(x,y)) ]
 
.. note::
 
     Renders a tuple with at position 0 the actual bipolar correlation index
     and in position 1 the minimal determination level D of self and
     the other relation.
 
     D = sum_{x != y} min(abs(self.relation(x,y)),abs(other.relation(x,y)) / n(n-1)
 
     where n is the number of actions considered.
 
     The correlation index with a completely indeterminate relation
     is by convention 0.0 at determination level 0.0 .
computeRelationalStructure(self, Debug=False)
Renders the counted decomposition of the valued relations into
the following type of links:
gt '>', eq '=', lt '<', incomp '<>',
leq '<=', geq '>=', indeterm '?'
computeRubisChoice(self, Comments=False, _OldCoca=False, BrokenCocs=True, Threading=False, nbrOfCPUs=1)
Renders self.strictGoodChoices, self.nullChoices
self.strictBadChoices, self.nonRobustChoices.
 
.. warning::
    Changes in site the outranking digraph by
    adding or braking chordless odd outranking circuits.
computeRubyChoice(self, Comments=False, _OldCoca=False)
dummy for computeRubisChoice()
old versions compatibility.
computeShortestPathLengths(self, WeakPaths=False, Comments=False, Debug=False)
Renders a double dictionary with the directed distances, i.e. the shortest path lengths between all self.actions
 
Equals *None* if there does not exist a directed path between two actions.
 
*Source*: Claude Berge, *The Theory of Graphs*, Dover (2001) pp. 119, original in French Dunod (1958)
computeSingletonRanking(self, Comments=False, Debug=False)
Renders the sorted bipolar net determinatation of outrankingness
minus outrankedness credibilities of all singleton choices.
 
res = ((netdet,singleton,dom,absorb)+)
computeSize(self)
Renders the number of validated non reflexive arcs
computeSizeTransitiveClosure(self)
Renders the size of the transitive closure of a digraph.
computeSlaterOrder(self, isProbabilistic=False, seed=None, sampleSize=1000, Debug=False)
Reversed return from computeSlaterRanking method.
computeSlaterRanking(self, isProbabilistic=False, seed=None, sampleSize=1000, Debug=False)
Renders a ranking of the actions with minimal Slater index.
Return a tuple: slaterOrder, slaterIndex
computeSymmetryDegree(self, InPercents=False, Comments=False)
Renders the symmetry degree (Decimal) of the irreflexive part of a digraph.
 
.. note::
 
   Empty and indeterminate digraphs are considered to be symmetric.
computeTopologicalRanking(self, Debug=False)
Mimetic Wrapper of the topologicalSort() method.
computeTransitivityDegree(self, InPercents=False, Comments=False)
Renders the transitivity degree (Decimal) of a digraph.
 
.. note:: 
 
   An empty or indeterminate digraph is considered to be transitive.
computeUnrelatedPairs(self)
Renders a list of more or less unrelated pairs.
computeValuationLevels(self, choice=None, Debug=False)
renders the symmetric closure of the
apparent valuations levels of self
in an increasingly ordered list.
If parameter choice is given, the
computation is limited to the actions
of the choice.
computeValuationPercentages(self, choice, percentiles, withValues=False)
Parameters: choice and list of percentiles.
renders a series of percentages of the characteristics valuation of
the arcs in the digraph.
computeValuationPercentiles(self, choice, percentages, withValues=False)
Parameters: choice and list of percentages.
renders a series of quantiles of the characteristics valuation of
the arcs in the digraph.
computeValuationStatistics(self, Sampling=False, Comments=False)
Renders the mean and variance of the valuation
of the non reflexive pairs.
computeValuedRankingRelation(self, ranking)
Renders the valued relation characteristics compatible 
with the given linar ranking. Discordant charcateristics 
are set to the indeterminate value.
computeWeakCondorcetLosers(self)
Wrapper for weakCondorcetLosers().
computeWeakCondorcetWinners(self)
Wrapper for weakCondorcetWinners().
computeupdown1(self, s, S)
Help method for show_MIS_HB2 method.
fills self.newmisset, self.upmis, self.downmis.
computeupdown2(self, s, S)
Help method for show_MIS_HB1 method.
Fills self.newmisset, self.upmis, self.downmis.
computeupdown2irred(self, s, S)
Help method for show_MIS_HB1 method.
Fills self.newmisset, self.upmis, self.downmis.
condorcetLosers(self)
Renders the set of decision actions x such that
self.relation[x][y] < self.valuationdomain['med']
for all y != x.
condorcetWinners(self)
Renders the set of decision actions x such that
self.relation[x][y] > self.valuationdomain['med']
for all y != x.
contra(self, v)
Parameter: choice.
Renders the negation of a choice v characteristic's vector.
convertRelationToDecimal(self)
Converts the float valued self.relation in a decimal valued one.
convertValuation2Integer(self, InSite=True, Comments=False)
Converts the self.relation valuation to integer values by converting the Decimals to Fractions and multiply by the least commun multiple of the fraction denominators.
 
*Parameters*:
 
    - If *Insite* == False (True by default) the method returns a modified copy of self.relation without altering the original self.relation, otherwise self.relation and self.valuationdomain is modified.
convertValuationToDecimal(self)
Convert the float valuation limits to Decimals.
coveringIndex(self, choice, direction='out')
Renders the covering index of a given choice in a set of objects,
ie the minimum number of choice members that cover each
non selected object.
crispKDistance(self, digraph, Debug=False)
Renders the crisp Kendall distance between two bipolar valued
digraphs.
 
.. warning::
 
     Obsolete! Is replaced by the self.computeBipolarCorrelation(other, MedianCut=True) Digraph method
detectChordlessCircuits(self, Comments=False, Debug=False)
Detects a chordless circuit in a digraph.
Returns a Boolean
detectChordlessPath(self, Pk, n2, Comments=False, Debug=False)
New procedure from Agrum study April 2009
recursive chordless path extraction starting from path
Pk = [n2, ...., n1] and ending in node n2.
Optimized with marking of visited chordless P1s.
determinateness(self, vec, inPercent=True)
Renders the determinateness of a characteristic vector *vec* = 
[(r(x),x),(r(y),y), ...] of length *n* in valuationdomain [Min,Med,Max]:
 
*result* =  sum_x( abs(r(x)-Med) ) / ( n*(Max-Med) )
 
If inPercent, *result* shifted (+1) and reduced (/2) to [0,1] range.
digraph2Graph(self, valuationDomain={'min': -1, 'med': 0, 'max': 1}, Debug=False, ConjunctiveConversion=True)
Convert a Digraph instance to a Graph instance.
dneighbors(self, node)
Renders the set of dominated out-neighbors of a node.
domin(self, choice)
Renders the dominance degree of a choice.
dominantChoices(self, S)
Generates all minimal dominant choices of a bipolar valued digraph.
 
.. note::
 
     Initiate with S = self.actions.copy().
domirred(self, choice)
Renders the crips +irredundance degree of a choice.
domirredval(self, choice, relation)
Renders the valued +irredundance degree of a choice.
domirredx(self, choice, x)
Renders the crips +irredundance degree of node x in a choice.
domkernelrestrict(self, prekernel)
Parameter: dominant prekernel
Renders dominant prekernel restricted relation.
exportGraphViz(self, fileName=None, actionsSubset=None, bestChoice=set(), worstChoice=set(), firstChoice=set(), lastChoice=set(), Comments=True, graphType='png', pictureFormat=None, graphSize='7,7', relation=None, bgcolor='cornsilk')
export GraphViz dot file  for graph drawing filtering.
exportPrincipalImage(self, plotFileName=None, pictureFormat='pdf', bgcolor='cornsilk', fontcolor='red3', fontsize='0.75', Reduced=False, Colwise=False, tempDir='.', Comments=False)
Export as PDF (default) the principal projection of
the valued relation using the three principal eigen vectors.
 
Implemeted picture formats are: 
'pdf' (default), 'png', 'jpeg' and 'xfig'.
 
The background color is set by default to 'cornsilk'. 
 
Font size and color are set by default to 'red3', resp. '0.75'. 
 
When *Reduced==True*, the valued relation characeteristics are centered and reduced.
 
When *Colwise==True*, the column vectors of the adjacency table are used for the principal projection, otherwise the rows (default) are used. Has no incidence when the *Digraph* instance *self*  is symmetric. 
 
.. warning::
 
    The method, writing and reading temporary files: 
    tempCol.r and rotationCol.csv, resp. tempRow.r and rotationRow.csv,
    by default in the working directory (./),
    is hence not safe for multiprocessing programs, unless a
    temporary directory *tempDir* is provided.
flatChoice(self, ch, Debug=False)
Converts set or list ch recursively to a flat list of items.
forcedBestSingleChoice(self)
Renders the set of most determined outranking singletons in self.
gammaSets(self)
Renders the dictionary of neighborhoods {node: (dx,ax)}
with set *dx* gathering the dominated, and set *ax* gathering
the absorbed neighborhood.
generateAbsPreKernels(self)
Generate all absorbent prekernels from independent choices generator.
generateDomPreKernels(self)
Generate all dominant prekernels from independent choices generator.
htmlChoiceVector(self, ch, ChoiceVector=True, choiceType='good')
Show procedure for annotated bipolar choices.
inDegrees(self)
renders the median cut indegrees
inDegreesDistribution(self)
Renders the distribution of indegrees.
independentChoices(self, U)
Generator for all independent choices with neighborhoods of a bipolar valued digraph:
 
.. note::
 
       * Initiate with U = self.singletons().
       * Yields [(independent choice, domnb, absnb, indnb)].
inner_prod(self, v1, v2)
Parameters: two choice characteristic vectors
Renders the inner product of two characteristic vetors.
intstab(self, choice)
Computes the independence degree of a choice.
irreflex(self, mat)
Puts diagonal entries of mat to valuationdomain['min']
isAsymmetricIndeterminate(self, Debug=False)
Checks the self.relation for assymmetric indeterminateness!!
 
.. warning::
 
    The reflexive links are ignored !!
isComplete(self, Debug=False)
checks the completeness property of self.relation by checking
for the absence of a link between two actions!!
 
.. warning::
 
    The reflexive links are ignored !!
isCyclic(self, Debug=False)
checks the cyclicity of self.relation by checking
for a reflexive loop in its transitive closure-
 
.. warning::
 
     self.relation is supposed to be irreflexive !
isIntegerValued(self, Debug=False)
Checks whether the decimal valuation of self is integer-valued
be using the as_integer_ratio() method of a Decimal 
giving a tuple (numerator,denominator). If denominator == 1, the
number is an integer.
isOutrankingDigraph(self, Comments=True, Debug=False)
Checks the outranking digraph characteristic condition (3.3).
 
relation[x][y] + relation[y][x)[y] >= 0.0
 
.. warning::
 
    The reflexive links are ignored and the valuation must be bipolar !!
isStrictOutrankingDigraph(self, Comments=True, Debug=False)
Checks the strict outranking digraph characteristic condition (3.1).
 
-(relation[x][y] + relation[y][x]) <= 0.0 , x != y
 
.. warning::
 
    The reflexive links are ignored and the valuation must be bipolar !!
isSymmetric(self, Comments=False)
True if symmetry degree == 1.0.
isTransitive(self, Comments=False)
True if transitivity degree == 1.0.
isWeaklyComplete(self, Debug=False)
checks the weakly completeness property of self.relation by checking
for the absence of a link between two actions!!
 
.. warning::
 
    The reflexive links are ignored !!
iterateRankingByChoosing(self, Odd=False, CoDual=False, Comments=True, Debug=False, Limited=None)
Renders a ranking by choosing result when progressively eliminating
all chordless (odd only) circuits with rising valuation cut levels.
 
Parameters
    CoDual = False (default)/True
    Limited = proportion (in [0,1]) * (max - med) valuationdomain
kChoices(self, A, k)
Renders all choices of length k from set A
matmult2(self, m, v)
Parameters: digraph relation and choice characteristic vector
matrix multiply vector by inner production
meanDegree(self)
Renders the mean degree of self.
!!! self.size must be set previously !!!
meanLength(self, Oriented=False)
Renders the (by default non-oriented) mean neighbourhoor depth of self.
!!! self.order must be set previously !!!
minimalChoices(self, S)
Generates all dominant or absorbent choices of a bipolar
valued digraph.
 
.. note:
 
   * Initiate with S = (actions, dict of dominant or absorbent closed neighborhoods)
   * See showMinDom and showMinAbs methods.
minimalValuationLevelForCircuitsElimination(self, Odd=True, Debug=False, Comments=False)
renders the minimal valuation level <lambda> that eliminates all
self.circuitsList stored odd chordless circuits from self.
 
.. warning::
 
    The <lambda> level polarised may still contain newly appearing chordless odd circuits !
neighbourhoodCollection(self, Oriented=False, Potential=False)
Renders the neighbourhood.
neighbourhoodDepthDistribution(self, Oriented=False)
Renders the distribtion of neighbourhood depths.
notGammaSets(self)
Renders the dictionary of neighborhoods {node: (dx,ax)}
with set *dx* gathering the not dominated, and set *ax* gathering
the not absorbed neighborhood.
notaneighbors(self, node)
Renders the set of absorbed not in-neighbors of a node.
notdneighbors(self, node)
Renders the set of not dominated out-neighbors of a node.
outDegrees(self)
renders the median cut outdegrees
outDegreesDistribution(self)
Renders the distribution of outdegrees.
plusirredundant(self, U)
Generates all +irredundant choices of a digraph.
powerset(self, U)
Generates all subsets of a set.
readPerrinMisset(self, file='curd.dat')
read method for 0-1-char-coded MISs by default from the perrinMIS.c curd.dat result file.
readabsvector(self, x, relation)
Parameter: action x
absorbent in vector.
readdomvector(self, x, relation)
Parameter: action x
dominant out vector.
recodeValuation(self, newMin=-1.0, newMax=1.0, ndigits=4, Debug=False)
Recodes the characteristic valuation domain according
to the parameters given. 
 
*ndigits* indicates the number of decimal digits of the valuation.
relationFct(self, x, y)
wrapper for self.relation dictionary access to ensure interoperability
with the sparse and big outranking digraph implementation model.
save(self, fileName='tempdigraph', option=None, DecimalValuation=True, decDigits=2)
Persistent storage of a Digraph class instance in the form of
a python source code file
saveCSV(self, fileName='tempdigraph', Normalized=False, Dual=False, Converse=False, Diagonal=False, Debug=False)
Persistent storage of a Digraph class instance in the form of
a csv file.
saveXMCDA2(self, fileName='temp', fileExt='xmcda2', Comments=True, relationName='R', relationType='binary', category='random', subcategory='valued', author='digraphs Module (RB)', reference='saved from Python', valuationType='standard', digits=2, servingD3=False)
save digraph in XMCDA 2.0 format. Deprecated now.
savedre(self, fileName='temp')
save digraph in nauty format.
sharp(self, x, y)
Paramaters: choice characteristic values.
Renders the sharpest of two characteristic values x and y.
sharpvec(self, v, w)
Paramaters: choice characteristic vectors.
Renders the sharpest of two characteristic vectors v and w.
showActions(self)
presentation methods for digraphs actions
showAll(self)
Detailed show method for genuine digraphs.
showAttributes(self)
Prints out the attributes of self.
showAutomorphismGenerators(self)
Renders the generators of the automorphism group.
showBadChoices(self, Recompute=True)
Characteristic values for potentially bad choices.
showBestChoiceRecommendation(self, Verbose=False, Comments=True, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True)
Shows the RuBis best choice recommendation.
 
.. note::
 
    Computes by default the Rubis best choice recommendation on the corresponding strict (codual) outranking digraph.
 
    By default, with BrokenCocs=True, we brake all chordless circuits at their weakest determined ( abs(r(x>y)) + abs(r(y>x)) ) link.
 
    When BrokenCocs=False we proceed like follows:
 
    In case of chordless circuits, if supporting arcs are more credible
    than the reversed negating arcs, we collapse the circuits into hyper nodes.
    Inversely,  if supporting arcs are not more credible than the reversed negating arcs,
    we brake the circuits on their weakest arc.
 
Usage example:
 
>>> from outrankingDigraphs import *
>>> t = Random3ObjectivesPerformanceTableau(seed=5)
>>> g = BipolarOutrankingDigraph(t)
>>> g.showBestChoiceRecommendation()
***********************
RuBis Best Choice Recommendation (BCR)
(in decreasing order of determinateness)   
Credibility domain:  [-100.0, 100.0]
=== >> potential first choices
* choice              : ['a04', 'a14', 'a19', 'a20']
   independence        : 1.19
   dominance           : 4.76
   absorbency          : -59.52
   covering (%)        : 75.00
   determinateness (%) : 57.86
   - most credible action(s) = { 'a14': 23.81, 'a19': 11.90, 'a04': 2.38, 'a20': 1.19, }  
=== >> potential last choices 
* choice              : ['a03', 'a12', 'a17']
  independence        : 4.76
  dominance           : -76.19
  absorbency          : 4.76
  covering (%)        : 0.00
  determinateness (%) : 65.39
  - most credible action(s) = { 'a03': 38.10, 'a12': 13.10, 'a17': 4.76, }
Execution time: 0.024 seconds
*****************************
showChoiceVector(self, ch, choiceType='good', ChoiceVector=True)
Show procedure for annotated bipolar choices.
showChordlessCircuits(self, Recompute=False)
Show method for chordless circuits observed in a Digraph instance.
 
If previous computation is required, stores the detected circuits in self.circuitsList attribute.
showComponents(self)
Shows the list of connected components of the digraph instance.
showCorrelation(self, corr=None, ndigits=3)
Renders the valued ordinal correlation index, the crisp Kendall tau index and their epistemic determination degree.
showFirstChoiceRecommendation(self, Verbose=False, Comments=True, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True)
Shows the RuBis first choice recommendation.
 
.. note::
 
    Computes by default the Rubis first choice recommendation on the corresponding strict (codual) outranking digraph.
 
    By default, with BrokenCocs=True, we brake all chordless circuits at their weakest determined ( abs(r(x>y)) + abs(r(y>x)) ) link.
 
    When BrokenCocs=False we proceed like follows:
 
    In case of chordless circuits, if supporting arcs are more credible
    than the reversed negating arcs, we collapse the circuits into hyper nodes.
    Inversely,  if supporting arcs are not more credible than the reversed negating arcs,
    we brake the circuits on their weakest arc.
 
Usage example:
 
>>> from outrankingDigraphs import *
>>> t = Random3ObjectivesPerformanceTableau(seed=5)
>>> g = BipolarOutrankingDigraph(t)
>>> g.showFirstChoiceRecommendation()
***********************
RuBis First Choice Recommendation (BCR)
(in decreasing order of determinateness)   
Credibility domain:  [-100.0, 100.0]
=== >> potential first choices
* choice              : ['a04', 'a14', 'a19', 'a20']
   independence        : 1.19
   dominance           : 4.76
   absorbency          : -59.52
   covering (%)        : 75.00
   determinateness (%) : 57.86
   - most credible action(s) = { 'a14': 23.81, 'a19': 11.90, 'a04': 2.38, 'a20': 1.19, }  
=== >> potential last choices 
* choice              : ['a03', 'a12', 'a17']
  independence        : 4.76
  dominance           : -76.19
  absorbency          : 4.76
  covering (%)        : 0.00
  determinateness (%) : 65.39
  - most credible action(s) = { 'a03': 38.10, 'a12': 13.10, 'a17': 4.76, }
Execution time: 0.024 seconds
*****************************
showGoodChoices(self, Recompute=True)
Characteristic values for potentially good choices.
showHTMLBestChoiceRecommendation(self, pageTitle=None, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True, htmlFileName=None)
showHTMLRelationHeatmap(self, actionsList=None, rankingRule='NetFlows', colorLevels=7, tableTitle='Relation Heatmap', relationName='r(x S y)', ndigits=2, fromIndex=None, toIndex=None, htmlFileName=None)
Launches a browser window with the colored relation map of self.
 
See corresponding :py:class:`~digraphs.Digraph.showHTMLRelationMap` method.
 
The *colorLevels* parameter may be set to 3, 5, 7 (default) or 9.
 
When the *actionsList* parameter is *None* (default), the digraphs actions list may be ranked with the *rankingRule* parameter set to the 'Copeland' (default) or to the 'Netlows' ranking rule.
 
When the *htmlFileName* parameter is set to a string value 'xxx', a html file named 'xxx.html' will be generated in the current working directory. Otherwise, a temporary file named 'tmp*.html' will be generated there.
 
Example::
 
    >>> from outrankingDigraphs import *
    >>> t = RandomCBPerformanceTableau(numberOfActions=25,seed=1)
    >>> g = BipolarOutrankingDigraph(t,ndigits=2)
    >>> gcd = ~(-g)  # strict outranking relation
    >>> gcd.showHTMLRelationHeatmap(colorLevels=7,ndigits=2)
    
.. image:: relationHeatmap.png
   :alt: Browser view of a relation map
   :width: 600 px
   :align: center
showHTMLRelationMap(self, actionsList=None, rankingRule='Copeland', Colored=True, tableTitle='Relation Map', relationName='r(x S y)', symbols=['+', '&middot;', '&nbsp;', '&#150;', '&#151'], fromIndex=None, toIndex=None, htmlFileName=None)
Launches a browser window with the colored relation map of self.
See corresponding Digraph.showRelationMap() method.
 
When *htmlFileName* parameter is set to a string value, a html file
with that name will be stored in the current working directory.
 
By default, a temporary file named: tmp*.html will be generated
instead in the current working directory.
 
Example::
 
    >>> from outrankingDigraphs import *
    >>> t = RandomCBPerformanceTableau(numberOfActions=25,seed=1)
    >>> g = BipolarOutrankingDigraph(t,Normalized=True)
    >>> gcd = ~(-g)  # strict outranking relation
    >>> gcd.showHTMLRelationMap(rankingRule="NetFlows")
    
.. image:: relationMap.png
   :alt: Browser view of a relation map
   :width: 600 px
   :align: center
showHTMLRelationTable(self, actionsList=None, relation=None, IntegerValues=False, ndigits=2, Colored=True, tableTitle='Valued Adjacency Matrix', relationName='r(x S y)', ReflexiveTerms=False, htmlFileName=None, fromIndex=None, toIndex=None)
Launches a browser window with the colored relation table of self.
showMIS(self, withListing=True)
Prints all maximal independent choices:
    Result in self.misset.
showMIS_AH(self, withListing=True)
Prints all MIS using the Hertz method.
 
Result saved in self.hertzmisset.
showMIS_HB2(self, withListing=True)
Prints all MIS using the Hertz-Bisdorff method.
 
Result saved in self.newmisset.
showMIS_RB(self, withListing=True)
Prints all MIS using the Bisdorff method.
 
Result saved in self.newmisset.
showMIS_UD(self, withListing=True)
Prints all MIS using the Hertz-Bisdorff method.
 
Result saved in self.newmisset.
showMaxAbsIrred(self, withListing=True)
Computing maximal -irredundant choices:
    Result in self.absirset.
showMaxDomIrred(self, withListing=True)
Computing maximal +irredundant choices:
   Result in self.domirset.
showMinAbs(self, withListing=True)
Prints minimal absorbent choices:
    Result in self.absset.
showMinDom(self, withListing=True)
Prints all minimal dominant choices:
    Result in self.domset.
showNeighborhoods(self)
Lists the gamma and the notGamma function of self.
showOrbits(self, InChoices, withListing=True)
Prints the orbits of Choices along the automorphisms of
the Digraph instance.
 
Example Python session for computing the non isomorphic MISs from the 12-cycle graph:
 
>>> from digraphs import *
>>> c12 = CirculantDigraph(order=12,circulants=[1,-1])
>>> c12.automorphismGenerators()
...
  Permutations
  {'1': '1', '2': '12', '3': '11', '4': '10', '5': 
   '9', '6': '8', '7': '7', '8': '6', '9': '5', '10': 
   '4', '11': '3', '12': '2'}
  {'1': '2', '2': '1', '3': '12', '4': '11', '5': '10', 
   '6': '9', '7': '8', '8': '7', '9': '6', '10': '5', 
   '11': '4', '12': '3'}
  Reflections {}
>>> print('grpsize = ', c12.automorphismGroupSize)
  grpsize = 24
>>> c12.showMIS(withListing=False)
  *---  Maximal independent choices ---*
  number of solutions:  29
  cardinality distribution
  card.:  [0, 1, 2, 3, 4,  5,  6, 7, 8, 9, 10, 11, 12]
  freq.:  [0, 0, 0, 0, 3, 24,  2, 0, 0, 0,  0,  0,  0]
  Results in c12.misset
>>> c12.showOrbits(c12.misset,withListing=False)
...
  *---- Global result ----
  Number of MIS:  29
  Number of orbits :  4
  Labelled representatives:
  1: ['2','4','6','8','10','12']
  2: ['2','5','8','11']
  3: ['2','4','6','9','11']
  4: ['1','4','7','9','11']
  Symmetry vector
  stabilizer size: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, ...]
  frequency      : [0, 2, 0, 0, 0, 0, 0, 1, 0,  0,  0,  1, ...]
 
*Figure*: The symmetry axes of the non isomorphic MISs of the 12-cycle:
 
.. image:: c12.png
   :width: 400 px
   :align: center
   :alt: The 4 non isomorphic MIS of the 12-cycle graph
 
*Reference*: R. Bisdorff and J.L. Marichal (2008). Counting non-isomorphic maximal independent sets of the n-cycle graph. *Journal of Integer Sequences*, Vol. 11 Article 08.5.7 (`openly accessible here <https://www.cs.uwaterloo.ca/journals/JIS/VOL11/Marichal/marichal.html>`_)
showOrbitsFromFile(self, InFile, withListing=True)
Prints the orbits of Choices along the automorphisms of
the digraph self by reading in the 0-1 misset file format.
See the :py:func:`digraphs.Digraph.readPerrinMisset` method.
showPreKernels(self, withListing=True)
Printing dominant and absorbent preKernels:
    Result in self.dompreKernels and self.abspreKernels
showRankingByBestChoosing(self, rankingByBestChoosing=None)
A show method for self.rankinByBestChoosing result.
 
.. warning::
 
     The self.computeRankingByBestChoosing(CoDual=False/True) method instantiating the self.rankingByBestChoosing slot is pre-required !
showRankingByChoosing(self, rankingByChoosing=None, WithCoverCredibility=False)
A show method for self.rankinByChoosing result.
 
When parameter *WithCoverCredibility* is set to True, the credibility of outranking, respectively being outranked is indicated at each selection step. 
 
.. warning::
 
     The self.computeRankingByChoosing(CoDual=False/True) method instantiating the self.rankingByChoosing slot is pre-required !
showRankingByLastChoosing(self, rankingByLastChoosing=None, Debug=None)
A show method for self.rankinByChoosing result.
 
.. warning::
 
     The self.computeRankingByLastChoosing(CoDual=False/True) method instantiating the self.rankingByChoosing slot is pre-required !
showRelation(self)
prints the relation valuation in ##.## format.
showRelationMap(self, symbols=None, rankingRule='Copeland', fromIndex=None, toIndex=None, actionsList=None)
Prints on the console, in text map format, the location of
certainly validated and certainly invalidated outranking situations.
 
By default, symbols = {'max':'┬','positive': '+', 'median': ' ',
                       'negative': '-', 'min': '┴'}
 
The default ordering of the output is following the Copeland ranking rule
from best to worst actions. Further available ranking rule is the 'NetFlows' net flows rule.
 
 
Example::
 
    >>> from outrankingDigraphs import *
    >>> t = RandomCBPerformanceTableau(numberOfActions=25,seed=1)
    >>> g = BipolarOutrankingDigraph(t,Normalized=True)
    >>> gcd = ~(-g)  # strict outranking relation
    >>> gcd.showRelationMap(rankingRule="NetFlows")
     -   ++++++++  +++++┬+┬┬+
    - -   + +++++ ++┬+┬+++┬++
    ┴+  ┴ + ++  ++++┬+┬┬++┬++
    -   ++ - ++++-++++++┬++┬+
       - - - ++- ┬- + -+┬+-┬┬
    -----  -      -┬┬┬-+  -┬┬
    ----    --+-+++++++++++++
    -- --+- --++ ++ +++-┬+-┬┬
    ----  -  -+-- ++--+++++ +
    ----- ++- --- +---++++┬ +
    -- -- ---+ -++-+++-+ +-++
    -- --┴---+  + +-++-+ -  +
    ---- ┴---+-- ++--++++ - +
      --┴┴--  --- -  --+ --┬┬
     ---------+--+ ----- +-┬┬
    -┴---┴- ---+- + ---+++┬ +
    -┴┴--┴---+--- ++ -++--+++
    -----┴--- ---+-+- ++---+ 
    -┴┴--------------- --++┬ 
    --┴---------------- --+┬ 
    ┴--┴┴ -┴--┴┴-┴ --++  ++-+
    ----┴┴--------------- -  
    ┴┴┴----+-┴+┴---┴-+---+ ┴+
    ┴┴-┴┴┴-┴- - -┴┴---┴┴+ ┬ -
    ----┴┴-┴-----┴┴---  - -- 
    Ranking rule: NetFlows
    >>>
showRelationTable(self, Sorted=True, rankingRule=None, IntegerValues=False, actionsSubset=None, relation=None, ndigits=2, ReflexiveTerms=True, fromIndex=None, toIndex=None)
Prints the relation valuation in actions X actions table format.
Copeland and NetFlows rankings my be used.
showRubisBestChoiceRecommendation(self, **kwargs)
Dummy for backward portable showBestChoiceRecommendation().
showRubyChoice(self, Verbose=False, Comments=True, _OldCoca=True)
Dummy for showBestChoiceRecommendation()
needed for older versions compatibility.
showShort(self)
concise presentation method for genuine digraphs.
showSingletonRanking(self, Comments=True, Debug=False)
Calls self.computeSingletonRanking(comments=True,Debug = False).
Renders and prints the sorted bipolar net determinatation of outrankingness
minus outrankedness credibilities of all singleton choices.
 
res = ((netdet,sigleton,dom,absorb)+)
showStatistics(self)
Computes digraph statistics like order, size and arc-density.
showdre(self)
Shows relation in nauty format.
singletons(self)
list of singletons and neighborhoods
[(singx1, +nx1, -nx1, not(+nx1 or -nx1)),.... ]
sizeSubGraph(self, choice)
Output: (size, undeterm,arcDensity).
Renders the arc density of the induced subgraph.
strongComponents(self, setPotential=False)
Renders the set of strong components of self.
symDegreesDistribution(self)
Renders the distribution of symmetric degrees.
topologicalSort(self, Debug=False)
If self is acyclic, adds topological sort number to each node of self
and renders ordered list of nodes. Otherwise renders None.
Source: M. Golumbic Algorithmic Graph heory and Perfect Graphs,
Annals Of Discrete Mathematics 57 2nd Ed. , Elsevier 2004, Algorithm 2.4 p.44.
weakAneighbors(self, node)
Renders the set of absorbed in-neighbors of a node.
weakCondorcetLosers(self)
Renders the set of decision actions x such that
self.relation[x][y] <= self.valuationdomain['med']
for all y != x.
weakCondorcetWinners(self)
Renders the set of decision actions x such that
self.relation[x][y] >= self.valuationdomain['med']
for all y != x.
weakDneighbors(self, node)
Renders the set of dominated out-neighbors of a node.
weakGammaSets(self)
Renders the dictionary of neighborhoods {node: (dx,ax)}
zoomValuation(self, zoomFactor=1.0)
Zooms in or out, depending on the value of the zoomFactor provided,
the bipolar valuation of a digraph.

Data descriptors inherited from Digraph:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class BipartitePartialDigraph(Digraph)
    BipartitePartialDigraph(digraph, partA, partB, Partial=True)
 
Renders the bipartite part of a Digraph instance.
 
.. note::
 
     - *partA* and *partB* must be parts of the *actions* attribute of the given *Digraph* instance
     - The non-bipartite links are all put to the median indeterminate characteristic value
     - The constructor makes a deep copy of the given Digraph instance
 
 
Method resolution order:
BipartitePartialDigraph
Digraph
builtins.object

Methods defined here:
__init__(self, digraph, partA, partB, Partial=True)
Initialize self.  See help(type(self)) for accurate signature.

Methods inherited from Digraph:
MISgen(self, S, I)
generator of maximal independent choices (voir Byskov 2004):
    * S ::= remaining nodes;
    * I ::= current independent choice
 
.. note::
 
        Inititalize: self.MISgen(self.actions.copy(),set())
__invert__(self)
Make the inverting operator ~self available for Digraph instances. 
 
Returns a ConverseDigraph instance of self.
__neg__(self)
Make the negation operator -self available for Digraph instances. 
 
Returns a DualDigraph instance of self.
__repr__(self)
Default presentation method for Digraph instances.
absirred(self, choice)
Renders the crips -irredundance degree of a choice.
absirredundant(self, U)
Generates all -irredundant choices of a digraph.
absirredval(self, choice, relation)
Renders the valued -irredundance degree of a choice.
absirredx(self, choice, x)
Computes the crips -irredundance degree of node x in a choice.
abskernelrestrict(self, prekernel)
Parameter: prekernel
Renders absorbent prekernel restricted relation.
absorb(self, choice)
Renders the absorbency degree of a choice.
absorbentChoices(self, S)
Generates all minimal absorbent choices of a bipolar valued digraph.
addValuationAttribute(self)
Adds the numpy valuation attribute
agglomerationDistribution(self)
Output: aggloCoeffDistribution, meanCoeff
Renders the distribution of agglomeration coefficients.
aneighbors(self, node)
Renders the set of absorbed in-neighbors of a node.
automorphismGenerators(self)
Adds automorphism group generators to the digraph instance.
 
.. note::
 
    Dependency: Uses the dreadnaut command from the nauty software package. See https://www3.cs.stonybrook.edu/~algorith/implement/nauty/implement.shtml
 
    On Ubuntu Linux:
      ...$ sudo apt-get install nauty
averageCoveringIndex(self, choice, direction='out')
Renders the average covering index of a given choice in a set of objects,
ie the average number of choice members that cover each
non selected object.
bipolarKCorrelation(self, digraph, Debug=False)
Renders the bipolar Kendall correlation between two bipolar valued
digraphs computed from the average valuation of the
XORDigraph(self,digraph) instance.
 
.. warning::
 
     Obsolete! Is replaced by the self.computeBipolarCorrelation(other) Digraph method
bipolarKDistance(self, digraph, Debug=False)
Renders the bipolar crisp Kendall distance between two bipolar valued
digraphs.
 
.. warning::
 
     Obsolete! Is replaced by the self.computeBipolarCorrelation(other, MedianCut=True) Digraph method
chordlessPaths(self, Pk, n2, Odd=False, Comments=False, Debug=False)
New procedure from Agrum study April 2009
recursive chordless path extraction starting from path
Pk = [n2, ...., n1] and ending in node n2.
Optimized with marking of visited chordless P1s.
circuitAverageCredibility(self, circ)
Renders the average linking credibility of a Chordless Circuit.
circuitCredibilities(self, circuit, Debug=False)
Renders the average linking credibilities and the minimal link of a Chordless Circuit.
circuitMaxCredibility(self, circ)
Renders the maximal linking credibility of a Chordless Circuit.
circuitMinCredibility(self, circ)
Renders the minimal linking credibility of a Chordless Circuit.
closeSymmetric(self, InSite=True)
Produces the symmetric closure of self.relation.
closeTransitive(self, Reverse=False, InSite=True, Comments=False)
Produces the transitive closure of self.relation
 
*Parameters*:
 
    - If *Reverse* == True (False default) all transitive links are dropped, otherwise all transitive links are closed with min[r(x,y),r(y,z)];
    - If *Insite* == False (True by default) the methods return a modified copy of self.relation without altering the original self.relation, otherwise self.relation is modified.
components(self)
Renders the list of connected components.
computeAllDensities(self, choice=None)
parameter: choice in self
renders six densitiy parameters:
arc density, double arc density,
single arc density, strict single arc density,
absence arc density, strict absence arc densitiy.
computeArrowRaynaudOrder(self)
Renders a linear ordering from worst to best of the actions following Arrow&Raynaud's rule.
computeArrowRaynaudRanking(self)
renders a linear ranking from best to worst of the actions following Arrow&Raynaud's rule.
computeAverageValuation(self)
Computes the bipolar average correlation between
self and the crisp complete digraph of same order
of the irreflexive and determined arcs of the digraph
computeBadChoices(self, Comments=False)
Computes characteristic values for potentially bad choices.
 
.. note::
 
     Returns a tuple with following content:
 
     [(0)-determ,(1)degirred,(2)degi,(3)degd,(4)dega,(5)str(choice),(6)absvec]
computeBadPirlotChoices(self, Comments=False)
Characteristic values for potentially bad choices
using the Pirlot's fixpoint algorithm.
computeBestChoiceRecommendation(self, Verbose=False, Comments=False, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True)
Sets self.bestChoice, self.bestChoiceData, self.worstChoice and self.worstChoiceData
with the showBestChoiceRecommendation method.
 
First and last choices data is the following:
[(0)-determ,(1)degirred,(2)degi,(3)degd,(4)dega,(5)str(choice),(6)domvec,(7)cover]
 
self.bestChoice = self.bestChoiceData[5]
self.worstChoice = self.worstChoiceData[5]
computeBipolarCorrelation(self, other, MedianCut=False, filterRelation=None, Debug=False)
obsolete: dummy replacement for Digraph.computeOrdinalCorrelation method
computeChordlessCircuits(self, Odd=False, Comments=False, Debug=False)
Renders the set of all chordless circuits detected in a digraph.
Result is stored in <self.circuitsList>
holding a possibly empty list of tuples with at position 0 the
list of adjacent actions of the circuit and at position 1
the set of actions in the stored circuit.
 
When *Odd* is True, only chordless circuits with an odd length
are collected.
computeChordlessCircuitsMP(self, Odd=False, Threading=False, nbrOfCPUs=None, startMethod=None, Comments=False, Debug=False)
Multiprocessing version of computeChordlessCircuits().
 
Renders the set of all chordless odd circuits detected in a digraph.
Result (possible empty list) stored in <self.circuitsList>
holding a possibly empty list tuples with at position 0 the
list of adjacent actions of the circuit and at position 1
the set of actions in the stored circuit.
Inspired by Dias, Castonguay, Longo, Jradi, Algorithmica (2015).
 
Returns a possibly empty list of tuples (circuit,frozenset(circuit)).
 
If Odd == True, only circuits of odd length are retained in the result.
computeCoSize(self)
Renders the number of non validated non reflexive arcs
computeConcentrationIndex(self, X, N)
Renders the Gini concentration index of the X serie.
N contains the partial frequencies.
Based on the triangle summation formula.
computeConcentrationIndexTrapez(self, X, N)
Renders the Gini concentration index of the X serie.
N contains the partial frequencies.
Based on the triangles summation formula.
computeCondorcetLosers(self)
Wrapper for condorcetLosers().
computeCondorcetWinners(self)
Wrapper for condorcetWinners().
computeCopelandOrder(self)
renders a linear ordering from worst to best of the actions following Arrow&Raynaud's rule.
computeCopelandRanking(self)
renders a linear ranking from best to worst of the actions following Arrow&Raynaud's rule.
computeCutLevelDensities(self, choice, level)
parameter: choice in self, robustness level
renders three robust densitiy parameters:
robust double arc density,
robust single arc density,
robust absence arc densitiy.
computeDensities(self, choice)
parameter: choice in self
renders the four densitiy parameters:
arc density, double arc density, single arc density, absence arc density.
computeDeterminateness(self, InPercents=False)
Computes the Kendalll distance of self
with the all median-valued indeterminate digraph of order n.
 
Return the average determination of the irreflexive part of the digraph.
 
*determination* = sum_(x,y) { abs[ r(xRy) - Med ] } / n(n-1)
 
If *InPercents* is True, returns the average determination in percentage of
(Max - Med) difference.
 
>>> from outrankingDigraphs import BipolarOutrankingDigraph
>>> from randomPerfTabs import Random3ObjectivesPerformanceTableau
>>> t = Random3ObjectivesPerformanceTableau(numberOfActions=7,numberOfCriteria=7,seed=101)
>>> g = BipolarOutrankingDigraph(t,Normalized=True)
>>> g
*------- Object instance description ------*
Instance class      : BipolarOutrankingDigraph
Instance name       : rel_random3ObjectivesPerfTab
Actions             : 7
Criteria            : 7
Size                : 27
Determinateness (%) : 65.67
Valuation domain    : [-1.00;1.00]
>>> print(g.computeDeterminateness())
0.3134920634920634920634920638
>>> print(g.computeDeterminateness(InPercents=True))
65.67460317460317460317460320
>>> g.recodeValuation(0,1)
>>> g
*------- Object instance description ------*
Instance class      : BipolarOutrankingDigraph
Instance name       : rel_random3ObjectivesPerfTab
Actions             : 7
Criteria            : 7
Size                : 27
Determinateness (%) : 65.67
Valuation domain    : [0.00;1.00]
>>> print(g.computeDeterminateness())
0.1567460317460317460317460318
>>> print(g.computeDeterminateness(InPercents=True))
65.67460317460317460317460320
computeDiameter(self, Oriented=True)
Renders the (by default oriented) diameter of the digraph instance
computeDigraphCentres(self, WeakDistances=False, Comments=False)
The centers of a digraph are the nodes with finite minimal shortes path lengths.
 
The maximal neighborhood distances are stored in *self.maximalNeighborhoodDistances*.
 
The corresponding digraph radius and diameter are stored respectively  in *self.radius* and *self.diameter*.
 
With *Comments* = True, all these results are printed out.
 
*Source*: Claude Berge, *The Theory of Graphs*, Dover (2001) pp. 119, original in French Dunod (1958)
computeDynamicProgrammingStages(self, source, sink, Debug=False)
Renders the discrete stages of the optimal substructure for
dynamic pogramming digrahs from a given source node 
to a given sink sink node.
 
Returns a list of list of action identifyers.
computeGoodChoiceVector(self, ker, Comments=False)
| Computing Characteristic values for dominant pre-kernels
| using the von Neumann dual fixoint equation
computeGoodChoices(self, Comments=False)
Computes characteristic values for potentially good choices.
 
..note::
 
     Return a tuple with following content:
 
     [(0)-determ,(1)degirred,(2)degi,(3)degd,(4)dega,(5)str(choice),(6)domvec,(7)cover]
computeGoodPirlotChoices(self, Comments=False)
Characteristic values for potentially good choices
using the Pirlot fixpoint algorithm.
computeIncomparabilityDegree(self, InPercents=False, Comments=False)
Renders the incomparability degree (Decimal), i.e. the relative number of symmetric indeterminate relations of the irreflexive part of a digraph.
computeKemenyIndex(self, otherRelation)
renders the Kemeny index of the self.relation
compared with a given crisp valued relation of a compatible
other digraph (same nodes or actions).
computeKemenyOrder(self, orderLimit=7, Debug=False)
Renders a ordering from worst to best of the actions with maximal Kemeny index.
Return a tuple: kemenyOrder (from worst to best), kemenyIndex
computeKemenyRanking(self, orderLimit=7, seed=None, sampleSize=1000, Debug=False)
Renders a ranking from best to worst of the actions with maximal Kemeny index.
 
.. note::
 
     Returns a tuple: kemenyRanking (from best to worst), kemenyIndex.
computeKernelVector(self, kernel, Initial=True, Comments=False)
| Computing Characteristic values for dominant pre-kernels
| using the von Neumann dual fixpoint equation
computeKohlerOrder(self)
Renders an ordering (worst to best) of the actions following Kohler's rule.
computeKohlerRanking(self)
Renders a ranking (best to worst) of the actions following Kohler's rule.
computeMaxHoleSize(self, Comments=False)
Renders the length of the largest chordless cycle
in the corresponding disjunctive undirected graph.
computeMeanInDegree(self)
Renders the mean indegree of self.
!!! self.size must be set previously !!!
computeMeanOutDegree(self)
Renders the mean degree of self.
!!! self.size must be set previously !!!
computeMeanSymDegree(self)
Renders the mean degree of self.
!!! self.size must be set previously !!!
computeMedianOutDegree(self)
Renders the median outdegree of self.
!!! self.size must be set previously !!!
computeMedianSymDegree(self)
Renders the median symmetric degree of self.
!!! self.size must be set previously !!!
computeMoreOrLessUnrelatedPairs(self)
Renders a list of more or less unrelated pairs.
computeNetFlowsOrder(self)
Renders an ordered list (from best to worst) of the actions
following the net flows ranking rule.
computeNetFlowsOrderDict(self)
Renders an ordered list (from worst to best) of the actions
following the net flows ranking rule.
computeNetFlowsRanking(self)
Renders an ordered list (from best to worst) of the actions
following the net flows ranking rule.
computeNetFlowsRankingDict(self)
Renders an ordered list (from best to worst) of the actions
following the net flows ranking rule.
computeODistance(self, op2, comments=False)
renders the squared normalized distance of
two digraph valuations.
 
.. note::
 
     op2 = digraphs of same order as self.
computeOrbit(self, choice, withListing=False)
renders the set of isomorph copies of a choice following
the automorphism of the digraph self
computeOrderCorrelation(self, order, Debug=False)
Renders the ordinal correlation K of a digraph instance
when compared with a given linear order (from worst to best) of its actions
 
K = sum_{x != y} [ min( max(-self.relation(x,y)),other.relation(x,y), max(self.relation(x,y),-other.relation(x,y)) ]
 
K /= sum_{x!=y} [ min(abs(self.relation(x,y),abs(other.relation(x,y)) ]
 
.. note::
 
     Renders a dictionary with the key 'correlation' containing the actual bipolar correlation index and the key 'determination' containing the minimal determination level D of self and the other relation.
 
     D = sum_{x != y} min(abs(self.relation(x,y)),abs(other.relation(x,y)) / n(n-1)
 
     where n is the number of actions considered.
 
     The correlation index with a completely indeterminate relation
     is by convention 0.0 at determination level 0.0 .
 
.. warning::
 
     self must be a normalized outranking digraph instance !
computeOrdinalCorrelation(self, other, MedianCut=False, filterRelation=None, Debug=False)
Renders the bipolar correlation K of a
self.relation when compared
with a given compatible (same actions set)) digraph or
a [-1,1] valued compatible relation (same actions set).
 
If MedianCut=True, the correlation is computed on the median polarized relations.
 
If filterRelation is not None, the correlation is computed on the partial domain corresponding to the determined part of the filter relation.
 
.. warning::
 
     Notice that the 'other' relation and/or the 'filterRelation',
     the case given, must both be normalized, ie [-1,1]-valued !
 
K = sum_{x != y} [ min( max(-self.relation[x][y]),other.relation[x][y]), max(self.relation[x][y],-other.relation[x][y]) ]
 
K /= sum_{x!=y} [ min(abs(self.relation[x][y]),abs(other.relation[x][y])) ]
 
.. note::
 
     Renders a tuple with at position 0 the actual bipolar correlation index
     and in position 1 the minimal determination level D of self and
     the other relation.
 
     D = sum_{x != y} min(abs(self.relation[x][y]),abs(other.relation[x][y])) / n(n-1)
 
     where n is the number of actions considered.
 
     The correlation index with a completely indeterminate relation
     is by convention 0.0 at determination level 0.0 .
computeOrdinalCorrelationMP(self, other, MedianCut=False, Threading=False, nbrOfCPUs=None, startMethod=None, Comments=False, Debug=False)
Multi processing version of the digraphs.computeOrdinalCorrelation() method.
 
.. note::
     The relation filtering and the MedinaCut option are not implemented in the MP version.
computePairwiseClusterComparison(self, K1, K2, Debug=False)
Computes the pairwise cluster comparison credibility vector
from bipolar-valued digraph g. with K1 and K2 disjoint
lists of action keys from g actions disctionary.
Returns the dictionary
{'I': Decimal(),'P+':Decimal(),'P-':Decimal(),'R' :Decimal()}
where one and only one item is strictly positive.
computePreKernels(self)
computing dominant and absorbent preKernels:
    Result in self.dompreKernels and self.abspreKernels
computePreRankingRelation(self, preRanking, Normalized=True, Debug=False)
Renders the bipolar-valued relation obtained from
a given preRanking in decreasing levels (list of lists) result.
computePreorderRelation(self, preorder, Normalized=True, Debug=False)
Renders the bipolar-valued relation obtained from
a given preordering in increasing levels (list of lists) result.
computePrincipalOrder(self, Colwise=False, Comments=False)
Rendesr an ordering from wrost to best of the decision actions.
computePrincipalRanking(self, Colwise=False, Comments=False)
Rendesr a ranking from best to worst of the decision actions.
computePrincipalScores(self, plotFileName=None, Colwise=False, imageType=None, tempDir=None, bgcolor='cornsilk', Comments=False, Debug=False)
Renders a ordered list of the first principal eigenvector of the covariance of the valued outdegrees of self.
 
.. note::
 
   The method, relying on writing and reading temporary files by default in a temporary directory is threading and multiprocessing safe !
   (see Digraph.exportPrincipalImage method)
computePrudentBetaLevel(self, Debug=False)
computes alpha, ie the lowest valuation level, for which the
bipolarly polarised digraph doesn't contain a chordless circuit.
computeRankingByBestChoosing(self, CoDual=False, Debug=False)
Computes a weak preordering of the self.actions by recursive
best choice elagations.
 
Stores in self.rankingByBestChoosing['result'] a list of (P+,bestChoice) tuples
where P+ gives the best choice complement outranking
average valuation via the computePairwiseClusterComparison
method.
 
If self.rankingByBestChoosing['CoDual'] is True, 
the ranking-by-choosing was computed on the codual of self.
computeRankingByBestChoosingRelation(self, rankingByBestChoosing=None, Debug=False)
Renders the bipolar-valued relation obtained from
the self.rankingByBestChoosing result.
computeRankingByChoosing(self, actionsSubset=None, Debug=False, CoDual=False)
Computes a weak preordring of the self.actions by iterating
jointly first and last choice elagations.
 
Stores in self.rankingByChoosing['result'] a list of ((P+,bestChoice),(P-,worstChoice)) pairs
where P+ (resp. P-) gives the best (resp. worst) choice complement outranking
(resp. outranked) average valuation via the computePairwiseClusterComparison
method.
 
If self.rankingByChoosing['CoDual'] is True, the ranking-by-choosing was computed on the codual of self.
computeRankingByChoosingRelation(self, rankingByChoosing=None, actionsSubset=None, Debug=False)
Renders the bipolar-valued relation obtained from
the self.rankingByChoosing result.
computeRankingByLastChoosing(self, CoDual=False, Debug=False)
Computes a weak preordring of the self.actions by iterating
worst choice elagations.
 
Stores in self.rankingByLastChoosing['result'] a list of (P-,worstChoice) pairs
where P- gives the worst choice complement outranked
average valuation via the computePairwiseClusterComparison
method.
 
If self.rankingByChoosing['CoDual'] is True, the ranking-by-last-chossing 
was computed on the codual of self.
computeRankingByLastChoosingRelation(self, rankingByLastChoosing=None, Debug=False)
Renders the bipolar-valued relation obtained from
the self.rankingByLastChoosing result.
computeRankingCorrelation(self, ranking, Debug=False)
Renders the ordinal correlation K of a digraph instance
when compared with a given linear ranking of its actions
 
K = sum_{x != y} [ min( max(-self.relation(x,y)),other.relation(x,y), max(self.relation(x,y),-other.relation(x,y)) ]
 
K /= sum_{x!=y} [ min(abs(self.relation(x,y),abs(other.relation(x,y)) ]
 
.. note::
 
     Renders a tuple with at position 0 the actual bipolar correlation index
     and in position 1 the minimal determination level D of self and
     the other relation.
 
     D = sum_{x != y} min(abs(self.relation(x,y)),abs(other.relation(x,y)) / n(n-1)
 
     where n is the number of actions considered.
 
     The correlation index with a completely indeterminate relation
     is by convention 0.0 at determination level 0.0 .
computeRelationalStructure(self, Debug=False)
Renders the counted decomposition of the valued relations into
the following type of links:
gt '>', eq '=', lt '<', incomp '<>',
leq '<=', geq '>=', indeterm '?'
computeRubisChoice(self, Comments=False, _OldCoca=False, BrokenCocs=True, Threading=False, nbrOfCPUs=1)
Renders self.strictGoodChoices, self.nullChoices
self.strictBadChoices, self.nonRobustChoices.
 
.. warning::
    Changes in site the outranking digraph by
    adding or braking chordless odd outranking circuits.
computeRubyChoice(self, Comments=False, _OldCoca=False)
dummy for computeRubisChoice()
old versions compatibility.
computeShortestPathLengths(self, WeakPaths=False, Comments=False, Debug=False)
Renders a double dictionary with the directed distances, i.e. the shortest path lengths between all self.actions
 
Equals *None* if there does not exist a directed path between two actions.
 
*Source*: Claude Berge, *The Theory of Graphs*, Dover (2001) pp. 119, original in French Dunod (1958)
computeSingletonRanking(self, Comments=False, Debug=False)
Renders the sorted bipolar net determinatation of outrankingness
minus outrankedness credibilities of all singleton choices.
 
res = ((netdet,singleton,dom,absorb)+)
computeSize(self)
Renders the number of validated non reflexive arcs
computeSizeTransitiveClosure(self)
Renders the size of the transitive closure of a digraph.
computeSlaterOrder(self, isProbabilistic=False, seed=None, sampleSize=1000, Debug=False)
Reversed return from computeSlaterRanking method.
computeSlaterRanking(self, isProbabilistic=False, seed=None, sampleSize=1000, Debug=False)
Renders a ranking of the actions with minimal Slater index.
Return a tuple: slaterOrder, slaterIndex
computeSymmetryDegree(self, InPercents=False, Comments=False)
Renders the symmetry degree (Decimal) of the irreflexive part of a digraph.
 
.. note::
 
   Empty and indeterminate digraphs are considered to be symmetric.
computeTopologicalRanking(self, Debug=False)
Mimetic Wrapper of the topologicalSort() method.
computeTransitivityDegree(self, InPercents=False, Comments=False)
Renders the transitivity degree (Decimal) of a digraph.
 
.. note:: 
 
   An empty or indeterminate digraph is considered to be transitive.
computeUnrelatedPairs(self)
Renders a list of more or less unrelated pairs.
computeValuationLevels(self, choice=None, Debug=False)
renders the symmetric closure of the
apparent valuations levels of self
in an increasingly ordered list.
If parameter choice is given, the
computation is limited to the actions
of the choice.
computeValuationPercentages(self, choice, percentiles, withValues=False)
Parameters: choice and list of percentiles.
renders a series of percentages of the characteristics valuation of
the arcs in the digraph.
computeValuationPercentiles(self, choice, percentages, withValues=False)
Parameters: choice and list of percentages.
renders a series of quantiles of the characteristics valuation of
the arcs in the digraph.
computeValuationStatistics(self, Sampling=False, Comments=False)
Renders the mean and variance of the valuation
of the non reflexive pairs.
computeValuedRankingRelation(self, ranking)
Renders the valued relation characteristics compatible 
with the given linar ranking. Discordant charcateristics 
are set to the indeterminate value.
computeWeakCondorcetLosers(self)
Wrapper for weakCondorcetLosers().
computeWeakCondorcetWinners(self)
Wrapper for weakCondorcetWinners().
computeupdown1(self, s, S)
Help method for show_MIS_HB2 method.
fills self.newmisset, self.upmis, self.downmis.
computeupdown2(self, s, S)
Help method for show_MIS_HB1 method.
Fills self.newmisset, self.upmis, self.downmis.
computeupdown2irred(self, s, S)
Help method for show_MIS_HB1 method.
Fills self.newmisset, self.upmis, self.downmis.
condorcetLosers(self)
Renders the set of decision actions x such that
self.relation[x][y] < self.valuationdomain['med']
for all y != x.
condorcetWinners(self)
Renders the set of decision actions x such that
self.relation[x][y] > self.valuationdomain['med']
for all y != x.
contra(self, v)
Parameter: choice.
Renders the negation of a choice v characteristic's vector.
convertRelationToDecimal(self)
Converts the float valued self.relation in a decimal valued one.
convertValuation2Integer(self, InSite=True, Comments=False)
Converts the self.relation valuation to integer values by converting the Decimals to Fractions and multiply by the least commun multiple of the fraction denominators.
 
*Parameters*:
 
    - If *Insite* == False (True by default) the method returns a modified copy of self.relation without altering the original self.relation, otherwise self.relation and self.valuationdomain is modified.
convertValuationToDecimal(self)
Convert the float valuation limits to Decimals.
coveringIndex(self, choice, direction='out')
Renders the covering index of a given choice in a set of objects,
ie the minimum number of choice members that cover each
non selected object.
crispKDistance(self, digraph, Debug=False)
Renders the crisp Kendall distance between two bipolar valued
digraphs.
 
.. warning::
 
     Obsolete! Is replaced by the self.computeBipolarCorrelation(other, MedianCut=True) Digraph method
detectChordlessCircuits(self, Comments=False, Debug=False)
Detects a chordless circuit in a digraph.
Returns a Boolean
detectChordlessPath(self, Pk, n2, Comments=False, Debug=False)
New procedure from Agrum study April 2009
recursive chordless path extraction starting from path
Pk = [n2, ...., n1] and ending in node n2.
Optimized with marking of visited chordless P1s.
determinateness(self, vec, inPercent=True)
Renders the determinateness of a characteristic vector *vec* = 
[(r(x),x),(r(y),y), ...] of length *n* in valuationdomain [Min,Med,Max]:
 
*result* =  sum_x( abs(r(x)-Med) ) / ( n*(Max-Med) )
 
If inPercent, *result* shifted (+1) and reduced (/2) to [0,1] range.
digraph2Graph(self, valuationDomain={'min': -1, 'med': 0, 'max': 1}, Debug=False, ConjunctiveConversion=True)
Convert a Digraph instance to a Graph instance.
dneighbors(self, node)
Renders the set of dominated out-neighbors of a node.
domin(self, choice)
Renders the dominance degree of a choice.
dominantChoices(self, S)
Generates all minimal dominant choices of a bipolar valued digraph.
 
.. note::
 
     Initiate with S = self.actions.copy().
domirred(self, choice)
Renders the crips +irredundance degree of a choice.
domirredval(self, choice, relation)
Renders the valued +irredundance degree of a choice.
domirredx(self, choice, x)
Renders the crips +irredundance degree of node x in a choice.
domkernelrestrict(self, prekernel)
Parameter: dominant prekernel
Renders dominant prekernel restricted relation.
exportGraphViz(self, fileName=None, actionsSubset=None, bestChoice=set(), worstChoice=set(), firstChoice=set(), lastChoice=set(), Comments=True, graphType='png', pictureFormat=None, graphSize='7,7', relation=None, bgcolor='cornsilk')
export GraphViz dot file  for graph drawing filtering.
exportPrincipalImage(self, plotFileName=None, pictureFormat='pdf', bgcolor='cornsilk', fontcolor='red3', fontsize='0.75', Reduced=False, Colwise=False, tempDir='.', Comments=False)
Export as PDF (default) the principal projection of
the valued relation using the three principal eigen vectors.
 
Implemeted picture formats are: 
'pdf' (default), 'png', 'jpeg' and 'xfig'.
 
The background color is set by default to 'cornsilk'. 
 
Font size and color are set by default to 'red3', resp. '0.75'. 
 
When *Reduced==True*, the valued relation characeteristics are centered and reduced.
 
When *Colwise==True*, the column vectors of the adjacency table are used for the principal projection, otherwise the rows (default) are used. Has no incidence when the *Digraph* instance *self*  is symmetric. 
 
.. warning::
 
    The method, writing and reading temporary files: 
    tempCol.r and rotationCol.csv, resp. tempRow.r and rotationRow.csv,
    by default in the working directory (./),
    is hence not safe for multiprocessing programs, unless a
    temporary directory *tempDir* is provided.
flatChoice(self, ch, Debug=False)
Converts set or list ch recursively to a flat list of items.
forcedBestSingleChoice(self)
Renders the set of most determined outranking singletons in self.
gammaSets(self)
Renders the dictionary of neighborhoods {node: (dx,ax)}
with set *dx* gathering the dominated, and set *ax* gathering
the absorbed neighborhood.
generateAbsPreKernels(self)
Generate all absorbent prekernels from independent choices generator.
generateDomPreKernels(self)
Generate all dominant prekernels from independent choices generator.
htmlChoiceVector(self, ch, ChoiceVector=True, choiceType='good')
Show procedure for annotated bipolar choices.
inDegrees(self)
renders the median cut indegrees
inDegreesDistribution(self)
Renders the distribution of indegrees.
independentChoices(self, U)
Generator for all independent choices with neighborhoods of a bipolar valued digraph:
 
.. note::
 
       * Initiate with U = self.singletons().
       * Yields [(independent choice, domnb, absnb, indnb)].
inner_prod(self, v1, v2)
Parameters: two choice characteristic vectors
Renders the inner product of two characteristic vetors.
intstab(self, choice)
Computes the independence degree of a choice.
irreflex(self, mat)
Puts diagonal entries of mat to valuationdomain['min']
isAsymmetricIndeterminate(self, Debug=False)
Checks the self.relation for assymmetric indeterminateness!!
 
.. warning::
 
    The reflexive links are ignored !!
isComplete(self, Debug=False)
checks the completeness property of self.relation by checking
for the absence of a link between two actions!!
 
.. warning::
 
    The reflexive links are ignored !!
isCyclic(self, Debug=False)
checks the cyclicity of self.relation by checking
for a reflexive loop in its transitive closure-
 
.. warning::
 
     self.relation is supposed to be irreflexive !
isIntegerValued(self, Debug=False)
Checks whether the decimal valuation of self is integer-valued
be using the as_integer_ratio() method of a Decimal 
giving a tuple (numerator,denominator). If denominator == 1, the
number is an integer.
isOutrankingDigraph(self, Comments=True, Debug=False)
Checks the outranking digraph characteristic condition (3.3).
 
relation[x][y] + relation[y][x)[y] >= 0.0
 
.. warning::
 
    The reflexive links are ignored and the valuation must be bipolar !!
isStrictOutrankingDigraph(self, Comments=True, Debug=False)
Checks the strict outranking digraph characteristic condition (3.1).
 
-(relation[x][y] + relation[y][x]) <= 0.0 , x != y
 
.. warning::
 
    The reflexive links are ignored and the valuation must be bipolar !!
isSymmetric(self, Comments=False)
True if symmetry degree == 1.0.
isTransitive(self, Comments=False)
True if transitivity degree == 1.0.
isWeaklyComplete(self, Debug=False)
checks the weakly completeness property of self.relation by checking
for the absence of a link between two actions!!
 
.. warning::
 
    The reflexive links are ignored !!
iterateRankingByChoosing(self, Odd=False, CoDual=False, Comments=True, Debug=False, Limited=None)
Renders a ranking by choosing result when progressively eliminating
all chordless (odd only) circuits with rising valuation cut levels.
 
Parameters
    CoDual = False (default)/True
    Limited = proportion (in [0,1]) * (max - med) valuationdomain
kChoices(self, A, k)
Renders all choices of length k from set A
matmult2(self, m, v)
Parameters: digraph relation and choice characteristic vector
matrix multiply vector by inner production
meanDegree(self)
Renders the mean degree of self.
!!! self.size must be set previously !!!
meanLength(self, Oriented=False)
Renders the (by default non-oriented) mean neighbourhoor depth of self.
!!! self.order must be set previously !!!
minimalChoices(self, S)
Generates all dominant or absorbent choices of a bipolar
valued digraph.
 
.. note:
 
   * Initiate with S = (actions, dict of dominant or absorbent closed neighborhoods)
   * See showMinDom and showMinAbs methods.
minimalValuationLevelForCircuitsElimination(self, Odd=True, Debug=False, Comments=False)
renders the minimal valuation level <lambda> that eliminates all
self.circuitsList stored odd chordless circuits from self.
 
.. warning::
 
    The <lambda> level polarised may still contain newly appearing chordless odd circuits !
neighbourhoodCollection(self, Oriented=False, Potential=False)
Renders the neighbourhood.
neighbourhoodDepthDistribution(self, Oriented=False)
Renders the distribtion of neighbourhood depths.
notGammaSets(self)
Renders the dictionary of neighborhoods {node: (dx,ax)}
with set *dx* gathering the not dominated, and set *ax* gathering
the not absorbed neighborhood.
notaneighbors(self, node)
Renders the set of absorbed not in-neighbors of a node.
notdneighbors(self, node)
Renders the set of not dominated out-neighbors of a node.
outDegrees(self)
renders the median cut outdegrees
outDegreesDistribution(self)
Renders the distribution of outdegrees.
plusirredundant(self, U)
Generates all +irredundant choices of a digraph.
powerset(self, U)
Generates all subsets of a set.
readPerrinMisset(self, file='curd.dat')
read method for 0-1-char-coded MISs by default from the perrinMIS.c curd.dat result file.
readabsvector(self, x, relation)
Parameter: action x
absorbent in vector.
readdomvector(self, x, relation)
Parameter: action x
dominant out vector.
recodeValuation(self, newMin=-1.0, newMax=1.0, ndigits=4, Debug=False)
Recodes the characteristic valuation domain according
to the parameters given. 
 
*ndigits* indicates the number of decimal digits of the valuation.
relationFct(self, x, y)
wrapper for self.relation dictionary access to ensure interoperability
with the sparse and big outranking digraph implementation model.
save(self, fileName='tempdigraph', option=None, DecimalValuation=True, decDigits=2)
Persistent storage of a Digraph class instance in the form of
a python source code file
saveCSV(self, fileName='tempdigraph', Normalized=False, Dual=False, Converse=False, Diagonal=False, Debug=False)
Persistent storage of a Digraph class instance in the form of
a csv file.
saveXMCDA2(self, fileName='temp', fileExt='xmcda2', Comments=True, relationName='R', relationType='binary', category='random', subcategory='valued', author='digraphs Module (RB)', reference='saved from Python', valuationType='standard', digits=2, servingD3=False)
save digraph in XMCDA 2.0 format. Deprecated now.
savedre(self, fileName='temp')
save digraph in nauty format.
sharp(self, x, y)
Paramaters: choice characteristic values.
Renders the sharpest of two characteristic values x and y.
sharpvec(self, v, w)
Paramaters: choice characteristic vectors.
Renders the sharpest of two characteristic vectors v and w.
showActions(self)
presentation methods for digraphs actions
showAll(self)
Detailed show method for genuine digraphs.
showAttributes(self)
Prints out the attributes of self.
showAutomorphismGenerators(self)
Renders the generators of the automorphism group.
showBadChoices(self, Recompute=True)
Characteristic values for potentially bad choices.
showBestChoiceRecommendation(self, Verbose=False, Comments=True, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True)
Shows the RuBis best choice recommendation.
 
.. note::
 
    Computes by default the Rubis best choice recommendation on the corresponding strict (codual) outranking digraph.
 
    By default, with BrokenCocs=True, we brake all chordless circuits at their weakest determined ( abs(r(x>y)) + abs(r(y>x)) ) link.
 
    When BrokenCocs=False we proceed like follows:
 
    In case of chordless circuits, if supporting arcs are more credible
    than the reversed negating arcs, we collapse the circuits into hyper nodes.
    Inversely,  if supporting arcs are not more credible than the reversed negating arcs,
    we brake the circuits on their weakest arc.
 
Usage example:
 
>>> from outrankingDigraphs import *
>>> t = Random3ObjectivesPerformanceTableau(seed=5)
>>> g = BipolarOutrankingDigraph(t)
>>> g.showBestChoiceRecommendation()
***********************
RuBis Best Choice Recommendation (BCR)
(in decreasing order of determinateness)   
Credibility domain:  [-100.0, 100.0]
=== >> potential first choices
* choice              : ['a04', 'a14', 'a19', 'a20']
   independence        : 1.19
   dominance           : 4.76
   absorbency          : -59.52
   covering (%)        : 75.00
   determinateness (%) : 57.86
   - most credible action(s) = { 'a14': 23.81, 'a19': 11.90, 'a04': 2.38, 'a20': 1.19, }  
=== >> potential last choices 
* choice              : ['a03', 'a12', 'a17']
  independence        : 4.76
  dominance           : -76.19
  absorbency          : 4.76
  covering (%)        : 0.00
  determinateness (%) : 65.39
  - most credible action(s) = { 'a03': 38.10, 'a12': 13.10, 'a17': 4.76, }
Execution time: 0.024 seconds
*****************************
showChoiceVector(self, ch, choiceType='good', ChoiceVector=True)
Show procedure for annotated bipolar choices.
showChordlessCircuits(self, Recompute=False)
Show method for chordless circuits observed in a Digraph instance.
 
If previous computation is required, stores the detected circuits in self.circuitsList attribute.
showComponents(self)
Shows the list of connected components of the digraph instance.
showCorrelation(self, corr=None, ndigits=3)
Renders the valued ordinal correlation index, the crisp Kendall tau index and their epistemic determination degree.
showFirstChoiceRecommendation(self, Verbose=False, Comments=True, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True)
Shows the RuBis first choice recommendation.
 
.. note::
 
    Computes by default the Rubis first choice recommendation on the corresponding strict (codual) outranking digraph.
 
    By default, with BrokenCocs=True, we brake all chordless circuits at their weakest determined ( abs(r(x>y)) + abs(r(y>x)) ) link.
 
    When BrokenCocs=False we proceed like follows:
 
    In case of chordless circuits, if supporting arcs are more credible
    than the reversed negating arcs, we collapse the circuits into hyper nodes.
    Inversely,  if supporting arcs are not more credible than the reversed negating arcs,
    we brake the circuits on their weakest arc.
 
Usage example:
 
>>> from outrankingDigraphs import *
>>> t = Random3ObjectivesPerformanceTableau(seed=5)
>>> g = BipolarOutrankingDigraph(t)
>>> g.showFirstChoiceRecommendation()
***********************
RuBis First Choice Recommendation (BCR)
(in decreasing order of determinateness)   
Credibility domain:  [-100.0, 100.0]
=== >> potential first choices
* choice              : ['a04', 'a14', 'a19', 'a20']
   independence        : 1.19
   dominance           : 4.76
   absorbency          : -59.52
   covering (%)        : 75.00
   determinateness (%) : 57.86
   - most credible action(s) = { 'a14': 23.81, 'a19': 11.90, 'a04': 2.38, 'a20': 1.19, }  
=== >> potential last choices 
* choice              : ['a03', 'a12', 'a17']
  independence        : 4.76
  dominance           : -76.19
  absorbency          : 4.76
  covering (%)        : 0.00
  determinateness (%) : 65.39
  - most credible action(s) = { 'a03': 38.10, 'a12': 13.10, 'a17': 4.76, }
Execution time: 0.024 seconds
*****************************
showGoodChoices(self, Recompute=True)
Characteristic values for potentially good choices.
showHTMLBestChoiceRecommendation(self, pageTitle=None, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True, htmlFileName=None)
showHTMLRelationHeatmap(self, actionsList=None, rankingRule='NetFlows', colorLevels=7, tableTitle='Relation Heatmap', relationName='r(x S y)', ndigits=2, fromIndex=None, toIndex=None, htmlFileName=None)
Launches a browser window with the colored relation map of self.
 
See corresponding :py:class:`~digraphs.Digraph.showHTMLRelationMap` method.
 
The *colorLevels* parameter may be set to 3, 5, 7 (default) or 9.
 
When the *actionsList* parameter is *None* (default), the digraphs actions list may be ranked with the *rankingRule* parameter set to the 'Copeland' (default) or to the 'Netlows' ranking rule.
 
When the *htmlFileName* parameter is set to a string value 'xxx', a html file named 'xxx.html' will be generated in the current working directory. Otherwise, a temporary file named 'tmp*.html' will be generated there.
 
Example::
 
    >>> from outrankingDigraphs import *
    >>> t = RandomCBPerformanceTableau(numberOfActions=25,seed=1)
    >>> g = BipolarOutrankingDigraph(t,ndigits=2)
    >>> gcd = ~(-g)  # strict outranking relation
    >>> gcd.showHTMLRelationHeatmap(colorLevels=7,ndigits=2)
    
.. image:: relationHeatmap.png
   :alt: Browser view of a relation map
   :width: 600 px
   :align: center
showHTMLRelationMap(self, actionsList=None, rankingRule='Copeland', Colored=True, tableTitle='Relation Map', relationName='r(x S y)', symbols=['+', '&middot;', '&nbsp;', '&#150;', '&#151'], fromIndex=None, toIndex=None, htmlFileName=None)
Launches a browser window with the colored relation map of self.
See corresponding Digraph.showRelationMap() method.
 
When *htmlFileName* parameter is set to a string value, a html file
with that name will be stored in the current working directory.
 
By default, a temporary file named: tmp*.html will be generated
instead in the current working directory.
 
Example::
 
    >>> from outrankingDigraphs import *
    >>> t = RandomCBPerformanceTableau(numberOfActions=25,seed=1)
    >>> g = BipolarOutrankingDigraph(t,Normalized=True)
    >>> gcd = ~(-g)  # strict outranking relation
    >>> gcd.showHTMLRelationMap(rankingRule="NetFlows")
    
.. image:: relationMap.png
   :alt: Browser view of a relation map
   :width: 600 px
   :align: center
showHTMLRelationTable(self, actionsList=None, relation=None, IntegerValues=False, ndigits=2, Colored=True, tableTitle='Valued Adjacency Matrix', relationName='r(x S y)', ReflexiveTerms=False, htmlFileName=None, fromIndex=None, toIndex=None)
Launches a browser window with the colored relation table of self.
showMIS(self, withListing=True)
Prints all maximal independent choices:
    Result in self.misset.
showMIS_AH(self, withListing=True)
Prints all MIS using the Hertz method.
 
Result saved in self.hertzmisset.
showMIS_HB2(self, withListing=True)
Prints all MIS using the Hertz-Bisdorff method.
 
Result saved in self.newmisset.
showMIS_RB(self, withListing=True)
Prints all MIS using the Bisdorff method.
 
Result saved in self.newmisset.
showMIS_UD(self, withListing=True)
Prints all MIS using the Hertz-Bisdorff method.
 
Result saved in self.newmisset.
showMaxAbsIrred(self, withListing=True)
Computing maximal -irredundant choices:
    Result in self.absirset.
showMaxDomIrred(self, withListing=True)
Computing maximal +irredundant choices:
   Result in self.domirset.
showMinAbs(self, withListing=True)
Prints minimal absorbent choices:
    Result in self.absset.
showMinDom(self, withListing=True)
Prints all minimal dominant choices:
    Result in self.domset.
showNeighborhoods(self)
Lists the gamma and the notGamma function of self.
showOrbits(self, InChoices, withListing=True)
Prints the orbits of Choices along the automorphisms of
the Digraph instance.
 
Example Python session for computing the non isomorphic MISs from the 12-cycle graph:
 
>>> from digraphs import *
>>> c12 = CirculantDigraph(order=12,circulants=[1,-1])
>>> c12.automorphismGenerators()
...
  Permutations
  {'1': '1', '2': '12', '3': '11', '4': '10', '5': 
   '9', '6': '8', '7': '7', '8': '6', '9': '5', '10': 
   '4', '11': '3', '12': '2'}
  {'1': '2', '2': '1', '3': '12', '4': '11', '5': '10', 
   '6': '9', '7': '8', '8': '7', '9': '6', '10': '5', 
   '11': '4', '12': '3'}
  Reflections {}
>>> print('grpsize = ', c12.automorphismGroupSize)
  grpsize = 24
>>> c12.showMIS(withListing=False)
  *---  Maximal independent choices ---*
  number of solutions:  29
  cardinality distribution
  card.:  [0, 1, 2, 3, 4,  5,  6, 7, 8, 9, 10, 11, 12]
  freq.:  [0, 0, 0, 0, 3, 24,  2, 0, 0, 0,  0,  0,  0]
  Results in c12.misset
>>> c12.showOrbits(c12.misset,withListing=False)
...
  *---- Global result ----
  Number of MIS:  29
  Number of orbits :  4
  Labelled representatives:
  1: ['2','4','6','8','10','12']
  2: ['2','5','8','11']
  3: ['2','4','6','9','11']
  4: ['1','4','7','9','11']
  Symmetry vector
  stabilizer size: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, ...]
  frequency      : [0, 2, 0, 0, 0, 0, 0, 1, 0,  0,  0,  1, ...]
 
*Figure*: The symmetry axes of the non isomorphic MISs of the 12-cycle:
 
.. image:: c12.png
   :width: 400 px
   :align: center
   :alt: The 4 non isomorphic MIS of the 12-cycle graph
 
*Reference*: R. Bisdorff and J.L. Marichal (2008). Counting non-isomorphic maximal independent sets of the n-cycle graph. *Journal of Integer Sequences*, Vol. 11 Article 08.5.7 (`openly accessible here <https://www.cs.uwaterloo.ca/journals/JIS/VOL11/Marichal/marichal.html>`_)
showOrbitsFromFile(self, InFile, withListing=True)
Prints the orbits of Choices along the automorphisms of
the digraph self by reading in the 0-1 misset file format.
See the :py:func:`digraphs.Digraph.readPerrinMisset` method.
showPreKernels(self, withListing=True)
Printing dominant and absorbent preKernels:
    Result in self.dompreKernels and self.abspreKernels
showRankingByBestChoosing(self, rankingByBestChoosing=None)
A show method for self.rankinByBestChoosing result.
 
.. warning::
 
     The self.computeRankingByBestChoosing(CoDual=False/True) method instantiating the self.rankingByBestChoosing slot is pre-required !
showRankingByChoosing(self, rankingByChoosing=None, WithCoverCredibility=False)
A show method for self.rankinByChoosing result.
 
When parameter *WithCoverCredibility* is set to True, the credibility of outranking, respectively being outranked is indicated at each selection step. 
 
.. warning::
 
     The self.computeRankingByChoosing(CoDual=False/True) method instantiating the self.rankingByChoosing slot is pre-required !
showRankingByLastChoosing(self, rankingByLastChoosing=None, Debug=None)
A show method for self.rankinByChoosing result.
 
.. warning::
 
     The self.computeRankingByLastChoosing(CoDual=False/True) method instantiating the self.rankingByChoosing slot is pre-required !
showRelation(self)
prints the relation valuation in ##.## format.
showRelationMap(self, symbols=None, rankingRule='Copeland', fromIndex=None, toIndex=None, actionsList=None)
Prints on the console, in text map format, the location of
certainly validated and certainly invalidated outranking situations.
 
By default, symbols = {'max':'┬','positive': '+', 'median': ' ',
                       'negative': '-', 'min': '┴'}
 
The default ordering of the output is following the Copeland ranking rule
from best to worst actions. Further available ranking rule is the 'NetFlows' net flows rule.
 
 
Example::
 
    >>> from outrankingDigraphs import *
    >>> t = RandomCBPerformanceTableau(numberOfActions=25,seed=1)
    >>> g = BipolarOutrankingDigraph(t,Normalized=True)
    >>> gcd = ~(-g)  # strict outranking relation
    >>> gcd.showRelationMap(rankingRule="NetFlows")
     -   ++++++++  +++++┬+┬┬+
    - -   + +++++ ++┬+┬+++┬++
    ┴+  ┴ + ++  ++++┬+┬┬++┬++
    -   ++ - ++++-++++++┬++┬+
       - - - ++- ┬- + -+┬+-┬┬
    -----  -      -┬┬┬-+  -┬┬
    ----    --+-+++++++++++++
    -- --+- --++ ++ +++-┬+-┬┬
    ----  -  -+-- ++--+++++ +
    ----- ++- --- +---++++┬ +
    -- -- ---+ -++-+++-+ +-++
    -- --┴---+  + +-++-+ -  +
    ---- ┴---+-- ++--++++ - +
      --┴┴--  --- -  --+ --┬┬
     ---------+--+ ----- +-┬┬
    -┴---┴- ---+- + ---+++┬ +
    -┴┴--┴---+--- ++ -++--+++
    -----┴--- ---+-+- ++---+ 
    -┴┴--------------- --++┬ 
    --┴---------------- --+┬ 
    ┴--┴┴ -┴--┴┴-┴ --++  ++-+
    ----┴┴--------------- -  
    ┴┴┴----+-┴+┴---┴-+---+ ┴+
    ┴┴-┴┴┴-┴- - -┴┴---┴┴+ ┬ -
    ----┴┴-┴-----┴┴---  - -- 
    Ranking rule: NetFlows
    >>>
showRelationTable(self, Sorted=True, rankingRule=None, IntegerValues=False, actionsSubset=None, relation=None, ndigits=2, ReflexiveTerms=True, fromIndex=None, toIndex=None)
Prints the relation valuation in actions X actions table format.
Copeland and NetFlows rankings my be used.
showRubisBestChoiceRecommendation(self, **kwargs)
Dummy for backward portable showBestChoiceRecommendation().
showRubyChoice(self, Verbose=False, Comments=True, _OldCoca=True)
Dummy for showBestChoiceRecommendation()
needed for older versions compatibility.
showShort(self)
concise presentation method for genuine digraphs.
showSingletonRanking(self, Comments=True, Debug=False)
Calls self.computeSingletonRanking(comments=True,Debug = False).
Renders and prints the sorted bipolar net determinatation of outrankingness
minus outrankedness credibilities of all singleton choices.
 
res = ((netdet,sigleton,dom,absorb)+)
showStatistics(self)
Computes digraph statistics like order, size and arc-density.
showdre(self)
Shows relation in nauty format.
singletons(self)
list of singletons and neighborhoods
[(singx1, +nx1, -nx1, not(+nx1 or -nx1)),.... ]
sizeSubGraph(self, choice)
Output: (size, undeterm,arcDensity).
Renders the arc density of the induced subgraph.
strongComponents(self, setPotential=False)
Renders the set of strong components of self.
symDegreesDistribution(self)
Renders the distribution of symmetric degrees.
topologicalSort(self, Debug=False)
If self is acyclic, adds topological sort number to each node of self
and renders ordered list of nodes. Otherwise renders None.
Source: M. Golumbic Algorithmic Graph heory and Perfect Graphs,
Annals Of Discrete Mathematics 57 2nd Ed. , Elsevier 2004, Algorithm 2.4 p.44.
weakAneighbors(self, node)
Renders the set of absorbed in-neighbors of a node.
weakCondorcetLosers(self)
Renders the set of decision actions x such that
self.relation[x][y] <= self.valuationdomain['med']
for all y != x.
weakCondorcetWinners(self)
Renders the set of decision actions x such that
self.relation[x][y] >= self.valuationdomain['med']
for all y != x.
weakDneighbors(self, node)
Renders the set of dominated out-neighbors of a node.
weakGammaSets(self)
Renders the dictionary of neighborhoods {node: (dx,ax)}
zoomValuation(self, zoomFactor=1.0)
Zooms in or out, depending on the value of the zoomFactor provided,
the bipolar valuation of a digraph.

Data descriptors inherited from Digraph:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class BreakAddCocsDigraph(Digraph)
    BreakAddCocsDigraph(digraph=None, Piping=False, Comments=False, Threading=False, nbrOfCPUs=1)
 
Specialization of general Digraph class for instantiation
of chordless odd circuits augmented digraphs.
 
Parameters:
 
    - digraph: Stored or memory resident digraph instance.
    - Piping: using OS pipes for data in- and output between Python and C++.
 
A chordless odd circuit is added if the cumulated credibility of the circuit supporting arcs is larger or
equal to the cumulated credibility of the converse arcs. Otherwise, the circuit is broken at the weakest asymmetric link,
i.e. a link (*x*, *y*) with minimal difference between r(*x* S *y*) - r(*y* S *x*).
 
 
Method resolution order:
BreakAddCocsDigraph
Digraph
builtins.object

Methods defined here:
__init__(self, digraph=None, Piping=False, Comments=False, Threading=False, nbrOfCPUs=1)
Initialize self.  See help(type(self)) for accurate signature.
addCircuits(self, Comments=False)
Augmenting self with self.circuits.
closureChordlessOddCircuits(self, Piping=False, Comments=True, Debug=False, Threading=False, nbrOfCPUs=1)
Closure of chordless odd circuits extraction.
showCircuits(self, credibility=None, Debug=False)
show methods for chordless odd circuits in CocaGraph
showComponents(self)
Shows the list of connected components of the digraph instance.

Methods inherited from Digraph:
MISgen(self, S, I)
generator of maximal independent choices (voir Byskov 2004):
    * S ::= remaining nodes;
    * I ::= current independent choice
 
.. note::
 
        Inititalize: self.MISgen(self.actions.copy(),set())
__invert__(self)
Make the inverting operator ~self available for Digraph instances. 
 
Returns a ConverseDigraph instance of self.
__neg__(self)
Make the negation operator -self available for Digraph instances. 
 
Returns a DualDigraph instance of self.
__repr__(self)
Default presentation method for Digraph instances.
absirred(self, choice)
Renders the crips -irredundance degree of a choice.
absirredundant(self, U)
Generates all -irredundant choices of a digraph.
absirredval(self, choice, relation)
Renders the valued -irredundance degree of a choice.
absirredx(self, choice, x)
Computes the crips -irredundance degree of node x in a choice.
abskernelrestrict(self, prekernel)
Parameter: prekernel
Renders absorbent prekernel restricted relation.
absorb(self, choice)
Renders the absorbency degree of a choice.
absorbentChoices(self, S)
Generates all minimal absorbent choices of a bipolar valued digraph.
addValuationAttribute(self)
Adds the numpy valuation attribute
agglomerationDistribution(self)
Output: aggloCoeffDistribution, meanCoeff
Renders the distribution of agglomeration coefficients.
aneighbors(self, node)
Renders the set of absorbed in-neighbors of a node.
automorphismGenerators(self)
Adds automorphism group generators to the digraph instance.
 
.. note::
 
    Dependency: Uses the dreadnaut command from the nauty software package. See https://www3.cs.stonybrook.edu/~algorith/implement/nauty/implement.shtml
 
    On Ubuntu Linux:
      ...$ sudo apt-get install nauty
averageCoveringIndex(self, choice, direction='out')
Renders the average covering index of a given choice in a set of objects,
ie the average number of choice members that cover each
non selected object.
bipolarKCorrelation(self, digraph, Debug=False)
Renders the bipolar Kendall correlation between two bipolar valued
digraphs computed from the average valuation of the
XORDigraph(self,digraph) instance.
 
.. warning::
 
     Obsolete! Is replaced by the self.computeBipolarCorrelation(other) Digraph method
bipolarKDistance(self, digraph, Debug=False)
Renders the bipolar crisp Kendall distance between two bipolar valued
digraphs.
 
.. warning::
 
     Obsolete! Is replaced by the self.computeBipolarCorrelation(other, MedianCut=True) Digraph method
chordlessPaths(self, Pk, n2, Odd=False, Comments=False, Debug=False)
New procedure from Agrum study April 2009
recursive chordless path extraction starting from path
Pk = [n2, ...., n1] and ending in node n2.
Optimized with marking of visited chordless P1s.
circuitAverageCredibility(self, circ)
Renders the average linking credibility of a Chordless Circuit.
circuitCredibilities(self, circuit, Debug=False)
Renders the average linking credibilities and the minimal link of a Chordless Circuit.
circuitMaxCredibility(self, circ)
Renders the maximal linking credibility of a Chordless Circuit.
circuitMinCredibility(self, circ)
Renders the minimal linking credibility of a Chordless Circuit.
closeSymmetric(self, InSite=True)
Produces the symmetric closure of self.relation.
closeTransitive(self, Reverse=False, InSite=True, Comments=False)
Produces the transitive closure of self.relation
 
*Parameters*:
 
    - If *Reverse* == True (False default) all transitive links are dropped, otherwise all transitive links are closed with min[r(x,y),r(y,z)];
    - If *Insite* == False (True by default) the methods return a modified copy of self.relation without altering the original self.relation, otherwise self.relation is modified.
components(self)
Renders the list of connected components.
computeAllDensities(self, choice=None)
parameter: choice in self
renders six densitiy parameters:
arc density, double arc density,
single arc density, strict single arc density,
absence arc density, strict absence arc densitiy.
computeArrowRaynaudOrder(self)
Renders a linear ordering from worst to best of the actions following Arrow&Raynaud's rule.
computeArrowRaynaudRanking(self)
renders a linear ranking from best to worst of the actions following Arrow&Raynaud's rule.
computeAverageValuation(self)
Computes the bipolar average correlation between
self and the crisp complete digraph of same order
of the irreflexive and determined arcs of the digraph
computeBadChoices(self, Comments=False)
Computes characteristic values for potentially bad choices.
 
.. note::
 
     Returns a tuple with following content:
 
     [(0)-determ,(1)degirred,(2)degi,(3)degd,(4)dega,(5)str(choice),(6)absvec]
computeBadPirlotChoices(self, Comments=False)
Characteristic values for potentially bad choices
using the Pirlot's fixpoint algorithm.
computeBestChoiceRecommendation(self, Verbose=False, Comments=False, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True)
Sets self.bestChoice, self.bestChoiceData, self.worstChoice and self.worstChoiceData
with the showBestChoiceRecommendation method.
 
First and last choices data is the following:
[(0)-determ,(1)degirred,(2)degi,(3)degd,(4)dega,(5)str(choice),(6)domvec,(7)cover]
 
self.bestChoice = self.bestChoiceData[5]
self.worstChoice = self.worstChoiceData[5]
computeBipolarCorrelation(self, other, MedianCut=False, filterRelation=None, Debug=False)
obsolete: dummy replacement for Digraph.computeOrdinalCorrelation method
computeChordlessCircuits(self, Odd=False, Comments=False, Debug=False)
Renders the set of all chordless circuits detected in a digraph.
Result is stored in <self.circuitsList>
holding a possibly empty list of tuples with at position 0 the
list of adjacent actions of the circuit and at position 1
the set of actions in the stored circuit.
 
When *Odd* is True, only chordless circuits with an odd length
are collected.
computeChordlessCircuitsMP(self, Odd=False, Threading=False, nbrOfCPUs=None, startMethod=None, Comments=False, Debug=False)
Multiprocessing version of computeChordlessCircuits().
 
Renders the set of all chordless odd circuits detected in a digraph.
Result (possible empty list) stored in <self.circuitsList>
holding a possibly empty list tuples with at position 0 the
list of adjacent actions of the circuit and at position 1
the set of actions in the stored circuit.
Inspired by Dias, Castonguay, Longo, Jradi, Algorithmica (2015).
 
Returns a possibly empty list of tuples (circuit,frozenset(circuit)).
 
If Odd == True, only circuits of odd length are retained in the result.
computeCoSize(self)
Renders the number of non validated non reflexive arcs
computeConcentrationIndex(self, X, N)
Renders the Gini concentration index of the X serie.
N contains the partial frequencies.
Based on the triangle summation formula.
computeConcentrationIndexTrapez(self, X, N)
Renders the Gini concentration index of the X serie.
N contains the partial frequencies.
Based on the triangles summation formula.
computeCondorcetLosers(self)
Wrapper for condorcetLosers().
computeCondorcetWinners(self)
Wrapper for condorcetWinners().
computeCopelandOrder(self)
renders a linear ordering from worst to best of the actions following Arrow&Raynaud's rule.
computeCopelandRanking(self)
renders a linear ranking from best to worst of the actions following Arrow&Raynaud's rule.
computeCutLevelDensities(self, choice, level)
parameter: choice in self, robustness level
renders three robust densitiy parameters:
robust double arc density,
robust single arc density,
robust absence arc densitiy.
computeDensities(self, choice)
parameter: choice in self
renders the four densitiy parameters:
arc density, double arc density, single arc density, absence arc density.
computeDeterminateness(self, InPercents=False)
Computes the Kendalll distance of self
with the all median-valued indeterminate digraph of order n.
 
Return the average determination of the irreflexive part of the digraph.
 
*determination* = sum_(x,y) { abs[ r(xRy) - Med ] } / n(n-1)
 
If *InPercents* is True, returns the average determination in percentage of
(Max - Med) difference.
 
>>> from outrankingDigraphs import BipolarOutrankingDigraph
>>> from randomPerfTabs import Random3ObjectivesPerformanceTableau
>>> t = Random3ObjectivesPerformanceTableau(numberOfActions=7,numberOfCriteria=7,seed=101)
>>> g = BipolarOutrankingDigraph(t,Normalized=True)
>>> g
*------- Object instance description ------*
Instance class      : BipolarOutrankingDigraph
Instance name       : rel_random3ObjectivesPerfTab
Actions             : 7
Criteria            : 7
Size                : 27
Determinateness (%) : 65.67
Valuation domain    : [-1.00;1.00]
>>> print(g.computeDeterminateness())
0.3134920634920634920634920638
>>> print(g.computeDeterminateness(InPercents=True))
65.67460317460317460317460320
>>> g.recodeValuation(0,1)
>>> g
*------- Object instance description ------*
Instance class      : BipolarOutrankingDigraph
Instance name       : rel_random3ObjectivesPerfTab
Actions             : 7
Criteria            : 7
Size                : 27
Determinateness (%) : 65.67
Valuation domain    : [0.00;1.00]
>>> print(g.computeDeterminateness())
0.1567460317460317460317460318
>>> print(g.computeDeterminateness(InPercents=True))
65.67460317460317460317460320
computeDiameter(self, Oriented=True)
Renders the (by default oriented) diameter of the digraph instance
computeDigraphCentres(self, WeakDistances=False, Comments=False)
The centers of a digraph are the nodes with finite minimal shortes path lengths.
 
The maximal neighborhood distances are stored in *self.maximalNeighborhoodDistances*.
 
The corresponding digraph radius and diameter are stored respectively  in *self.radius* and *self.diameter*.
 
With *Comments* = True, all these results are printed out.
 
*Source*: Claude Berge, *The Theory of Graphs*, Dover (2001) pp. 119, original in French Dunod (1958)
computeDynamicProgrammingStages(self, source, sink, Debug=False)
Renders the discrete stages of the optimal substructure for
dynamic pogramming digrahs from a given source node 
to a given sink sink node.
 
Returns a list of list of action identifyers.
computeGoodChoiceVector(self, ker, Comments=False)
| Computing Characteristic values for dominant pre-kernels
| using the von Neumann dual fixoint equation
computeGoodChoices(self, Comments=False)
Computes characteristic values for potentially good choices.
 
..note::
 
     Return a tuple with following content:
 
     [(0)-determ,(1)degirred,(2)degi,(3)degd,(4)dega,(5)str(choice),(6)domvec,(7)cover]
computeGoodPirlotChoices(self, Comments=False)
Characteristic values for potentially good choices
using the Pirlot fixpoint algorithm.
computeIncomparabilityDegree(self, InPercents=False, Comments=False)
Renders the incomparability degree (Decimal), i.e. the relative number of symmetric indeterminate relations of the irreflexive part of a digraph.
computeKemenyIndex(self, otherRelation)
renders the Kemeny index of the self.relation
compared with a given crisp valued relation of a compatible
other digraph (same nodes or actions).
computeKemenyOrder(self, orderLimit=7, Debug=False)
Renders a ordering from worst to best of the actions with maximal Kemeny index.
Return a tuple: kemenyOrder (from worst to best), kemenyIndex
computeKemenyRanking(self, orderLimit=7, seed=None, sampleSize=1000, Debug=False)
Renders a ranking from best to worst of the actions with maximal Kemeny index.
 
.. note::
 
     Returns a tuple: kemenyRanking (from best to worst), kemenyIndex.
computeKernelVector(self, kernel, Initial=True, Comments=False)
| Computing Characteristic values for dominant pre-kernels
| using the von Neumann dual fixpoint equation
computeKohlerOrder(self)
Renders an ordering (worst to best) of the actions following Kohler's rule.
computeKohlerRanking(self)
Renders a ranking (best to worst) of the actions following Kohler's rule.
computeMaxHoleSize(self, Comments=False)
Renders the length of the largest chordless cycle
in the corresponding disjunctive undirected graph.
computeMeanInDegree(self)
Renders the mean indegree of self.
!!! self.size must be set previously !!!
computeMeanOutDegree(self)
Renders the mean degree of self.
!!! self.size must be set previously !!!
computeMeanSymDegree(self)
Renders the mean degree of self.
!!! self.size must be set previously !!!
computeMedianOutDegree(self)
Renders the median outdegree of self.
!!! self.size must be set previously !!!
computeMedianSymDegree(self)
Renders the median symmetric degree of self.
!!! self.size must be set previously !!!
computeMoreOrLessUnrelatedPairs(self)
Renders a list of more or less unrelated pairs.
computeNetFlowsOrder(self)
Renders an ordered list (from best to worst) of the actions
following the net flows ranking rule.
computeNetFlowsOrderDict(self)
Renders an ordered list (from worst to best) of the actions
following the net flows ranking rule.
computeNetFlowsRanking(self)
Renders an ordered list (from best to worst) of the actions
following the net flows ranking rule.
computeNetFlowsRankingDict(self)
Renders an ordered list (from best to worst) of the actions
following the net flows ranking rule.
computeODistance(self, op2, comments=False)
renders the squared normalized distance of
two digraph valuations.
 
.. note::
 
     op2 = digraphs of same order as self.
computeOrbit(self, choice, withListing=False)
renders the set of isomorph copies of a choice following
the automorphism of the digraph self
computeOrderCorrelation(self, order, Debug=False)
Renders the ordinal correlation K of a digraph instance
when compared with a given linear order (from worst to best) of its actions
 
K = sum_{x != y} [ min( max(-self.relation(x,y)),other.relation(x,y), max(self.relation(x,y),-other.relation(x,y)) ]
 
K /= sum_{x!=y} [ min(abs(self.relation(x,y),abs(other.relation(x,y)) ]
 
.. note::
 
     Renders a dictionary with the key 'correlation' containing the actual bipolar correlation index and the key 'determination' containing the minimal determination level D of self and the other relation.
 
     D = sum_{x != y} min(abs(self.relation(x,y)),abs(other.relation(x,y)) / n(n-1)
 
     where n is the number of actions considered.
 
     The correlation index with a completely indeterminate relation
     is by convention 0.0 at determination level 0.0 .
 
.. warning::
 
     self must be a normalized outranking digraph instance !
computeOrdinalCorrelation(self, other, MedianCut=False, filterRelation=None, Debug=False)
Renders the bipolar correlation K of a
self.relation when compared
with a given compatible (same actions set)) digraph or
a [-1,1] valued compatible relation (same actions set).
 
If MedianCut=True, the correlation is computed on the median polarized relations.
 
If filterRelation is not None, the correlation is computed on the partial domain corresponding to the determined part of the filter relation.
 
.. warning::
 
     Notice that the 'other' relation and/or the 'filterRelation',
     the case given, must both be normalized, ie [-1,1]-valued !
 
K = sum_{x != y} [ min( max(-self.relation[x][y]),other.relation[x][y]), max(self.relation[x][y],-other.relation[x][y]) ]
 
K /= sum_{x!=y} [ min(abs(self.relation[x][y]),abs(other.relation[x][y])) ]
 
.. note::
 
     Renders a tuple with at position 0 the actual bipolar correlation index
     and in position 1 the minimal determination level D of self and
     the other relation.
 
     D = sum_{x != y} min(abs(self.relation[x][y]),abs(other.relation[x][y])) / n(n-1)
 
     where n is the number of actions considered.
 
     The correlation index with a completely indeterminate relation
     is by convention 0.0 at determination level 0.0 .
computeOrdinalCorrelationMP(self, other, MedianCut=False, Threading=False, nbrOfCPUs=None, startMethod=None, Comments=False, Debug=False)
Multi processing version of the digraphs.computeOrdinalCorrelation() method.
 
.. note::
     The relation filtering and the MedinaCut option are not implemented in the MP version.
computePairwiseClusterComparison(self, K1, K2, Debug=False)
Computes the pairwise cluster comparison credibility vector
from bipolar-valued digraph g. with K1 and K2 disjoint
lists of action keys from g actions disctionary.
Returns the dictionary
{'I': Decimal(),'P+':Decimal(),'P-':Decimal(),'R' :Decimal()}
where one and only one item is strictly positive.
computePreKernels(self)
computing dominant and absorbent preKernels:
    Result in self.dompreKernels and self.abspreKernels
computePreRankingRelation(self, preRanking, Normalized=True, Debug=False)
Renders the bipolar-valued relation obtained from
a given preRanking in decreasing levels (list of lists) result.
computePreorderRelation(self, preorder, Normalized=True, Debug=False)
Renders the bipolar-valued relation obtained from
a given preordering in increasing levels (list of lists) result.
computePrincipalOrder(self, Colwise=False, Comments=False)
Rendesr an ordering from wrost to best of the decision actions.
computePrincipalRanking(self, Colwise=False, Comments=False)
Rendesr a ranking from best to worst of the decision actions.
computePrincipalScores(self, plotFileName=None, Colwise=False, imageType=None, tempDir=None, bgcolor='cornsilk', Comments=False, Debug=False)
Renders a ordered list of the first principal eigenvector of the covariance of the valued outdegrees of self.
 
.. note::
 
   The method, relying on writing and reading temporary files by default in a temporary directory is threading and multiprocessing safe !
   (see Digraph.exportPrincipalImage method)
computePrudentBetaLevel(self, Debug=False)
computes alpha, ie the lowest valuation level, for which the
bipolarly polarised digraph doesn't contain a chordless circuit.
computeRankingByBestChoosing(self, CoDual=False, Debug=False)
Computes a weak preordering of the self.actions by recursive
best choice elagations.
 
Stores in self.rankingByBestChoosing['result'] a list of (P+,bestChoice) tuples
where P+ gives the best choice complement outranking
average valuation via the computePairwiseClusterComparison
method.
 
If self.rankingByBestChoosing['CoDual'] is True, 
the ranking-by-choosing was computed on the codual of self.
computeRankingByBestChoosingRelation(self, rankingByBestChoosing=None, Debug=False)
Renders the bipolar-valued relation obtained from
the self.rankingByBestChoosing result.
computeRankingByChoosing(self, actionsSubset=None, Debug=False, CoDual=False)
Computes a weak preordring of the self.actions by iterating
jointly first and last choice elagations.
 
Stores in self.rankingByChoosing['result'] a list of ((P+,bestChoice),(P-,worstChoice)) pairs
where P+ (resp. P-) gives the best (resp. worst) choice complement outranking
(resp. outranked) average valuation via the computePairwiseClusterComparison
method.
 
If self.rankingByChoosing['CoDual'] is True, the ranking-by-choosing was computed on the codual of self.
computeRankingByChoosingRelation(self, rankingByChoosing=None, actionsSubset=None, Debug=False)
Renders the bipolar-valued relation obtained from
the self.rankingByChoosing result.
computeRankingByLastChoosing(self, CoDual=False, Debug=False)
Computes a weak preordring of the self.actions by iterating
worst choice elagations.
 
Stores in self.rankingByLastChoosing['result'] a list of (P-,worstChoice) pairs
where P- gives the worst choice complement outranked
average valuation via the computePairwiseClusterComparison
method.
 
If self.rankingByChoosing['CoDual'] is True, the ranking-by-last-chossing 
was computed on the codual of self.
computeRankingByLastChoosingRelation(self, rankingByLastChoosing=None, Debug=False)
Renders the bipolar-valued relation obtained from
the self.rankingByLastChoosing result.
computeRankingCorrelation(self, ranking, Debug=False)
Renders the ordinal correlation K of a digraph instance
when compared with a given linear ranking of its actions
 
K = sum_{x != y} [ min( max(-self.relation(x,y)),other.relation(x,y), max(self.relation(x,y),-other.relation(x,y)) ]
 
K /= sum_{x!=y} [ min(abs(self.relation(x,y),abs(other.relation(x,y)) ]
 
.. note::
 
     Renders a tuple with at position 0 the actual bipolar correlation index
     and in position 1 the minimal determination level D of self and
     the other relation.
 
     D = sum_{x != y} min(abs(self.relation(x,y)),abs(other.relation(x,y)) / n(n-1)
 
     where n is the number of actions considered.
 
     The correlation index with a completely indeterminate relation
     is by convention 0.0 at determination level 0.0 .
computeRelationalStructure(self, Debug=False)
Renders the counted decomposition of the valued relations into
the following type of links:
gt '>', eq '=', lt '<', incomp '<>',
leq '<=', geq '>=', indeterm '?'
computeRubisChoice(self, Comments=False, _OldCoca=False, BrokenCocs=True, Threading=False, nbrOfCPUs=1)
Renders self.strictGoodChoices, self.nullChoices
self.strictBadChoices, self.nonRobustChoices.
 
.. warning::
    Changes in site the outranking digraph by
    adding or braking chordless odd outranking circuits.
computeRubyChoice(self, Comments=False, _OldCoca=False)
dummy for computeRubisChoice()
old versions compatibility.
computeShortestPathLengths(self, WeakPaths=False, Comments=False, Debug=False)
Renders a double dictionary with the directed distances, i.e. the shortest path lengths between all self.actions
 
Equals *None* if there does not exist a directed path between two actions.
 
*Source*: Claude Berge, *The Theory of Graphs*, Dover (2001) pp. 119, original in French Dunod (1958)
computeSingletonRanking(self, Comments=False, Debug=False)
Renders the sorted bipolar net determinatation of outrankingness
minus outrankedness credibilities of all singleton choices.
 
res = ((netdet,singleton,dom,absorb)+)
computeSize(self)
Renders the number of validated non reflexive arcs
computeSizeTransitiveClosure(self)
Renders the size of the transitive closure of a digraph.
computeSlaterOrder(self, isProbabilistic=False, seed=None, sampleSize=1000, Debug=False)
Reversed return from computeSlaterRanking method.
computeSlaterRanking(self, isProbabilistic=False, seed=None, sampleSize=1000, Debug=False)
Renders a ranking of the actions with minimal Slater index.
Return a tuple: slaterOrder, slaterIndex
computeSymmetryDegree(self, InPercents=False, Comments=False)
Renders the symmetry degree (Decimal) of the irreflexive part of a digraph.
 
.. note::
 
   Empty and indeterminate digraphs are considered to be symmetric.
computeTopologicalRanking(self, Debug=False)
Mimetic Wrapper of the topologicalSort() method.
computeTransitivityDegree(self, InPercents=False, Comments=False)
Renders the transitivity degree (Decimal) of a digraph.
 
.. note:: 
 
   An empty or indeterminate digraph is considered to be transitive.
computeUnrelatedPairs(self)
Renders a list of more or less unrelated pairs.
computeValuationLevels(self, choice=None, Debug=False)
renders the symmetric closure of the
apparent valuations levels of self
in an increasingly ordered list.
If parameter choice is given, the
computation is limited to the actions
of the choice.
computeValuationPercentages(self, choice, percentiles, withValues=False)
Parameters: choice and list of percentiles.
renders a series of percentages of the characteristics valuation of
the arcs in the digraph.
computeValuationPercentiles(self, choice, percentages, withValues=False)
Parameters: choice and list of percentages.
renders a series of quantiles of the characteristics valuation of
the arcs in the digraph.
computeValuationStatistics(self, Sampling=False, Comments=False)
Renders the mean and variance of the valuation
of the non reflexive pairs.
computeValuedRankingRelation(self, ranking)
Renders the valued relation characteristics compatible 
with the given linar ranking. Discordant charcateristics 
are set to the indeterminate value.
computeWeakCondorcetLosers(self)
Wrapper for weakCondorcetLosers().
computeWeakCondorcetWinners(self)
Wrapper for weakCondorcetWinners().
computeupdown1(self, s, S)
Help method for show_MIS_HB2 method.
fills self.newmisset, self.upmis, self.downmis.
computeupdown2(self, s, S)
Help method for show_MIS_HB1 method.
Fills self.newmisset, self.upmis, self.downmis.
computeupdown2irred(self, s, S)
Help method for show_MIS_HB1 method.
Fills self.newmisset, self.upmis, self.downmis.
condorcetLosers(self)
Renders the set of decision actions x such that
self.relation[x][y] < self.valuationdomain['med']
for all y != x.
condorcetWinners(self)
Renders the set of decision actions x such that
self.relation[x][y] > self.valuationdomain['med']
for all y != x.
contra(self, v)
Parameter: choice.
Renders the negation of a choice v characteristic's vector.
convertRelationToDecimal(self)
Converts the float valued self.relation in a decimal valued one.
convertValuation2Integer(self, InSite=True, Comments=False)
Converts the self.relation valuation to integer values by converting the Decimals to Fractions and multiply by the least commun multiple of the fraction denominators.
 
*Parameters*:
 
    - If *Insite* == False (True by default) the method returns a modified copy of self.relation without altering the original self.relation, otherwise self.relation and self.valuationdomain is modified.
convertValuationToDecimal(self)
Convert the float valuation limits to Decimals.
coveringIndex(self, choice, direction='out')
Renders the covering index of a given choice in a set of objects,
ie the minimum number of choice members that cover each
non selected object.
crispKDistance(self, digraph, Debug=False)
Renders the crisp Kendall distance between two bipolar valued
digraphs.
 
.. warning::
 
     Obsolete! Is replaced by the self.computeBipolarCorrelation(other, MedianCut=True) Digraph method
detectChordlessCircuits(self, Comments=False, Debug=False)
Detects a chordless circuit in a digraph.
Returns a Boolean
detectChordlessPath(self, Pk, n2, Comments=False, Debug=False)
New procedure from Agrum study April 2009
recursive chordless path extraction starting from path
Pk = [n2, ...., n1] and ending in node n2.
Optimized with marking of visited chordless P1s.
determinateness(self, vec, inPercent=True)
Renders the determinateness of a characteristic vector *vec* = 
[(r(x),x),(r(y),y), ...] of length *n* in valuationdomain [Min,Med,Max]:
 
*result* =  sum_x( abs(r(x)-Med) ) / ( n*(Max-Med) )
 
If inPercent, *result* shifted (+1) and reduced (/2) to [0,1] range.
digraph2Graph(self, valuationDomain={'min': -1, 'med': 0, 'max': 1}, Debug=False, ConjunctiveConversion=True)
Convert a Digraph instance to a Graph instance.
dneighbors(self, node)
Renders the set of dominated out-neighbors of a node.
domin(self, choice)
Renders the dominance degree of a choice.
dominantChoices(self, S)
Generates all minimal dominant choices of a bipolar valued digraph.
 
.. note::
 
     Initiate with S = self.actions.copy().
domirred(self, choice)
Renders the crips +irredundance degree of a choice.
domirredval(self, choice, relation)
Renders the valued +irredundance degree of a choice.
domirredx(self, choice, x)
Renders the crips +irredundance degree of node x in a choice.
domkernelrestrict(self, prekernel)
Parameter: dominant prekernel
Renders dominant prekernel restricted relation.
exportGraphViz(self, fileName=None, actionsSubset=None, bestChoice=set(), worstChoice=set(), firstChoice=set(), lastChoice=set(), Comments=True, graphType='png', pictureFormat=None, graphSize='7,7', relation=None, bgcolor='cornsilk')
export GraphViz dot file  for graph drawing filtering.
exportPrincipalImage(self, plotFileName=None, pictureFormat='pdf', bgcolor='cornsilk', fontcolor='red3', fontsize='0.75', Reduced=False, Colwise=False, tempDir='.', Comments=False)
Export as PDF (default) the principal projection of
the valued relation using the three principal eigen vectors.
 
Implemeted picture formats are: 
'pdf' (default), 'png', 'jpeg' and 'xfig'.
 
The background color is set by default to 'cornsilk'. 
 
Font size and color are set by default to 'red3', resp. '0.75'. 
 
When *Reduced==True*, the valued relation characeteristics are centered and reduced.
 
When *Colwise==True*, the column vectors of the adjacency table are used for the principal projection, otherwise the rows (default) are used. Has no incidence when the *Digraph* instance *self*  is symmetric. 
 
.. warning::
 
    The method, writing and reading temporary files: 
    tempCol.r and rotationCol.csv, resp. tempRow.r and rotationRow.csv,
    by default in the working directory (./),
    is hence not safe for multiprocessing programs, unless a
    temporary directory *tempDir* is provided.
flatChoice(self, ch, Debug=False)
Converts set or list ch recursively to a flat list of items.
forcedBestSingleChoice(self)
Renders the set of most determined outranking singletons in self.
gammaSets(self)
Renders the dictionary of neighborhoods {node: (dx,ax)}
with set *dx* gathering the dominated, and set *ax* gathering
the absorbed neighborhood.
generateAbsPreKernels(self)
Generate all absorbent prekernels from independent choices generator.
generateDomPreKernels(self)
Generate all dominant prekernels from independent choices generator.
htmlChoiceVector(self, ch, ChoiceVector=True, choiceType='good')
Show procedure for annotated bipolar choices.
inDegrees(self)
renders the median cut indegrees
inDegreesDistribution(self)
Renders the distribution of indegrees.
independentChoices(self, U)
Generator for all independent choices with neighborhoods of a bipolar valued digraph:
 
.. note::
 
       * Initiate with U = self.singletons().
       * Yields [(independent choice, domnb, absnb, indnb)].
inner_prod(self, v1, v2)
Parameters: two choice characteristic vectors
Renders the inner product of two characteristic vetors.
intstab(self, choice)
Computes the independence degree of a choice.
irreflex(self, mat)
Puts diagonal entries of mat to valuationdomain['min']
isAsymmetricIndeterminate(self, Debug=False)
Checks the self.relation for assymmetric indeterminateness!!
 
.. warning::
 
    The reflexive links are ignored !!
isComplete(self, Debug=False)
checks the completeness property of self.relation by checking
for the absence of a link between two actions!!
 
.. warning::
 
    The reflexive links are ignored !!
isCyclic(self, Debug=False)
checks the cyclicity of self.relation by checking
for a reflexive loop in its transitive closure-
 
.. warning::
 
     self.relation is supposed to be irreflexive !
isIntegerValued(self, Debug=False)
Checks whether the decimal valuation of self is integer-valued
be using the as_integer_ratio() method of a Decimal 
giving a tuple (numerator,denominator). If denominator == 1, the
number is an integer.
isOutrankingDigraph(self, Comments=True, Debug=False)
Checks the outranking digraph characteristic condition (3.3).
 
relation[x][y] + relation[y][x)[y] >= 0.0
 
.. warning::
 
    The reflexive links are ignored and the valuation must be bipolar !!
isStrictOutrankingDigraph(self, Comments=True, Debug=False)
Checks the strict outranking digraph characteristic condition (3.1).
 
-(relation[x][y] + relation[y][x]) <= 0.0 , x != y
 
.. warning::
 
    The reflexive links are ignored and the valuation must be bipolar !!
isSymmetric(self, Comments=False)
True if symmetry degree == 1.0.
isTransitive(self, Comments=False)
True if transitivity degree == 1.0.
isWeaklyComplete(self, Debug=False)
checks the weakly completeness property of self.relation by checking
for the absence of a link between two actions!!
 
.. warning::
 
    The reflexive links are ignored !!
iterateRankingByChoosing(self, Odd=False, CoDual=False, Comments=True, Debug=False, Limited=None)
Renders a ranking by choosing result when progressively eliminating
all chordless (odd only) circuits with rising valuation cut levels.
 
Parameters
    CoDual = False (default)/True
    Limited = proportion (in [0,1]) * (max - med) valuationdomain
kChoices(self, A, k)
Renders all choices of length k from set A
matmult2(self, m, v)
Parameters: digraph relation and choice characteristic vector
matrix multiply vector by inner production
meanDegree(self)
Renders the mean degree of self.
!!! self.size must be set previously !!!
meanLength(self, Oriented=False)
Renders the (by default non-oriented) mean neighbourhoor depth of self.
!!! self.order must be set previously !!!
minimalChoices(self, S)
Generates all dominant or absorbent choices of a bipolar
valued digraph.
 
.. note:
 
   * Initiate with S = (actions, dict of dominant or absorbent closed neighborhoods)
   * See showMinDom and showMinAbs methods.
minimalValuationLevelForCircuitsElimination(self, Odd=True, Debug=False, Comments=False)
renders the minimal valuation level <lambda> that eliminates all
self.circuitsList stored odd chordless circuits from self.
 
.. warning::
 
    The <lambda> level polarised may still contain newly appearing chordless odd circuits !
neighbourhoodCollection(self, Oriented=False, Potential=False)
Renders the neighbourhood.
neighbourhoodDepthDistribution(self, Oriented=False)
Renders the distribtion of neighbourhood depths.
notGammaSets(self)
Renders the dictionary of neighborhoods {node: (dx,ax)}
with set *dx* gathering the not dominated, and set *ax* gathering
the not absorbed neighborhood.
notaneighbors(self, node)
Renders the set of absorbed not in-neighbors of a node.
notdneighbors(self, node)
Renders the set of not dominated out-neighbors of a node.
outDegrees(self)
renders the median cut outdegrees
outDegreesDistribution(self)
Renders the distribution of outdegrees.
plusirredundant(self, U)
Generates all +irredundant choices of a digraph.
powerset(self, U)
Generates all subsets of a set.
readPerrinMisset(self, file='curd.dat')
read method for 0-1-char-coded MISs by default from the perrinMIS.c curd.dat result file.
readabsvector(self, x, relation)
Parameter: action x
absorbent in vector.
readdomvector(self, x, relation)
Parameter: action x
dominant out vector.
recodeValuation(self, newMin=-1.0, newMax=1.0, ndigits=4, Debug=False)
Recodes the characteristic valuation domain according
to the parameters given. 
 
*ndigits* indicates the number of decimal digits of the valuation.
relationFct(self, x, y)
wrapper for self.relation dictionary access to ensure interoperability
with the sparse and big outranking digraph implementation model.
save(self, fileName='tempdigraph', option=None, DecimalValuation=True, decDigits=2)
Persistent storage of a Digraph class instance in the form of
a python source code file
saveCSV(self, fileName='tempdigraph', Normalized=False, Dual=False, Converse=False, Diagonal=False, Debug=False)
Persistent storage of a Digraph class instance in the form of
a csv file.
saveXMCDA2(self, fileName='temp', fileExt='xmcda2', Comments=True, relationName='R', relationType='binary', category='random', subcategory='valued', author='digraphs Module (RB)', reference='saved from Python', valuationType='standard', digits=2, servingD3=False)
save digraph in XMCDA 2.0 format. Deprecated now.
savedre(self, fileName='temp')
save digraph in nauty format.
sharp(self, x, y)
Paramaters: choice characteristic values.
Renders the sharpest of two characteristic values x and y.
sharpvec(self, v, w)
Paramaters: choice characteristic vectors.
Renders the sharpest of two characteristic vectors v and w.
showActions(self)
presentation methods for digraphs actions
showAll(self)
Detailed show method for genuine digraphs.
showAttributes(self)
Prints out the attributes of self.
showAutomorphismGenerators(self)
Renders the generators of the automorphism group.
showBadChoices(self, Recompute=True)
Characteristic values for potentially bad choices.
showBestChoiceRecommendation(self, Verbose=False, Comments=True, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True)
Shows the RuBis best choice recommendation.
 
.. note::
 
    Computes by default the Rubis best choice recommendation on the corresponding strict (codual) outranking digraph.
 
    By default, with BrokenCocs=True, we brake all chordless circuits at their weakest determined ( abs(r(x>y)) + abs(r(y>x)) ) link.
 
    When BrokenCocs=False we proceed like follows:
 
    In case of chordless circuits, if supporting arcs are more credible
    than the reversed negating arcs, we collapse the circuits into hyper nodes.
    Inversely,  if supporting arcs are not more credible than the reversed negating arcs,
    we brake the circuits on their weakest arc.
 
Usage example:
 
>>> from outrankingDigraphs import *
>>> t = Random3ObjectivesPerformanceTableau(seed=5)
>>> g = BipolarOutrankingDigraph(t)
>>> g.showBestChoiceRecommendation()
***********************
RuBis Best Choice Recommendation (BCR)
(in decreasing order of determinateness)   
Credibility domain:  [-100.0, 100.0]
=== >> potential first choices
* choice              : ['a04', 'a14', 'a19', 'a20']
   independence        : 1.19
   dominance           : 4.76
   absorbency          : -59.52
   covering (%)        : 75.00
   determinateness (%) : 57.86
   - most credible action(s) = { 'a14': 23.81, 'a19': 11.90, 'a04': 2.38, 'a20': 1.19, }  
=== >> potential last choices 
* choice              : ['a03', 'a12', 'a17']
  independence        : 4.76
  dominance           : -76.19
  absorbency          : 4.76
  covering (%)        : 0.00
  determinateness (%) : 65.39
  - most credible action(s) = { 'a03': 38.10, 'a12': 13.10, 'a17': 4.76, }
Execution time: 0.024 seconds
*****************************
showChoiceVector(self, ch, choiceType='good', ChoiceVector=True)
Show procedure for annotated bipolar choices.
showChordlessCircuits(self, Recompute=False)
Show method for chordless circuits observed in a Digraph instance.
 
If previous computation is required, stores the detected circuits in self.circuitsList attribute.
showCorrelation(self, corr=None, ndigits=3)
Renders the valued ordinal correlation index, the crisp Kendall tau index and their epistemic determination degree.
showFirstChoiceRecommendation(self, Verbose=False, Comments=True, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True)
Shows the RuBis first choice recommendation.
 
.. note::
 
    Computes by default the Rubis first choice recommendation on the corresponding strict (codual) outranking digraph.
 
    By default, with BrokenCocs=True, we brake all chordless circuits at their weakest determined ( abs(r(x>y)) + abs(r(y>x)) ) link.
 
    When BrokenCocs=False we proceed like follows:
 
    In case of chordless circuits, if supporting arcs are more credible
    than the reversed negating arcs, we collapse the circuits into hyper nodes.
    Inversely,  if supporting arcs are not more credible than the reversed negating arcs,
    we brake the circuits on their weakest arc.
 
Usage example:
 
>>> from outrankingDigraphs import *
>>> t = Random3ObjectivesPerformanceTableau(seed=5)
>>> g = BipolarOutrankingDigraph(t)
>>> g.showFirstChoiceRecommendation()
***********************
RuBis First Choice Recommendation (BCR)
(in decreasing order of determinateness)   
Credibility domain:  [-100.0, 100.0]
=== >> potential first choices
* choice              : ['a04', 'a14', 'a19', 'a20']
   independence        : 1.19
   dominance           : 4.76
   absorbency          : -59.52
   covering (%)        : 75.00
   determinateness (%) : 57.86
   - most credible action(s) = { 'a14': 23.81, 'a19': 11.90, 'a04': 2.38, 'a20': 1.19, }  
=== >> potential last choices 
* choice              : ['a03', 'a12', 'a17']
  independence        : 4.76
  dominance           : -76.19
  absorbency          : 4.76
  covering (%)        : 0.00
  determinateness (%) : 65.39
  - most credible action(s) = { 'a03': 38.10, 'a12': 13.10, 'a17': 4.76, }
Execution time: 0.024 seconds
*****************************
showGoodChoices(self, Recompute=True)
Characteristic values for potentially good choices.
showHTMLBestChoiceRecommendation(self, pageTitle=None, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True, htmlFileName=None)
showHTMLRelationHeatmap(self, actionsList=None, rankingRule='NetFlows', colorLevels=7, tableTitle='Relation Heatmap', relationName='r(x S y)', ndigits=2, fromIndex=None, toIndex=None, htmlFileName=None)
Launches a browser window with the colored relation map of self.
 
See corresponding :py:class:`~digraphs.Digraph.showHTMLRelationMap` method.
 
The *colorLevels* parameter may be set to 3, 5, 7 (default) or 9.
 
When the *actionsList* parameter is *None* (default), the digraphs actions list may be ranked with the *rankingRule* parameter set to the 'Copeland' (default) or to the 'Netlows' ranking rule.
 
When the *htmlFileName* parameter is set to a string value 'xxx', a html file named 'xxx.html' will be generated in the current working directory. Otherwise, a temporary file named 'tmp*.html' will be generated there.
 
Example::
 
    >>> from outrankingDigraphs import *
    >>> t = RandomCBPerformanceTableau(numberOfActions=25,seed=1)
    >>> g = BipolarOutrankingDigraph(t,ndigits=2)
    >>> gcd = ~(-g)  # strict outranking relation
    >>> gcd.showHTMLRelationHeatmap(colorLevels=7,ndigits=2)
    
.. image:: relationHeatmap.png
   :alt: Browser view of a relation map
   :width: 600 px
   :align: center
showHTMLRelationMap(self, actionsList=None, rankingRule='Copeland', Colored=True, tableTitle='Relation Map', relationName='r(x S y)', symbols=['+', '&middot;', '&nbsp;', '&#150;', '&#151'], fromIndex=None, toIndex=None, htmlFileName=None)
Launches a browser window with the colored relation map of self.
See corresponding Digraph.showRelationMap() method.
 
When *htmlFileName* parameter is set to a string value, a html file
with that name will be stored in the current working directory.
 
By default, a temporary file named: tmp*.html will be generated
instead in the current working directory.
 
Example::
 
    >>> from outrankingDigraphs import *
    >>> t = RandomCBPerformanceTableau(numberOfActions=25,seed=1)
    >>> g = BipolarOutrankingDigraph(t,Normalized=True)
    >>> gcd = ~(-g)  # strict outranking relation
    >>> gcd.showHTMLRelationMap(rankingRule="NetFlows")
    
.. image:: relationMap.png
   :alt: Browser view of a relation map
   :width: 600 px
   :align: center
showHTMLRelationTable(self, actionsList=None, relation=None, IntegerValues=False, ndigits=2, Colored=True, tableTitle='Valued Adjacency Matrix', relationName='r(x S y)', ReflexiveTerms=False, htmlFileName=None, fromIndex=None, toIndex=None)
Launches a browser window with the colored relation table of self.
showMIS(self, withListing=True)
Prints all maximal independent choices:
    Result in self.misset.
showMIS_AH(self, withListing=True)
Prints all MIS using the Hertz method.
 
Result saved in self.hertzmisset.
showMIS_HB2(self, withListing=True)
Prints all MIS using the Hertz-Bisdorff method.
 
Result saved in self.newmisset.
showMIS_RB(self, withListing=True)
Prints all MIS using the Bisdorff method.
 
Result saved in self.newmisset.
showMIS_UD(self, withListing=True)
Prints all MIS using the Hertz-Bisdorff method.
 
Result saved in self.newmisset.
showMaxAbsIrred(self, withListing=True)
Computing maximal -irredundant choices:
    Result in self.absirset.
showMaxDomIrred(self, withListing=True)
Computing maximal +irredundant choices:
   Result in self.domirset.
showMinAbs(self, withListing=True)
Prints minimal absorbent choices:
    Result in self.absset.
showMinDom(self, withListing=True)
Prints all minimal dominant choices:
    Result in self.domset.
showNeighborhoods(self)
Lists the gamma and the notGamma function of self.
showOrbits(self, InChoices, withListing=True)
Prints the orbits of Choices along the automorphisms of
the Digraph instance.
 
Example Python session for computing the non isomorphic MISs from the 12-cycle graph:
 
>>> from digraphs import *
>>> c12 = CirculantDigraph(order=12,circulants=[1,-1])
>>> c12.automorphismGenerators()
...
  Permutations
  {'1': '1', '2': '12', '3': '11', '4': '10', '5': 
   '9', '6': '8', '7': '7', '8': '6', '9': '5', '10': 
   '4', '11': '3', '12': '2'}
  {'1': '2', '2': '1', '3': '12', '4': '11', '5': '10', 
   '6': '9', '7': '8', '8': '7', '9': '6', '10': '5', 
   '11': '4', '12': '3'}
  Reflections {}
>>> print('grpsize = ', c12.automorphismGroupSize)
  grpsize = 24
>>> c12.showMIS(withListing=False)
  *---  Maximal independent choices ---*
  number of solutions:  29
  cardinality distribution
  card.:  [0, 1, 2, 3, 4,  5,  6, 7, 8, 9, 10, 11, 12]
  freq.:  [0, 0, 0, 0, 3, 24,  2, 0, 0, 0,  0,  0,  0]
  Results in c12.misset
>>> c12.showOrbits(c12.misset,withListing=False)
...
  *---- Global result ----
  Number of MIS:  29
  Number of orbits :  4
  Labelled representatives:
  1: ['2','4','6','8','10','12']
  2: ['2','5','8','11']
  3: ['2','4','6','9','11']
  4: ['1','4','7','9','11']
  Symmetry vector
  stabilizer size: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, ...]
  frequency      : [0, 2, 0, 0, 0, 0, 0, 1, 0,  0,  0,  1, ...]
 
*Figure*: The symmetry axes of the non isomorphic MISs of the 12-cycle:
 
.. image:: c12.png
   :width: 400 px
   :align: center
   :alt: The 4 non isomorphic MIS of the 12-cycle graph
 
*Reference*: R. Bisdorff and J.L. Marichal (2008). Counting non-isomorphic maximal independent sets of the n-cycle graph. *Journal of Integer Sequences*, Vol. 11 Article 08.5.7 (`openly accessible here <https://www.cs.uwaterloo.ca/journals/JIS/VOL11/Marichal/marichal.html>`_)
showOrbitsFromFile(self, InFile, withListing=True)
Prints the orbits of Choices along the automorphisms of
the digraph self by reading in the 0-1 misset file format.
See the :py:func:`digraphs.Digraph.readPerrinMisset` method.
showPreKernels(self, withListing=True)
Printing dominant and absorbent preKernels:
    Result in self.dompreKernels and self.abspreKernels
showRankingByBestChoosing(self, rankingByBestChoosing=None)
A show method for self.rankinByBestChoosing result.
 
.. warning::
 
     The self.computeRankingByBestChoosing(CoDual=False/True) method instantiating the self.rankingByBestChoosing slot is pre-required !
showRankingByChoosing(self, rankingByChoosing=None, WithCoverCredibility=False)
A show method for self.rankinByChoosing result.
 
When parameter *WithCoverCredibility* is set to True, the credibility of outranking, respectively being outranked is indicated at each selection step. 
 
.. warning::
 
     The self.computeRankingByChoosing(CoDual=False/True) method instantiating the self.rankingByChoosing slot is pre-required !
showRankingByLastChoosing(self, rankingByLastChoosing=None, Debug=None)
A show method for self.rankinByChoosing result.
 
.. warning::
 
     The self.computeRankingByLastChoosing(CoDual=False/True) method instantiating the self.rankingByChoosing slot is pre-required !
showRelation(self)
prints the relation valuation in ##.## format.
showRelationMap(self, symbols=None, rankingRule='Copeland', fromIndex=None, toIndex=None, actionsList=None)
Prints on the console, in text map format, the location of
certainly validated and certainly invalidated outranking situations.
 
By default, symbols = {'max':'┬','positive': '+', 'median': ' ',
                       'negative': '-', 'min': '┴'}
 
The default ordering of the output is following the Copeland ranking rule
from best to worst actions. Further available ranking rule is the 'NetFlows' net flows rule.
 
 
Example::
 
    >>> from outrankingDigraphs import *
    >>> t = RandomCBPerformanceTableau(numberOfActions=25,seed=1)
    >>> g = BipolarOutrankingDigraph(t,Normalized=True)
    >>> gcd = ~(-g)  # strict outranking relation
    >>> gcd.showRelationMap(rankingRule="NetFlows")
     -   ++++++++  +++++┬+┬┬+
    - -   + +++++ ++┬+┬+++┬++
    ┴+  ┴ + ++  ++++┬+┬┬++┬++
    -   ++ - ++++-++++++┬++┬+
       - - - ++- ┬- + -+┬+-┬┬
    -----  -      -┬┬┬-+  -┬┬
    ----    --+-+++++++++++++
    -- --+- --++ ++ +++-┬+-┬┬
    ----  -  -+-- ++--+++++ +
    ----- ++- --- +---++++┬ +
    -- -- ---+ -++-+++-+ +-++
    -- --┴---+  + +-++-+ -  +
    ---- ┴---+-- ++--++++ - +
      --┴┴--  --- -  --+ --┬┬
     ---------+--+ ----- +-┬┬
    -┴---┴- ---+- + ---+++┬ +
    -┴┴--┴---+--- ++ -++--+++
    -----┴--- ---+-+- ++---+ 
    -┴┴--------------- --++┬ 
    --┴---------------- --+┬ 
    ┴--┴┴ -┴--┴┴-┴ --++  ++-+
    ----┴┴--------------- -  
    ┴┴┴----+-┴+┴---┴-+---+ ┴+
    ┴┴-┴┴┴-┴- - -┴┴---┴┴+ ┬ -
    ----┴┴-┴-----┴┴---  - -- 
    Ranking rule: NetFlows
    >>>
showRelationTable(self, Sorted=True, rankingRule=None, IntegerValues=False, actionsSubset=None, relation=None, ndigits=2, ReflexiveTerms=True, fromIndex=None, toIndex=None)
Prints the relation valuation in actions X actions table format.
Copeland and NetFlows rankings my be used.
showRubisBestChoiceRecommendation(self, **kwargs)
Dummy for backward portable showBestChoiceRecommendation().
showRubyChoice(self, Verbose=False, Comments=True, _OldCoca=True)
Dummy for showBestChoiceRecommendation()
needed for older versions compatibility.
showShort(self)
concise presentation method for genuine digraphs.
showSingletonRanking(self, Comments=True, Debug=False)
Calls self.computeSingletonRanking(comments=True,Debug = False).
Renders and prints the sorted bipolar net determinatation of outrankingness
minus outrankedness credibilities of all singleton choices.
 
res = ((netdet,sigleton,dom,absorb)+)
showStatistics(self)
Computes digraph statistics like order, size and arc-density.
showdre(self)
Shows relation in nauty format.
singletons(self)
list of singletons and neighborhoods
[(singx1, +nx1, -nx1, not(+nx1 or -nx1)),.... ]
sizeSubGraph(self, choice)
Output: (size, undeterm,arcDensity).
Renders the arc density of the induced subgraph.
strongComponents(self, setPotential=False)
Renders the set of strong components of self.
symDegreesDistribution(self)
Renders the distribution of symmetric degrees.
topologicalSort(self, Debug=False)
If self is acyclic, adds topological sort number to each node of self
and renders ordered list of nodes. Otherwise renders None.
Source: M. Golumbic Algorithmic Graph heory and Perfect Graphs,
Annals Of Discrete Mathematics 57 2nd Ed. , Elsevier 2004, Algorithm 2.4 p.44.
weakAneighbors(self, node)
Renders the set of absorbed in-neighbors of a node.
weakCondorcetLosers(self)
Renders the set of decision actions x such that
self.relation[x][y] <= self.valuationdomain['med']
for all y != x.
weakCondorcetWinners(self)
Renders the set of decision actions x such that
self.relation[x][y] >= self.valuationdomain['med']
for all y != x.
weakDneighbors(self, node)
Renders the set of dominated out-neighbors of a node.
weakGammaSets(self)
Renders the dictionary of neighborhoods {node: (dx,ax)}
zoomValuation(self, zoomFactor=1.0)
Zooms in or out, depending on the value of the zoomFactor provided,
the bipolar valuation of a digraph.

Data descriptors inherited from Digraph:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class BrokenChordlessCircuitsDigraph(Digraph)
    BrokenChordlessCircuitsDigraph(digraph=None, Piping=False, Comments=False, Threading=False, nbrOfCPUs=1)
 
Specialization of general Digraph class for instantiation
of chordless circuits broken digraphs.
 
Parameters:
 
    - digraph: stored or memory resident digraph instance.
    - Piping: using OS pipes for data in- and output between Python and C++.
 
All chordless odd circuits are broken at the weakest asymmetric link,
i.e. a link :math:`(x, y)` with minimal difference between :math:`r(x S y)` and :math:`r(y S x)`.
 
 
Method resolution order:
BrokenChordlessCircuitsDigraph
Digraph
builtins.object

Methods defined here:
__init__(self, digraph=None, Piping=False, Comments=False, Threading=False, nbrOfCPUs=1)
Initialize self.  See help(type(self)) for accurate signature.
breakChordlessOddCircuits(self, Piping=False, Comments=True, Debug=False, Threading=False, nbrOfCPUs=1)
Breaking of chordless odd circuits extraction.
breakCircuits(self, Comments=False)
Break all cricuits in self.circuits.
showComponents(self)
Shows the list of connected components of the digraph instance.

Methods inherited from Digraph:
MISgen(self, S, I)
generator of maximal independent choices (voir Byskov 2004):
    * S ::= remaining nodes;
    * I ::= current independent choice
 
.. note::
 
        Inititalize: self.MISgen(self.actions.copy(),set())
__invert__(self)
Make the inverting operator ~self available for Digraph instances. 
 
Returns a ConverseDigraph instance of self.
__neg__(self)
Make the negation operator -self available for Digraph instances. 
 
Returns a DualDigraph instance of self.
__repr__(self)
Default presentation method for Digraph instances.
absirred(self, choice)
Renders the crips -irredundance degree of a choice.
absirredundant(self, U)
Generates all -irredundant choices of a digraph.
absirredval(self, choice, relation)
Renders the valued -irredundance degree of a choice.
absirredx(self, choice, x)
Computes the crips -irredundance degree of node x in a choice.
abskernelrestrict(self, prekernel)
Parameter: prekernel
Renders absorbent prekernel restricted relation.
absorb(self, choice)
Renders the absorbency degree of a choice.
absorbentChoices(self, S)
Generates all minimal absorbent choices of a bipolar valued digraph.
addValuationAttribute(self)
Adds the numpy valuation attribute
agglomerationDistribution(self)
Output: aggloCoeffDistribution, meanCoeff
Renders the distribution of agglomeration coefficients.
aneighbors(self, node)
Renders the set of absorbed in-neighbors of a node.
automorphismGenerators(self)
Adds automorphism group generators to the digraph instance.
 
.. note::
 
    Dependency: Uses the dreadnaut command from the nauty software package. See https://www3.cs.stonybrook.edu/~algorith/implement/nauty/implement.shtml
 
    On Ubuntu Linux:
      ...$ sudo apt-get install nauty
averageCoveringIndex(self, choice, direction='out')
Renders the average covering index of a given choice in a set of objects,
ie the average number of choice members that cover each
non selected object.
bipolarKCorrelation(self, digraph, Debug=False)
Renders the bipolar Kendall correlation between two bipolar valued
digraphs computed from the average valuation of the
XORDigraph(self,digraph) instance.
 
.. warning::
 
     Obsolete! Is replaced by the self.computeBipolarCorrelation(other) Digraph method
bipolarKDistance(self, digraph, Debug=False)
Renders the bipolar crisp Kendall distance between two bipolar valued
digraphs.
 
.. warning::
 
     Obsolete! Is replaced by the self.computeBipolarCorrelation(other, MedianCut=True) Digraph method
chordlessPaths(self, Pk, n2, Odd=False, Comments=False, Debug=False)
New procedure from Agrum study April 2009
recursive chordless path extraction starting from path
Pk = [n2, ...., n1] and ending in node n2.
Optimized with marking of visited chordless P1s.
circuitAverageCredibility(self, circ)
Renders the average linking credibility of a Chordless Circuit.
circuitCredibilities(self, circuit, Debug=False)
Renders the average linking credibilities and the minimal link of a Chordless Circuit.
circuitMaxCredibility(self, circ)
Renders the maximal linking credibility of a Chordless Circuit.
circuitMinCredibility(self, circ)
Renders the minimal linking credibility of a Chordless Circuit.
closeSymmetric(self, InSite=True)
Produces the symmetric closure of self.relation.
closeTransitive(self, Reverse=False, InSite=True, Comments=False)
Produces the transitive closure of self.relation
 
*Parameters*:
 
    - If *Reverse* == True (False default) all transitive links are dropped, otherwise all transitive links are closed with min[r(x,y),r(y,z)];
    - If *Insite* == False (True by default) the methods return a modified copy of self.relation without altering the original self.relation, otherwise self.relation is modified.
components(self)
Renders the list of connected components.
computeAllDensities(self, choice=None)
parameter: choice in self
renders six densitiy parameters:
arc density, double arc density,
single arc density, strict single arc density,
absence arc density, strict absence arc densitiy.
computeArrowRaynaudOrder(self)
Renders a linear ordering from worst to best of the actions following Arrow&Raynaud's rule.
computeArrowRaynaudRanking(self)
renders a linear ranking from best to worst of the actions following Arrow&Raynaud's rule.
computeAverageValuation(self)
Computes the bipolar average correlation between
self and the crisp complete digraph of same order
of the irreflexive and determined arcs of the digraph
computeBadChoices(self, Comments=False)
Computes characteristic values for potentially bad choices.
 
.. note::
 
     Returns a tuple with following content:
 
     [(0)-determ,(1)degirred,(2)degi,(3)degd,(4)dega,(5)str(choice),(6)absvec]
computeBadPirlotChoices(self, Comments=False)
Characteristic values for potentially bad choices
using the Pirlot's fixpoint algorithm.
computeBestChoiceRecommendation(self, Verbose=False, Comments=False, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True)
Sets self.bestChoice, self.bestChoiceData, self.worstChoice and self.worstChoiceData
with the showBestChoiceRecommendation method.
 
First and last choices data is the following:
[(0)-determ,(1)degirred,(2)degi,(3)degd,(4)dega,(5)str(choice),(6)domvec,(7)cover]
 
self.bestChoice = self.bestChoiceData[5]
self.worstChoice = self.worstChoiceData[5]
computeBipolarCorrelation(self, other, MedianCut=False, filterRelation=None, Debug=False)
obsolete: dummy replacement for Digraph.computeOrdinalCorrelation method
computeChordlessCircuits(self, Odd=False, Comments=False, Debug=False)
Renders the set of all chordless circuits detected in a digraph.
Result is stored in <self.circuitsList>
holding a possibly empty list of tuples with at position 0 the
list of adjacent actions of the circuit and at position 1
the set of actions in the stored circuit.
 
When *Odd* is True, only chordless circuits with an odd length
are collected.
computeChordlessCircuitsMP(self, Odd=False, Threading=False, nbrOfCPUs=None, startMethod=None, Comments=False, Debug=False)
Multiprocessing version of computeChordlessCircuits().
 
Renders the set of all chordless odd circuits detected in a digraph.
Result (possible empty list) stored in <self.circuitsList>
holding a possibly empty list tuples with at position 0 the
list of adjacent actions of the circuit and at position 1
the set of actions in the stored circuit.
Inspired by Dias, Castonguay, Longo, Jradi, Algorithmica (2015).
 
Returns a possibly empty list of tuples (circuit,frozenset(circuit)).
 
If Odd == True, only circuits of odd length are retained in the result.
computeCoSize(self)
Renders the number of non validated non reflexive arcs
computeConcentrationIndex(self, X, N)
Renders the Gini concentration index of the X serie.
N contains the partial frequencies.
Based on the triangle summation formula.
computeConcentrationIndexTrapez(self, X, N)
Renders the Gini concentration index of the X serie.
N contains the partial frequencies.
Based on the triangles summation formula.
computeCondorcetLosers(self)
Wrapper for condorcetLosers().
computeCondorcetWinners(self)
Wrapper for condorcetWinners().
computeCopelandOrder(self)
renders a linear ordering from worst to best of the actions following Arrow&Raynaud's rule.
computeCopelandRanking(self)
renders a linear ranking from best to worst of the actions following Arrow&Raynaud's rule.
computeCutLevelDensities(self, choice, level)
parameter: choice in self, robustness level
renders three robust densitiy parameters:
robust double arc density,
robust single arc density,
robust absence arc densitiy.
computeDensities(self, choice)
parameter: choice in self
renders the four densitiy parameters:
arc density, double arc density, single arc density, absence arc density.
computeDeterminateness(self, InPercents=False)
Computes the Kendalll distance of self
with the all median-valued indeterminate digraph of order n.
 
Return the average determination of the irreflexive part of the digraph.
 
*determination* = sum_(x,y) { abs[ r(xRy) - Med ] } / n(n-1)
 
If *InPercents* is True, returns the average determination in percentage of
(Max - Med) difference.
 
>>> from outrankingDigraphs import BipolarOutrankingDigraph
>>> from randomPerfTabs import Random3ObjectivesPerformanceTableau
>>> t = Random3ObjectivesPerformanceTableau(numberOfActions=7,numberOfCriteria=7,seed=101)
>>> g = BipolarOutrankingDigraph(t,Normalized=True)
>>> g
*------- Object instance description ------*
Instance class      : BipolarOutrankingDigraph
Instance name       : rel_random3ObjectivesPerfTab
Actions             : 7
Criteria            : 7
Size                : 27
Determinateness (%) : 65.67
Valuation domain    : [-1.00;1.00]
>>> print(g.computeDeterminateness())
0.3134920634920634920634920638
>>> print(g.computeDeterminateness(InPercents=True))
65.67460317460317460317460320
>>> g.recodeValuation(0,1)
>>> g
*------- Object instance description ------*
Instance class      : BipolarOutrankingDigraph
Instance name       : rel_random3ObjectivesPerfTab
Actions             : 7
Criteria            : 7
Size                : 27
Determinateness (%) : 65.67
Valuation domain    : [0.00;1.00]
>>> print(g.computeDeterminateness())
0.1567460317460317460317460318
>>> print(g.computeDeterminateness(InPercents=True))
65.67460317460317460317460320
computeDiameter(self, Oriented=True)
Renders the (by default oriented) diameter of the digraph instance
computeDigraphCentres(self, WeakDistances=False, Comments=False)
The centers of a digraph are the nodes with finite minimal shortes path lengths.
 
The maximal neighborhood distances are stored in *self.maximalNeighborhoodDistances*.
 
The corresponding digraph radius and diameter are stored respectively  in *self.radius* and *self.diameter*.
 
With *Comments* = True, all these results are printed out.
 
*Source*: Claude Berge, *The Theory of Graphs*, Dover (2001) pp. 119, original in French Dunod (1958)
computeDynamicProgrammingStages(self, source, sink, Debug=False)
Renders the discrete stages of the optimal substructure for
dynamic pogramming digrahs from a given source node 
to a given sink sink node.
 
Returns a list of list of action identifyers.
computeGoodChoiceVector(self, ker, Comments=False)
| Computing Characteristic values for dominant pre-kernels
| using the von Neumann dual fixoint equation
computeGoodChoices(self, Comments=False)
Computes characteristic values for potentially good choices.
 
..note::
 
     Return a tuple with following content:
 
     [(0)-determ,(1)degirred,(2)degi,(3)degd,(4)dega,(5)str(choice),(6)domvec,(7)cover]
computeGoodPirlotChoices(self, Comments=False)
Characteristic values for potentially good choices
using the Pirlot fixpoint algorithm.
computeIncomparabilityDegree(self, InPercents=False, Comments=False)
Renders the incomparability degree (Decimal), i.e. the relative number of symmetric indeterminate relations of the irreflexive part of a digraph.
computeKemenyIndex(self, otherRelation)
renders the Kemeny index of the self.relation
compared with a given crisp valued relation of a compatible
other digraph (same nodes or actions).
computeKemenyOrder(self, orderLimit=7, Debug=False)
Renders a ordering from worst to best of the actions with maximal Kemeny index.
Return a tuple: kemenyOrder (from worst to best), kemenyIndex
computeKemenyRanking(self, orderLimit=7, seed=None, sampleSize=1000, Debug=False)
Renders a ranking from best to worst of the actions with maximal Kemeny index.
 
.. note::
 
     Returns a tuple: kemenyRanking (from best to worst), kemenyIndex.
computeKernelVector(self, kernel, Initial=True, Comments=False)
| Computing Characteristic values for dominant pre-kernels
| using the von Neumann dual fixpoint equation
computeKohlerOrder(self)
Renders an ordering (worst to best) of the actions following Kohler's rule.
computeKohlerRanking(self)
Renders a ranking (best to worst) of the actions following Kohler's rule.
computeMaxHoleSize(self, Comments=False)
Renders the length of the largest chordless cycle
in the corresponding disjunctive undirected graph.
computeMeanInDegree(self)
Renders the mean indegree of self.
!!! self.size must be set previously !!!
computeMeanOutDegree(self)
Renders the mean degree of self.
!!! self.size must be set previously !!!
computeMeanSymDegree(self)
Renders the mean degree of self.
!!! self.size must be set previously !!!
computeMedianOutDegree(self)
Renders the median outdegree of self.
!!! self.size must be set previously !!!
computeMedianSymDegree(self)
Renders the median symmetric degree of self.
!!! self.size must be set previously !!!
computeMoreOrLessUnrelatedPairs(self)
Renders a list of more or less unrelated pairs.
computeNetFlowsOrder(self)
Renders an ordered list (from best to worst) of the actions
following the net flows ranking rule.
computeNetFlowsOrderDict(self)
Renders an ordered list (from worst to best) of the actions
following the net flows ranking rule.
computeNetFlowsRanking(self)
Renders an ordered list (from best to worst) of the actions
following the net flows ranking rule.
computeNetFlowsRankingDict(self)
Renders an ordered list (from best to worst) of the actions
following the net flows ranking rule.
computeODistance(self, op2, comments=False)
renders the squared normalized distance of
two digraph valuations.
 
.. note::
 
     op2 = digraphs of same order as self.
computeOrbit(self, choice, withListing=False)
renders the set of isomorph copies of a choice following
the automorphism of the digraph self
computeOrderCorrelation(self, order, Debug=False)
Renders the ordinal correlation K of a digraph instance
when compared with a given linear order (from worst to best) of its actions
 
K = sum_{x != y} [ min( max(-self.relation(x,y)),other.relation(x,y), max(self.relation(x,y),-other.relation(x,y)) ]
 
K /= sum_{x!=y} [ min(abs(self.relation(x,y),abs(other.relation(x,y)) ]
 
.. note::
 
     Renders a dictionary with the key 'correlation' containing the actual bipolar correlation index and the key 'determination' containing the minimal determination level D of self and the other relation.
 
     D = sum_{x != y} min(abs(self.relation(x,y)),abs(other.relation(x,y)) / n(n-1)
 
     where n is the number of actions considered.
 
     The correlation index with a completely indeterminate relation
     is by convention 0.0 at determination level 0.0 .
 
.. warning::
 
     self must be a normalized outranking digraph instance !
computeOrdinalCorrelation(self, other, MedianCut=False, filterRelation=None, Debug=False)
Renders the bipolar correlation K of a
self.relation when compared
with a given compatible (same actions set)) digraph or
a [-1,1] valued compatible relation (same actions set).
 
If MedianCut=True, the correlation is computed on the median polarized relations.
 
If filterRelation is not None, the correlation is computed on the partial domain corresponding to the determined part of the filter relation.
 
.. warning::
 
     Notice that the 'other' relation and/or the 'filterRelation',
     the case given, must both be normalized, ie [-1,1]-valued !
 
K = sum_{x != y} [ min( max(-self.relation[x][y]),other.relation[x][y]), max(self.relation[x][y],-other.relation[x][y]) ]
 
K /= sum_{x!=y} [ min(abs(self.relation[x][y]),abs(other.relation[x][y])) ]
 
.. note::
 
     Renders a tuple with at position 0 the actual bipolar correlation index
     and in position 1 the minimal determination level D of self and
     the other relation.
 
     D = sum_{x != y} min(abs(self.relation[x][y]),abs(other.relation[x][y])) / n(n-1)
 
     where n is the number of actions considered.
 
     The correlation index with a completely indeterminate relation
     is by convention 0.0 at determination level 0.0 .
computeOrdinalCorrelationMP(self, other, MedianCut=False, Threading=False, nbrOfCPUs=None, startMethod=None, Comments=False, Debug=False)
Multi processing version of the digraphs.computeOrdinalCorrelation() method.
 
.. note::
     The relation filtering and the MedinaCut option are not implemented in the MP version.
computePairwiseClusterComparison(self, K1, K2, Debug=False)
Computes the pairwise cluster comparison credibility vector
from bipolar-valued digraph g. with K1 and K2 disjoint
lists of action keys from g actions disctionary.
Returns the dictionary
{'I': Decimal(),'P+':Decimal(),'P-':Decimal(),'R' :Decimal()}
where one and only one item is strictly positive.
computePreKernels(self)
computing dominant and absorbent preKernels:
    Result in self.dompreKernels and self.abspreKernels
computePreRankingRelation(self, preRanking, Normalized=True, Debug=False)
Renders the bipolar-valued relation obtained from
a given preRanking in decreasing levels (list of lists) result.
computePreorderRelation(self, preorder, Normalized=True, Debug=False)
Renders the bipolar-valued relation obtained from
a given preordering in increasing levels (list of lists) result.
computePrincipalOrder(self, Colwise=False, Comments=False)
Rendesr an ordering from wrost to best of the decision actions.
computePrincipalRanking(self, Colwise=False, Comments=False)
Rendesr a ranking from best to worst of the decision actions.
computePrincipalScores(self, plotFileName=None, Colwise=False, imageType=None, tempDir=None, bgcolor='cornsilk', Comments=False, Debug=False)
Renders a ordered list of the first principal eigenvector of the covariance of the valued outdegrees of self.
 
.. note::
 
   The method, relying on writing and reading temporary files by default in a temporary directory is threading and multiprocessing safe !
   (see Digraph.exportPrincipalImage method)
computePrudentBetaLevel(self, Debug=False)
computes alpha, ie the lowest valuation level, for which the
bipolarly polarised digraph doesn't contain a chordless circuit.
computeRankingByBestChoosing(self, CoDual=False, Debug=False)
Computes a weak preordering of the self.actions by recursive
best choice elagations.
 
Stores in self.rankingByBestChoosing['result'] a list of (P+,bestChoice) tuples
where P+ gives the best choice complement outranking
average valuation via the computePairwiseClusterComparison
method.
 
If self.rankingByBestChoosing['CoDual'] is True, 
the ranking-by-choosing was computed on the codual of self.
computeRankingByBestChoosingRelation(self, rankingByBestChoosing=None, Debug=False)
Renders the bipolar-valued relation obtained from
the self.rankingByBestChoosing result.
computeRankingByChoosing(self, actionsSubset=None, Debug=False, CoDual=False)
Computes a weak preordring of the self.actions by iterating
jointly first and last choice elagations.
 
Stores in self.rankingByChoosing['result'] a list of ((P+,bestChoice),(P-,worstChoice)) pairs
where P+ (resp. P-) gives the best (resp. worst) choice complement outranking
(resp. outranked) average valuation via the computePairwiseClusterComparison
method.
 
If self.rankingByChoosing['CoDual'] is True, the ranking-by-choosing was computed on the codual of self.
computeRankingByChoosingRelation(self, rankingByChoosing=None, actionsSubset=None, Debug=False)
Renders the bipolar-valued relation obtained from
the self.rankingByChoosing result.
computeRankingByLastChoosing(self, CoDual=False, Debug=False)
Computes a weak preordring of the self.actions by iterating
worst choice elagations.
 
Stores in self.rankingByLastChoosing['result'] a list of (P-,worstChoice) pairs
where P- gives the worst choice complement outranked
average valuation via the computePairwiseClusterComparison
method.
 
If self.rankingByChoosing['CoDual'] is True, the ranking-by-last-chossing 
was computed on the codual of self.
computeRankingByLastChoosingRelation(self, rankingByLastChoosing=None, Debug=False)
Renders the bipolar-valued relation obtained from
the self.rankingByLastChoosing result.
computeRankingCorrelation(self, ranking, Debug=False)
Renders the ordinal correlation K of a digraph instance
when compared with a given linear ranking of its actions
 
K = sum_{x != y} [ min( max(-self.relation(x,y)),other.relation(x,y), max(self.relation(x,y),-other.relation(x,y)) ]
 
K /= sum_{x!=y} [ min(abs(self.relation(x,y),abs(other.relation(x,y)) ]
 
.. note::
 
     Renders a tuple with at position 0 the actual bipolar correlation index
     and in position 1 the minimal determination level D of self and
     the other relation.
 
     D = sum_{x != y} min(abs(self.relation(x,y)),abs(other.relation(x,y)) / n(n-1)
 
     where n is the number of actions considered.
 
     The correlation index with a completely indeterminate relation
     is by convention 0.0 at determination level 0.0 .
computeRelationalStructure(self, Debug=False)
Renders the counted decomposition of the valued relations into
the following type of links:
gt '>', eq '=', lt '<', incomp '<>',
leq '<=', geq '>=', indeterm '?'
computeRubisChoice(self, Comments=False, _OldCoca=False, BrokenCocs=True, Threading=False, nbrOfCPUs=1)
Renders self.strictGoodChoices, self.nullChoices
self.strictBadChoices, self.nonRobustChoices.
 
.. warning::
    Changes in site the outranking digraph by
    adding or braking chordless odd outranking circuits.
computeRubyChoice(self, Comments=False, _OldCoca=False)
dummy for computeRubisChoice()
old versions compatibility.
computeShortestPathLengths(self, WeakPaths=False, Comments=False, Debug=False)
Renders a double dictionary with the directed distances, i.e. the shortest path lengths between all self.actions
 
Equals *None* if there does not exist a directed path between two actions.
 
*Source*: Claude Berge, *The Theory of Graphs*, Dover (2001) pp. 119, original in French Dunod (1958)
computeSingletonRanking(self, Comments=False, Debug=False)
Renders the sorted bipolar net determinatation of outrankingness
minus outrankedness credibilities of all singleton choices.
 
res = ((netdet,singleton,dom,absorb)+)
computeSize(self)
Renders the number of validated non reflexive arcs
computeSizeTransitiveClosure(self)
Renders the size of the transitive closure of a digraph.
computeSlaterOrder(self, isProbabilistic=False, seed=None, sampleSize=1000, Debug=False)
Reversed return from computeSlaterRanking method.
computeSlaterRanking(self, isProbabilistic=False, seed=None, sampleSize=1000, Debug=False)
Renders a ranking of the actions with minimal Slater index.
Return a tuple: slaterOrder, slaterIndex
computeSymmetryDegree(self, InPercents=False, Comments=False)
Renders the symmetry degree (Decimal) of the irreflexive part of a digraph.
 
.. note::
 
   Empty and indeterminate digraphs are considered to be symmetric.
computeTopologicalRanking(self, Debug=False)
Mimetic Wrapper of the topologicalSort() method.
computeTransitivityDegree(self, InPercents=False, Comments=False)
Renders the transitivity degree (Decimal) of a digraph.
 
.. note:: 
 
   An empty or indeterminate digraph is considered to be transitive.
computeUnrelatedPairs(self)
Renders a list of more or less unrelated pairs.
computeValuationLevels(self, choice=None, Debug=False)
renders the symmetric closure of the
apparent valuations levels of self
in an increasingly ordered list.
If parameter choice is given, the
computation is limited to the actions
of the choice.
computeValuationPercentages(self, choice, percentiles, withValues=False)
Parameters: choice and list of percentiles.
renders a series of percentages of the characteristics valuation of
the arcs in the digraph.
computeValuationPercentiles(self, choice, percentages, withValues=False)
Parameters: choice and list of percentages.
renders a series of quantiles of the characteristics valuation of
the arcs in the digraph.
computeValuationStatistics(self, Sampling=False, Comments=False)
Renders the mean and variance of the valuation
of the non reflexive pairs.
computeValuedRankingRelation(self, ranking)
Renders the valued relation characteristics compatible 
with the given linar ranking. Discordant charcateristics 
are set to the indeterminate value.
computeWeakCondorcetLosers(self)
Wrapper for weakCondorcetLosers().
computeWeakCondorcetWinners(self)
Wrapper for weakCondorcetWinners().
computeupdown1(self, s, S)
Help method for show_MIS_HB2 method.
fills self.newmisset, self.upmis, self.downmis.
computeupdown2(self, s, S)
Help method for show_MIS_HB1 method.
Fills self.newmisset, self.upmis, self.downmis.
computeupdown2irred(self, s, S)
Help method for show_MIS_HB1 method.
Fills self.newmisset, self.upmis, self.downmis.
condorcetLosers(self)
Renders the set of decision actions x such that
self.relation[x][y] < self.valuationdomain['med']
for all y != x.
condorcetWinners(self)
Renders the set of decision actions x such that
self.relation[x][y] > self.valuationdomain['med']
for all y != x.
contra(self, v)
Parameter: choice.
Renders the negation of a choice v characteristic's vector.
convertRelationToDecimal(self)
Converts the float valued self.relation in a decimal valued one.
convertValuation2Integer(self, InSite=True, Comments=False)
Converts the self.relation valuation to integer values by converting the Decimals to Fractions and multiply by the least commun multiple of the fraction denominators.
 
*Parameters*:
 
    - If *Insite* == False (True by default) the method returns a modified copy of self.relation without altering the original self.relation, otherwise self.relation and self.valuationdomain is modified.
convertValuationToDecimal(self)
Convert the float valuation limits to Decimals.
coveringIndex(self, choice, direction='out')
Renders the covering index of a given choice in a set of objects,
ie the minimum number of choice members that cover each
non selected object.
crispKDistance(self, digraph, Debug=False)
Renders the crisp Kendall distance between two bipolar valued
digraphs.
 
.. warning::
 
     Obsolete! Is replaced by the self.computeBipolarCorrelation(other, MedianCut=True) Digraph method
detectChordlessCircuits(self, Comments=False, Debug=False)
Detects a chordless circuit in a digraph.
Returns a Boolean
detectChordlessPath(self, Pk, n2, Comments=False, Debug=False)
New procedure from Agrum study April 2009
recursive chordless path extraction starting from path
Pk = [n2, ...., n1] and ending in node n2.
Optimized with marking of visited chordless P1s.
determinateness(self, vec, inPercent=True)
Renders the determinateness of a characteristic vector *vec* = 
[(r(x),x),(r(y),y), ...] of length *n* in valuationdomain [Min,Med,Max]:
 
*result* =  sum_x( abs(r(x)-Med) ) / ( n*(Max-Med) )
 
If inPercent, *result* shifted (+1) and reduced (/2) to [0,1] range.
digraph2Graph(self, valuationDomain={'min': -1, 'med': 0, 'max': 1}, Debug=False, ConjunctiveConversion=True)
Convert a Digraph instance to a Graph instance.
dneighbors(self, node)
Renders the set of dominated out-neighbors of a node.
domin(self, choice)
Renders the dominance degree of a choice.
dominantChoices(self, S)
Generates all minimal dominant choices of a bipolar valued digraph.
 
.. note::
 
     Initiate with S = self.actions.copy().
domirred(self, choice)
Renders the crips +irredundance degree of a choice.
domirredval(self, choice, relation)
Renders the valued +irredundance degree of a choice.
domirredx(self, choice, x)
Renders the crips +irredundance degree of node x in a choice.
domkernelrestrict(self, prekernel)
Parameter: dominant prekernel
Renders dominant prekernel restricted relation.
exportGraphViz(self, fileName=None, actionsSubset=None, bestChoice=set(), worstChoice=set(), firstChoice=set(), lastChoice=set(), Comments=True, graphType='png', pictureFormat=None, graphSize='7,7', relation=None, bgcolor='cornsilk')
export GraphViz dot file  for graph drawing filtering.
exportPrincipalImage(self, plotFileName=None, pictureFormat='pdf', bgcolor='cornsilk', fontcolor='red3', fontsize='0.75', Reduced=False, Colwise=False, tempDir='.', Comments=False)
Export as PDF (default) the principal projection of
the valued relation using the three principal eigen vectors.
 
Implemeted picture formats are: 
'pdf' (default), 'png', 'jpeg' and 'xfig'.
 
The background color is set by default to 'cornsilk'. 
 
Font size and color are set by default to 'red3', resp. '0.75'. 
 
When *Reduced==True*, the valued relation characeteristics are centered and reduced.
 
When *Colwise==True*, the column vectors of the adjacency table are used for the principal projection, otherwise the rows (default) are used. Has no incidence when the *Digraph* instance *self*  is symmetric. 
 
.. warning::
 
    The method, writing and reading temporary files: 
    tempCol.r and rotationCol.csv, resp. tempRow.r and rotationRow.csv,
    by default in the working directory (./),
    is hence not safe for multiprocessing programs, unless a
    temporary directory *tempDir* is provided.
flatChoice(self, ch, Debug=False)
Converts set or list ch recursively to a flat list of items.
forcedBestSingleChoice(self)
Renders the set of most determined outranking singletons in self.
gammaSets(self)
Renders the dictionary of neighborhoods {node: (dx,ax)}
with set *dx* gathering the dominated, and set *ax* gathering
the absorbed neighborhood.
generateAbsPreKernels(self)
Generate all absorbent prekernels from independent choices generator.
generateDomPreKernels(self)
Generate all dominant prekernels from independent choices generator.
htmlChoiceVector(self, ch, ChoiceVector=True, choiceType='good')
Show procedure for annotated bipolar choices.
inDegrees(self)
renders the median cut indegrees
inDegreesDistribution(self)
Renders the distribution of indegrees.
independentChoices(self, U)
Generator for all independent choices with neighborhoods of a bipolar valued digraph:
 
.. note::
 
       * Initiate with U = self.singletons().
       * Yields [(independent choice, domnb, absnb, indnb)].
inner_prod(self, v1, v2)
Parameters: two choice characteristic vectors
Renders the inner product of two characteristic vetors.
intstab(self, choice)
Computes the independence degree of a choice.
irreflex(self, mat)
Puts diagonal entries of mat to valuationdomain['min']
isAsymmetricIndeterminate(self, Debug=False)
Checks the self.relation for assymmetric indeterminateness!!
 
.. warning::
 
    The reflexive links are ignored !!
isComplete(self, Debug=False)
checks the completeness property of self.relation by checking
for the absence of a link between two actions!!
 
.. warning::
 
    The reflexive links are ignored !!
isCyclic(self, Debug=False)
checks the cyclicity of self.relation by checking
for a reflexive loop in its transitive closure-
 
.. warning::
 
     self.relation is supposed to be irreflexive !
isIntegerValued(self, Debug=False)
Checks whether the decimal valuation of self is integer-valued
be using the as_integer_ratio() method of a Decimal 
giving a tuple (numerator,denominator). If denominator == 1, the
number is an integer.
isOutrankingDigraph(self, Comments=True, Debug=False)
Checks the outranking digraph characteristic condition (3.3).
 
relation[x][y] + relation[y][x)[y] >= 0.0
 
.. warning::
 
    The reflexive links are ignored and the valuation must be bipolar !!
isStrictOutrankingDigraph(self, Comments=True, Debug=False)
Checks the strict outranking digraph characteristic condition (3.1).
 
-(relation[x][y] + relation[y][x]) <= 0.0 , x != y
 
.. warning::
 
    The reflexive links are ignored and the valuation must be bipolar !!
isSymmetric(self, Comments=False)
True if symmetry degree == 1.0.
isTransitive(self, Comments=False)
True if transitivity degree == 1.0.
isWeaklyComplete(self, Debug=False)
checks the weakly completeness property of self.relation by checking
for the absence of a link between two actions!!
 
.. warning::
 
    The reflexive links are ignored !!
iterateRankingByChoosing(self, Odd=False, CoDual=False, Comments=True, Debug=False, Limited=None)
Renders a ranking by choosing result when progressively eliminating
all chordless (odd only) circuits with rising valuation cut levels.
 
Parameters
    CoDual = False (default)/True
    Limited = proportion (in [0,1]) * (max - med) valuationdomain
kChoices(self, A, k)
Renders all choices of length k from set A
matmult2(self, m, v)
Parameters: digraph relation and choice characteristic vector
matrix multiply vector by inner production
meanDegree(self)
Renders the mean degree of self.
!!! self.size must be set previously !!!
meanLength(self, Oriented=False)
Renders the (by default non-oriented) mean neighbourhoor depth of self.
!!! self.order must be set previously !!!
minimalChoices(self, S)
Generates all dominant or absorbent choices of a bipolar
valued digraph.
 
.. note:
 
   * Initiate with S = (actions, dict of dominant or absorbent closed neighborhoods)
   * See showMinDom and showMinAbs methods.
minimalValuationLevelForCircuitsElimination(self, Odd=True, Debug=False, Comments=False)
renders the minimal valuation level <lambda> that eliminates all
self.circuitsList stored odd chordless circuits from self.
 
.. warning::
 
    The <lambda> level polarised may still contain newly appearing chordless odd circuits !
neighbourhoodCollection(self, Oriented=False, Potential=False)
Renders the neighbourhood.
neighbourhoodDepthDistribution(self, Oriented=False)
Renders the distribtion of neighbourhood depths.
notGammaSets(self)
Renders the dictionary of neighborhoods {node: (dx,ax)}
with set *dx* gathering the not dominated, and set *ax* gathering
the not absorbed neighborhood.
notaneighbors(self, node)
Renders the set of absorbed not in-neighbors of a node.
notdneighbors(self, node)
Renders the set of not dominated out-neighbors of a node.
outDegrees(self)
renders the median cut outdegrees
outDegreesDistribution(self)
Renders the distribution of outdegrees.
plusirredundant(self, U)
Generates all +irredundant choices of a digraph.
powerset(self, U)
Generates all subsets of a set.
readPerrinMisset(self, file='curd.dat')
read method for 0-1-char-coded MISs by default from the perrinMIS.c curd.dat result file.
readabsvector(self, x, relation)
Parameter: action x
absorbent in vector.
readdomvector(self, x, relation)
Parameter: action x
dominant out vector.
recodeValuation(self, newMin=-1.0, newMax=1.0, ndigits=4, Debug=False)
Recodes the characteristic valuation domain according
to the parameters given. 
 
*ndigits* indicates the number of decimal digits of the valuation.
relationFct(self, x, y)
wrapper for self.relation dictionary access to ensure interoperability
with the sparse and big outranking digraph implementation model.
save(self, fileName='tempdigraph', option=None, DecimalValuation=True, decDigits=2)
Persistent storage of a Digraph class instance in the form of
a python source code file
saveCSV(self, fileName='tempdigraph', Normalized=False, Dual=False, Converse=False, Diagonal=False, Debug=False)
Persistent storage of a Digraph class instance in the form of
a csv file.
saveXMCDA2(self, fileName='temp', fileExt='xmcda2', Comments=True, relationName='R', relationType='binary', category='random', subcategory='valued', author='digraphs Module (RB)', reference='saved from Python', valuationType='standard', digits=2, servingD3=False)
save digraph in XMCDA 2.0 format. Deprecated now.
savedre(self, fileName='temp')
save digraph in nauty format.
sharp(self, x, y)
Paramaters: choice characteristic values.
Renders the sharpest of two characteristic values x and y.
sharpvec(self, v, w)
Paramaters: choice characteristic vectors.
Renders the sharpest of two characteristic vectors v and w.
showActions(self)
presentation methods for digraphs actions
showAll(self)
Detailed show method for genuine digraphs.
showAttributes(self)
Prints out the attributes of self.
showAutomorphismGenerators(self)
Renders the generators of the automorphism group.
showBadChoices(self, Recompute=True)
Characteristic values for potentially bad choices.
showBestChoiceRecommendation(self, Verbose=False, Comments=True, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True)
Shows the RuBis best choice recommendation.
 
.. note::
 
    Computes by default the Rubis best choice recommendation on the corresponding strict (codual) outranking digraph.
 
    By default, with BrokenCocs=True, we brake all chordless circuits at their weakest determined ( abs(r(x>y)) + abs(r(y>x)) ) link.
 
    When BrokenCocs=False we proceed like follows:
 
    In case of chordless circuits, if supporting arcs are more credible
    than the reversed negating arcs, we collapse the circuits into hyper nodes.
    Inversely,  if supporting arcs are not more credible than the reversed negating arcs,
    we brake the circuits on their weakest arc.
 
Usage example:
 
>>> from outrankingDigraphs import *
>>> t = Random3ObjectivesPerformanceTableau(seed=5)
>>> g = BipolarOutrankingDigraph(t)
>>> g.showBestChoiceRecommendation()
***********************
RuBis Best Choice Recommendation (BCR)
(in decreasing order of determinateness)   
Credibility domain:  [-100.0, 100.0]
=== >> potential first choices
* choice              : ['a04', 'a14', 'a19', 'a20']
   independence        : 1.19
   dominance           : 4.76
   absorbency          : -59.52
   covering (%)        : 75.00
   determinateness (%) : 57.86
   - most credible action(s) = { 'a14': 23.81, 'a19': 11.90, 'a04': 2.38, 'a20': 1.19, }  
=== >> potential last choices 
* choice              : ['a03', 'a12', 'a17']
  independence        : 4.76
  dominance           : -76.19
  absorbency          : 4.76
  covering (%)        : 0.00
  determinateness (%) : 65.39
  - most credible action(s) = { 'a03': 38.10, 'a12': 13.10, 'a17': 4.76, }
Execution time: 0.024 seconds
*****************************
showChoiceVector(self, ch, choiceType='good', ChoiceVector=True)
Show procedure for annotated bipolar choices.
showChordlessCircuits(self, Recompute=False)
Show method for chordless circuits observed in a Digraph instance.
 
If previous computation is required, stores the detected circuits in self.circuitsList attribute.
showCorrelation(self, corr=None, ndigits=3)
Renders the valued ordinal correlation index, the crisp Kendall tau index and their epistemic determination degree.
showFirstChoiceRecommendation(self, Verbose=False, Comments=True, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True)
Shows the RuBis first choice recommendation.
 
.. note::
 
    Computes by default the Rubis first choice recommendation on the corresponding strict (codual) outranking digraph.
 
    By default, with BrokenCocs=True, we brake all chordless circuits at their weakest determined ( abs(r(x>y)) + abs(r(y>x)) ) link.
 
    When BrokenCocs=False we proceed like follows:
 
    In case of chordless circuits, if supporting arcs are more credible
    than the reversed negating arcs, we collapse the circuits into hyper nodes.
    Inversely,  if supporting arcs are not more credible than the reversed negating arcs,
    we brake the circuits on their weakest arc.
 
Usage example:
 
>>> from outrankingDigraphs import *
>>> t = Random3ObjectivesPerformanceTableau(seed=5)
>>> g = BipolarOutrankingDigraph(t)
>>> g.showFirstChoiceRecommendation()
***********************
RuBis First Choice Recommendation (BCR)
(in decreasing order of determinateness)   
Credibility domain:  [-100.0, 100.0]
=== >> potential first choices
* choice              : ['a04', 'a14', 'a19', 'a20']
   independence        : 1.19
   dominance           : 4.76
   absorbency          : -59.52
   covering (%)        : 75.00
   determinateness (%) : 57.86
   - most credible action(s) = { 'a14': 23.81, 'a19': 11.90, 'a04': 2.38, 'a20': 1.19, }  
=== >> potential last choices 
* choice              : ['a03', 'a12', 'a17']
  independence        : 4.76
  dominance           : -76.19
  absorbency          : 4.76
  covering (%)        : 0.00
  determinateness (%) : 65.39
  - most credible action(s) = { 'a03': 38.10, 'a12': 13.10, 'a17': 4.76, }
Execution time: 0.024 seconds
*****************************
showGoodChoices(self, Recompute=True)
Characteristic values for potentially good choices.
showHTMLBestChoiceRecommendation(self, pageTitle=None, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True, htmlFileName=None)
showHTMLRelationHeatmap(self, actionsList=None, rankingRule='NetFlows', colorLevels=7, tableTitle='Relation Heatmap', relationName='r(x S y)', ndigits=2, fromIndex=None, toIndex=None, htmlFileName=None)
Launches a browser window with the colored relation map of self.
 
See corresponding :py:class:`~digraphs.Digraph.showHTMLRelationMap` method.
 
The *colorLevels* parameter may be set to 3, 5, 7 (default) or 9.
 
When the *actionsList* parameter is *None* (default), the digraphs actions list may be ranked with the *rankingRule* parameter set to the 'Copeland' (default) or to the 'Netlows' ranking rule.
 
When the *htmlFileName* parameter is set to a string value 'xxx', a html file named 'xxx.html' will be generated in the current working directory. Otherwise, a temporary file named 'tmp*.html' will be generated there.
 
Example::
 
    >>> from outrankingDigraphs import *
    >>> t = RandomCBPerformanceTableau(numberOfActions=25,seed=1)
    >>> g = BipolarOutrankingDigraph(t,ndigits=2)
    >>> gcd = ~(-g)  # strict outranking relation
    >>> gcd.showHTMLRelationHeatmap(colorLevels=7,ndigits=2)
    
.. image:: relationHeatmap.png
   :alt: Browser view of a relation map
   :width: 600 px
   :align: center
showHTMLRelationMap(self, actionsList=None, rankingRule='Copeland', Colored=True, tableTitle='Relation Map', relationName='r(x S y)', symbols=['+', '&middot;', '&nbsp;', '&#150;', '&#151'], fromIndex=None, toIndex=None, htmlFileName=None)
Launches a browser window with the colored relation map of self.
See corresponding Digraph.showRelationMap() method.
 
When *htmlFileName* parameter is set to a string value, a html file
with that name will be stored in the current working directory.
 
By default, a temporary file named: tmp*.html will be generated
instead in the current working directory.
 
Example::
 
    >>> from outrankingDigraphs import *
    >>> t = RandomCBPerformanceTableau(numberOfActions=25,seed=1)
    >>> g = BipolarOutrankingDigraph(t,Normalized=True)
    >>> gcd = ~(-g)  # strict outranking relation
    >>> gcd.showHTMLRelationMap(rankingRule="NetFlows")
    
.. image:: relationMap.png
   :alt: Browser view of a relation map
   :width: 600 px
   :align: center
showHTMLRelationTable(self, actionsList=None, relation=None, IntegerValues=False, ndigits=2, Colored=True, tableTitle='Valued Adjacency Matrix', relationName='r(x S y)', ReflexiveTerms=False, htmlFileName=None, fromIndex=None, toIndex=None)
Launches a browser window with the colored relation table of self.
showMIS(self, withListing=True)
Prints all maximal independent choices:
    Result in self.misset.
showMIS_AH(self, withListing=True)
Prints all MIS using the Hertz method.
 
Result saved in self.hertzmisset.
showMIS_HB2(self, withListing=True)
Prints all MIS using the Hertz-Bisdorff method.
 
Result saved in self.newmisset.
showMIS_RB(self, withListing=True)
Prints all MIS using the Bisdorff method.
 
Result saved in self.newmisset.
showMIS_UD(self, withListing=True)
Prints all MIS using the Hertz-Bisdorff method.
 
Result saved in self.newmisset.
showMaxAbsIrred(self, withListing=True)
Computing maximal -irredundant choices:
    Result in self.absirset.
showMaxDomIrred(self, withListing=True)
Computing maximal +irredundant choices:
   Result in self.domirset.
showMinAbs(self, withListing=True)
Prints minimal absorbent choices:
    Result in self.absset.
showMinDom(self, withListing=True)
Prints all minimal dominant choices:
    Result in self.domset.
showNeighborhoods(self)
Lists the gamma and the notGamma function of self.
showOrbits(self, InChoices, withListing=True)
Prints the orbits of Choices along the automorphisms of
the Digraph instance.
 
Example Python session for computing the non isomorphic MISs from the 12-cycle graph:
 
>>> from digraphs import *
>>> c12 = CirculantDigraph(order=12,circulants=[1,-1])
>>> c12.automorphismGenerators()
...
  Permutations
  {'1': '1', '2': '12', '3': '11', '4': '10', '5': 
   '9', '6': '8', '7': '7', '8': '6', '9': '5', '10': 
   '4', '11': '3', '12': '2'}
  {'1': '2', '2': '1', '3': '12', '4': '11', '5': '10', 
   '6': '9', '7': '8', '8': '7', '9': '6', '10': '5', 
   '11': '4', '12': '3'}
  Reflections {}
>>> print('grpsize = ', c12.automorphismGroupSize)
  grpsize = 24
>>> c12.showMIS(withListing=False)
  *---  Maximal independent choices ---*
  number of solutions:  29
  cardinality distribution
  card.:  [0, 1, 2, 3, 4,  5,  6, 7, 8, 9, 10, 11, 12]
  freq.:  [0, 0, 0, 0, 3, 24,  2, 0, 0, 0,  0,  0,  0]
  Results in c12.misset
>>> c12.showOrbits(c12.misset,withListing=False)
...
  *---- Global result ----
  Number of MIS:  29
  Number of orbits :  4
  Labelled representatives:
  1: ['2','4','6','8','10','12']
  2: ['2','5','8','11']
  3: ['2','4','6','9','11']
  4: ['1','4','7','9','11']
  Symmetry vector
  stabilizer size: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, ...]
  frequency      : [0, 2, 0, 0, 0, 0, 0, 1, 0,  0,  0,  1, ...]
 
*Figure*: The symmetry axes of the non isomorphic MISs of the 12-cycle:
 
.. image:: c12.png
   :width: 400 px
   :align: center
   :alt: The 4 non isomorphic MIS of the 12-cycle graph
 
*Reference*: R. Bisdorff and J.L. Marichal (2008). Counting non-isomorphic maximal independent sets of the n-cycle graph. *Journal of Integer Sequences*, Vol. 11 Article 08.5.7 (`openly accessible here <https://www.cs.uwaterloo.ca/journals/JIS/VOL11/Marichal/marichal.html>`_)
showOrbitsFromFile(self, InFile, withListing=True)
Prints the orbits of Choices along the automorphisms of
the digraph self by reading in the 0-1 misset file format.
See the :py:func:`digraphs.Digraph.readPerrinMisset` method.
showPreKernels(self, withListing=True)
Printing dominant and absorbent preKernels:
    Result in self.dompreKernels and self.abspreKernels
showRankingByBestChoosing(self, rankingByBestChoosing=None)
A show method for self.rankinByBestChoosing result.
 
.. warning::
 
     The self.computeRankingByBestChoosing(CoDual=False/True) method instantiating the self.rankingByBestChoosing slot is pre-required !
showRankingByChoosing(self, rankingByChoosing=None, WithCoverCredibility=False)
A show method for self.rankinByChoosing result.
 
When parameter *WithCoverCredibility* is set to True, the credibility of outranking, respectively being outranked is indicated at each selection step. 
 
.. warning::
 
     The self.computeRankingByChoosing(CoDual=False/True) method instantiating the self.rankingByChoosing slot is pre-required !
showRankingByLastChoosing(self, rankingByLastChoosing=None, Debug=None)
A show method for self.rankinByChoosing result.
 
.. warning::
 
     The self.computeRankingByLastChoosing(CoDual=False/True) method instantiating the self.rankingByChoosing slot is pre-required !
showRelation(self)
prints the relation valuation in ##.## format.
showRelationMap(self, symbols=None, rankingRule='Copeland', fromIndex=None, toIndex=None, actionsList=None)
Prints on the console, in text map format, the location of
certainly validated and certainly invalidated outranking situations.
 
By default, symbols = {'max':'┬','positive': '+', 'median': ' ',
                       'negative': '-', 'min': '┴'}
 
The default ordering of the output is following the Copeland ranking rule
from best to worst actions. Further available ranking rule is the 'NetFlows' net flows rule.
 
 
Example::
 
    >>> from outrankingDigraphs import *
    >>> t = RandomCBPerformanceTableau(numberOfActions=25,seed=1)
    >>> g = BipolarOutrankingDigraph(t,Normalized=True)
    >>> gcd = ~(-g)  # strict outranking relation
    >>> gcd.showRelationMap(rankingRule="NetFlows")
     -   ++++++++  +++++┬+┬┬+
    - -   + +++++ ++┬+┬+++┬++
    ┴+  ┴ + ++  ++++┬+┬┬++┬++
    -   ++ - ++++-++++++┬++┬+
       - - - ++- ┬- + -+┬+-┬┬
    -----  -      -┬┬┬-+  -┬┬
    ----    --+-+++++++++++++
    -- --+- --++ ++ +++-┬+-┬┬
    ----  -  -+-- ++--+++++ +
    ----- ++- --- +---++++┬ +
    -- -- ---+ -++-+++-+ +-++
    -- --┴---+  + +-++-+ -  +
    ---- ┴---+-- ++--++++ - +
      --┴┴--  --- -  --+ --┬┬
     ---------+--+ ----- +-┬┬
    -┴---┴- ---+- + ---+++┬ +
    -┴┴--┴---+--- ++ -++--+++
    -----┴--- ---+-+- ++---+ 
    -┴┴--------------- --++┬ 
    --┴---------------- --+┬ 
    ┴--┴┴ -┴--┴┴-┴ --++  ++-+
    ----┴┴--------------- -  
    ┴┴┴----+-┴+┴---┴-+---+ ┴+
    ┴┴-┴┴┴-┴- - -┴┴---┴┴+ ┬ -
    ----┴┴-┴-----┴┴---  - -- 
    Ranking rule: NetFlows
    >>>
showRelationTable(self, Sorted=True, rankingRule=None, IntegerValues=False, actionsSubset=None, relation=None, ndigits=2, ReflexiveTerms=True, fromIndex=None, toIndex=None)
Prints the relation valuation in actions X actions table format.
Copeland and NetFlows rankings my be used.
showRubisBestChoiceRecommendation(self, **kwargs)
Dummy for backward portable showBestChoiceRecommendation().
showRubyChoice(self, Verbose=False, Comments=True, _OldCoca=True)
Dummy for showBestChoiceRecommendation()
needed for older versions compatibility.
showShort(self)
concise presentation method for genuine digraphs.
showSingletonRanking(self, Comments=True, Debug=False)
Calls self.computeSingletonRanking(comments=True,Debug = False).
Renders and prints the sorted bipolar net determinatation of outrankingness
minus outrankedness credibilities of all singleton choices.
 
res = ((netdet,sigleton,dom,absorb)+)
showStatistics(self)
Computes digraph statistics like order, size and arc-density.
showdre(self)
Shows relation in nauty format.
singletons(self)
list of singletons and neighborhoods
[(singx1, +nx1, -nx1, not(+nx1 or -nx1)),.... ]
sizeSubGraph(self, choice)
Output: (size, undeterm,arcDensity).
Renders the arc density of the induced subgraph.
strongComponents(self, setPotential=False)
Renders the set of strong components of self.
symDegreesDistribution(self)
Renders the distribution of symmetric degrees.
topologicalSort(self, Debug=False)
If self is acyclic, adds topological sort number to each node of self
and renders ordered list of nodes. Otherwise renders None.
Source: M. Golumbic Algorithmic Graph heory and Perfect Graphs,
Annals Of Discrete Mathematics 57 2nd Ed. , Elsevier 2004, Algorithm 2.4 p.44.
weakAneighbors(self, node)
Renders the set of absorbed in-neighbors of a node.
weakCondorcetLosers(self)
Renders the set of decision actions x such that
self.relation[x][y] <= self.valuationdomain['med']
for all y != x.
weakCondorcetWinners(self)
Renders the set of decision actions x such that
self.relation[x][y] >= self.valuationdomain['med']
for all y != x.
weakDneighbors(self, node)
Renders the set of dominated out-neighbors of a node.
weakGammaSets(self)
Renders the dictionary of neighborhoods {node: (dx,ax)}
zoomValuation(self, zoomFactor=1.0)
Zooms in or out, depending on the value of the zoomFactor provided,
the bipolar valuation of a digraph.

Data descriptors inherited from Digraph:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class BrokenCocsDigraph(Digraph)
    BrokenCocsDigraph(digraph=None, Piping=False, Comments=False, Threading=False, nbrOfCPUs=1)
 
Specialization of general Digraph class for instantiation
of chordless odd circuits broken digraphs.
 
Parameters:
 
    - digraph: stored or memory resident digraph instance.
    - Piping: using OS pipes for data in- and output between Python and C++.
 
All chordless odd circuits are broken at the weakest asymmetric link,
i.e. a link :math:`(x, y)` with minimal difference between :math:`r(x S y)` and :math:`r(y S x)`.
 
 
Method resolution order:
BrokenCocsDigraph
Digraph
builtins.object

Methods defined here:
__init__(self, digraph=None, Piping=False, Comments=False, Threading=False, nbrOfCPUs=1)
Initialize self.  See help(type(self)) for accurate signature.
breakChordlessOddCircuits(self, Piping=False, Comments=True, Debug=False, Threading=False, nbrOfCPUs=1)
Breaking of chordless odd circuits extraction.
breakCircuits(self, Comments=False)
Break all cricuits in self.circuits.
showComponents(self)
Shows the list of connected components of the digraph instance.

Methods inherited from Digraph:
MISgen(self, S, I)
generator of maximal independent choices (voir Byskov 2004):
    * S ::= remaining nodes;
    * I ::= current independent choice
 
.. note::
 
        Inititalize: self.MISgen(self.actions.copy(),set())
__invert__(self)
Make the inverting operator ~self available for Digraph instances. 
 
Returns a ConverseDigraph instance of self.
__neg__(self)
Make the negation operator -self available for Digraph instances. 
 
Returns a DualDigraph instance of self.
__repr__(self)
Default presentation method for Digraph instances.
absirred(self, choice)
Renders the crips -irredundance degree of a choice.
absirredundant(self, U)
Generates all -irredundant choices of a digraph.
absirredval(self, choice, relation)
Renders the valued -irredundance degree of a choice.
absirredx(self, choice, x)
Computes the crips -irredundance degree of node x in a choice.
abskernelrestrict(self, prekernel)
Parameter: prekernel
Renders absorbent prekernel restricted relation.
absorb(self, choice)
Renders the absorbency degree of a choice.
absorbentChoices(self, S)
Generates all minimal absorbent choices of a bipolar valued digraph.
addValuationAttribute(self)
Adds the numpy valuation attribute
agglomerationDistribution(self)
Output: aggloCoeffDistribution, meanCoeff
Renders the distribution of agglomeration coefficients.
aneighbors(self, node)
Renders the set of absorbed in-neighbors of a node.
automorphismGenerators(self)
Adds automorphism group generators to the digraph instance.
 
.. note::
 
    Dependency: Uses the dreadnaut command from the nauty software package. See https://www3.cs.stonybrook.edu/~algorith/implement/nauty/implement.shtml
 
    On Ubuntu Linux:
      ...$ sudo apt-get install nauty
averageCoveringIndex(self, choice, direction='out')
Renders the average covering index of a given choice in a set of objects,
ie the average number of choice members that cover each
non selected object.
bipolarKCorrelation(self, digraph, Debug=False)
Renders the bipolar Kendall correlation between two bipolar valued
digraphs computed from the average valuation of the
XORDigraph(self,digraph) instance.
 
.. warning::
 
     Obsolete! Is replaced by the self.computeBipolarCorrelation(other) Digraph method
bipolarKDistance(self, digraph, Debug=False)
Renders the bipolar crisp Kendall distance between two bipolar valued
digraphs.
 
.. warning::
 
     Obsolete! Is replaced by the self.computeBipolarCorrelation(other, MedianCut=True) Digraph method
chordlessPaths(self, Pk, n2, Odd=False, Comments=False, Debug=False)
New procedure from Agrum study April 2009
recursive chordless path extraction starting from path
Pk = [n2, ...., n1] and ending in node n2.
Optimized with marking of visited chordless P1s.
circuitAverageCredibility(self, circ)
Renders the average linking credibility of a Chordless Circuit.
circuitCredibilities(self, circuit, Debug=False)
Renders the average linking credibilities and the minimal link of a Chordless Circuit.
circuitMaxCredibility(self, circ)
Renders the maximal linking credibility of a Chordless Circuit.
circuitMinCredibility(self, circ)
Renders the minimal linking credibility of a Chordless Circuit.
closeSymmetric(self, InSite=True)
Produces the symmetric closure of self.relation.
closeTransitive(self, Reverse=False, InSite=True, Comments=False)
Produces the transitive closure of self.relation
 
*Parameters*:
 
    - If *Reverse* == True (False default) all transitive links are dropped, otherwise all transitive links are closed with min[r(x,y),r(y,z)];
    - If *Insite* == False (True by default) the methods return a modified copy of self.relation without altering the original self.relation, otherwise self.relation is modified.
components(self)
Renders the list of connected components.
computeAllDensities(self, choice=None)
parameter: choice in self
renders six densitiy parameters:
arc density, double arc density,
single arc density, strict single arc density,
absence arc density, strict absence arc densitiy.
computeArrowRaynaudOrder(self)
Renders a linear ordering from worst to best of the actions following Arrow&Raynaud's rule.
computeArrowRaynaudRanking(self)
renders a linear ranking from best to worst of the actions following Arrow&Raynaud's rule.
computeAverageValuation(self)
Computes the bipolar average correlation between
self and the crisp complete digraph of same order
of the irreflexive and determined arcs of the digraph
computeBadChoices(self, Comments=False)
Computes characteristic values for potentially bad choices.
 
.. note::
 
     Returns a tuple with following content:
 
     [(0)-determ,(1)degirred,(2)degi,(3)degd,(4)dega,(5)str(choice),(6)absvec]
computeBadPirlotChoices(self, Comments=False)
Characteristic values for potentially bad choices
using the Pirlot's fixpoint algorithm.
computeBestChoiceRecommendation(self, Verbose=False, Comments=False, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True)
Sets self.bestChoice, self.bestChoiceData, self.worstChoice and self.worstChoiceData
with the showBestChoiceRecommendation method.
 
First and last choices data is the following:
[(0)-determ,(1)degirred,(2)degi,(3)degd,(4)dega,(5)str(choice),(6)domvec,(7)cover]
 
self.bestChoice = self.bestChoiceData[5]
self.worstChoice = self.worstChoiceData[5]
computeBipolarCorrelation(self, other, MedianCut=False, filterRelation=None, Debug=False)
obsolete: dummy replacement for Digraph.computeOrdinalCorrelation method
computeChordlessCircuits(self, Odd=False, Comments=False, Debug=False)
Renders the set of all chordless circuits detected in a digraph.
Result is stored in <self.circuitsList>
holding a possibly empty list of tuples with at position 0 the
list of adjacent actions of the circuit and at position 1
the set of actions in the stored circuit.
 
When *Odd* is True, only chordless circuits with an odd length
are collected.
computeChordlessCircuitsMP(self, Odd=False, Threading=False, nbrOfCPUs=None, startMethod=None, Comments=False, Debug=False)
Multiprocessing version of computeChordlessCircuits().
 
Renders the set of all chordless odd circuits detected in a digraph.
Result (possible empty list) stored in <self.circuitsList>
holding a possibly empty list tuples with at position 0 the
list of adjacent actions of the circuit and at position 1
the set of actions in the stored circuit.
Inspired by Dias, Castonguay, Longo, Jradi, Algorithmica (2015).
 
Returns a possibly empty list of tuples (circuit,frozenset(circuit)).
 
If Odd == True, only circuits of odd length are retained in the result.
computeCoSize(self)
Renders the number of non validated non reflexive arcs
computeConcentrationIndex(self, X, N)
Renders the Gini concentration index of the X serie.
N contains the partial frequencies.
Based on the triangle summation formula.
computeConcentrationIndexTrapez(self, X, N)
Renders the Gini concentration index of the X serie.
N contains the partial frequencies.
Based on the triangles summation formula.
computeCondorcetLosers(self)
Wrapper for condorcetLosers().
computeCondorcetWinners(self)
Wrapper for condorcetWinners().
computeCopelandOrder(self)
renders a linear ordering from worst to best of the actions following Arrow&Raynaud's rule.
computeCopelandRanking(self)
renders a linear ranking from best to worst of the actions following Arrow&Raynaud's rule.
computeCutLevelDensities(self, choice, level)
parameter: choice in self, robustness level
renders three robust densitiy parameters:
robust double arc density,
robust single arc density,
robust absence arc densitiy.
computeDensities(self, choice)
parameter: choice in self
renders the four densitiy parameters:
arc density, double arc density, single arc density, absence arc density.
computeDeterminateness(self, InPercents=False)
Computes the Kendalll distance of self
with the all median-valued indeterminate digraph of order n.
 
Return the average determination of the irreflexive part of the digraph.
 
*determination* = sum_(x,y) { abs[ r(xRy) - Med ] } / n(n-1)
 
If *InPercents* is True, returns the average determination in percentage of
(Max - Med) difference.
 
>>> from outrankingDigraphs import BipolarOutrankingDigraph
>>> from randomPerfTabs import Random3ObjectivesPerformanceTableau
>>> t = Random3ObjectivesPerformanceTableau(numberOfActions=7,numberOfCriteria=7,seed=101)
>>> g = BipolarOutrankingDigraph(t,Normalized=True)
>>> g
*------- Object instance description ------*
Instance class      : BipolarOutrankingDigraph
Instance name       : rel_random3ObjectivesPerfTab
Actions             : 7
Criteria            : 7
Size                : 27
Determinateness (%) : 65.67
Valuation domain    : [-1.00;1.00]
>>> print(g.computeDeterminateness())
0.3134920634920634920634920638
>>> print(g.computeDeterminateness(InPercents=True))
65.67460317460317460317460320
>>> g.recodeValuation(0,1)
>>> g
*------- Object instance description ------*
Instance class      : BipolarOutrankingDigraph
Instance name       : rel_random3ObjectivesPerfTab
Actions             : 7
Criteria            : 7
Size                : 27
Determinateness (%) : 65.67
Valuation domain    : [0.00;1.00]
>>> print(g.computeDeterminateness())
0.1567460317460317460317460318
>>> print(g.computeDeterminateness(InPercents=True))
65.67460317460317460317460320
computeDiameter(self, Oriented=True)
Renders the (by default oriented) diameter of the digraph instance
computeDigraphCentres(self, WeakDistances=False, Comments=False)
The centers of a digraph are the nodes with finite minimal shortes path lengths.
 
The maximal neighborhood distances are stored in *self.maximalNeighborhoodDistances*.
 
The corresponding digraph radius and diameter are stored respectively  in *self.radius* and *self.diameter*.
 
With *Comments* = True, all these results are printed out.
 
*Source*: Claude Berge, *The Theory of Graphs*, Dover (2001) pp. 119, original in French Dunod (1958)
computeDynamicProgrammingStages(self, source, sink, Debug=False)
Renders the discrete stages of the optimal substructure for
dynamic pogramming digrahs from a given source node 
to a given sink sink node.
 
Returns a list of list of action identifyers.
computeGoodChoiceVector(self, ker, Comments=False)
| Computing Characteristic values for dominant pre-kernels
| using the von Neumann dual fixoint equation
computeGoodChoices(self, Comments=False)
Computes characteristic values for potentially good choices.
 
..note::
 
     Return a tuple with following content:
 
     [(0)-determ,(1)degirred,(2)degi,(3)degd,(4)dega,(5)str(choice),(6)domvec,(7)cover]
computeGoodPirlotChoices(self, Comments=False)
Characteristic values for potentially good choices
using the Pirlot fixpoint algorithm.
computeIncomparabilityDegree(self, InPercents=False, Comments=False)
Renders the incomparability degree (Decimal), i.e. the relative number of symmetric indeterminate relations of the irreflexive part of a digraph.
computeKemenyIndex(self, otherRelation)
renders the Kemeny index of the self.relation
compared with a given crisp valued relation of a compatible
other digraph (same nodes or actions).
computeKemenyOrder(self, orderLimit=7, Debug=False)
Renders a ordering from worst to best of the actions with maximal Kemeny index.
Return a tuple: kemenyOrder (from worst to best), kemenyIndex
computeKemenyRanking(self, orderLimit=7, seed=None, sampleSize=1000, Debug=False)
Renders a ranking from best to worst of the actions with maximal Kemeny index.
 
.. note::
 
     Returns a tuple: kemenyRanking (from best to worst), kemenyIndex.
computeKernelVector(self, kernel, Initial=True, Comments=False)
| Computing Characteristic values for dominant pre-kernels
| using the von Neumann dual fixpoint equation
computeKohlerOrder(self)
Renders an ordering (worst to best) of the actions following Kohler's rule.
computeKohlerRanking(self)
Renders a ranking (best to worst) of the actions following Kohler's rule.
computeMaxHoleSize(self, Comments=False)
Renders the length of the largest chordless cycle
in the corresponding disjunctive undirected graph.
computeMeanInDegree(self)
Renders the mean indegree of self.
!!! self.size must be set previously !!!
computeMeanOutDegree(self)
Renders the mean degree of self.
!!! self.size must be set previously !!!
computeMeanSymDegree(self)
Renders the mean degree of self.
!!! self.size must be set previously !!!
computeMedianOutDegree(self)
Renders the median outdegree of self.
!!! self.size must be set previously !!!
computeMedianSymDegree(self)
Renders the median symmetric degree of self.
!!! self.size must be set previously !!!
computeMoreOrLessUnrelatedPairs(self)
Renders a list of more or less unrelated pairs.
computeNetFlowsOrder(self)
Renders an ordered list (from best to worst) of the actions
following the net flows ranking rule.
computeNetFlowsOrderDict(self)
Renders an ordered list (from worst to best) of the actions
following the net flows ranking rule.
computeNetFlowsRanking(self)
Renders an ordered list (from best to worst) of the actions
following the net flows ranking rule.
computeNetFlowsRankingDict(self)
Renders an ordered list (from best to worst) of the actions
following the net flows ranking rule.
computeODistance(self, op2, comments=False)
renders the squared normalized distance of
two digraph valuations.
 
.. note::
 
     op2 = digraphs of same order as self.
computeOrbit(self, choice, withListing=False)
renders the set of isomorph copies of a choice following
the automorphism of the digraph self
computeOrderCorrelation(self, order, Debug=False)
Renders the ordinal correlation K of a digraph instance
when compared with a given linear order (from worst to best) of its actions
 
K = sum_{x != y} [ min( max(-self.relation(x,y)),other.relation(x,y), max(self.relation(x,y),-other.relation(x,y)) ]
 
K /= sum_{x!=y} [ min(abs(self.relation(x,y),abs(other.relation(x,y)) ]
 
.. note::
 
     Renders a dictionary with the key 'correlation' containing the actual bipolar correlation index and the key 'determination' containing the minimal determination level D of self and the other relation.
 
     D = sum_{x != y} min(abs(self.relation(x,y)),abs(other.relation(x,y)) / n(n-1)
 
     where n is the number of actions considered.
 
     The correlation index with a completely indeterminate relation
     is by convention 0.0 at determination level 0.0 .
 
.. warning::
 
     self must be a normalized outranking digraph instance !
computeOrdinalCorrelation(self, other, MedianCut=False, filterRelation=None, Debug=False)
Renders the bipolar correlation K of a
self.relation when compared
with a given compatible (same actions set)) digraph or
a [-1,1] valued compatible relation (same actions set).
 
If MedianCut=True, the correlation is computed on the median polarized relations.
 
If filterRelation is not None, the correlation is computed on the partial domain corresponding to the determined part of the filter relation.
 
.. warning::
 
     Notice that the 'other' relation and/or the 'filterRelation',
     the case given, must both be normalized, ie [-1,1]-valued !
 
K = sum_{x != y} [ min( max(-self.relation[x][y]),other.relation[x][y]), max(self.relation[x][y],-other.relation[x][y]) ]
 
K /= sum_{x!=y} [ min(abs(self.relation[x][y]),abs(other.relation[x][y])) ]
 
.. note::
 
     Renders a tuple with at position 0 the actual bipolar correlation index
     and in position 1 the minimal determination level D of self and
     the other relation.
 
     D = sum_{x != y} min(abs(self.relation[x][y]),abs(other.relation[x][y])) / n(n-1)
 
     where n is the number of actions considered.
 
     The correlation index with a completely indeterminate relation
     is by convention 0.0 at determination level 0.0 .
computeOrdinalCorrelationMP(self, other, MedianCut=False, Threading=False, nbrOfCPUs=None, startMethod=None, Comments=False, Debug=False)
Multi processing version of the digraphs.computeOrdinalCorrelation() method.
 
.. note::
     The relation filtering and the MedinaCut option are not implemented in the MP version.
computePairwiseClusterComparison(self, K1, K2, Debug=False)
Computes the pairwise cluster comparison credibility vector
from bipolar-valued digraph g. with K1 and K2 disjoint
lists of action keys from g actions disctionary.
Returns the dictionary
{'I': Decimal(),'P+':Decimal(),'P-':Decimal(),'R' :Decimal()}
where one and only one item is strictly positive.
computePreKernels(self)
computing dominant and absorbent preKernels:
    Result in self.dompreKernels and self.abspreKernels
computePreRankingRelation(self, preRanking, Normalized=True, Debug=False)
Renders the bipolar-valued relation obtained from
a given preRanking in decreasing levels (list of lists) result.
computePreorderRelation(self, preorder, Normalized=True, Debug=False)
Renders the bipolar-valued relation obtained from
a given preordering in increasing levels (list of lists) result.
computePrincipalOrder(self, Colwise=False, Comments=False)
Rendesr an ordering from wrost to best of the decision actions.
computePrincipalRanking(self, Colwise=False, Comments=False)
Rendesr a ranking from best to worst of the decision actions.
computePrincipalScores(self, plotFileName=None, Colwise=False, imageType=None, tempDir=None, bgcolor='cornsilk', Comments=False, Debug=False)
Renders a ordered list of the first principal eigenvector of the covariance of the valued outdegrees of self.
 
.. note::
 
   The method, relying on writing and reading temporary files by default in a temporary directory is threading and multiprocessing safe !
   (see Digraph.exportPrincipalImage method)
computePrudentBetaLevel(self, Debug=False)
computes alpha, ie the lowest valuation level, for which the
bipolarly polarised digraph doesn't contain a chordless circuit.
computeRankingByBestChoosing(self, CoDual=False, Debug=False)
Computes a weak preordering of the self.actions by recursive
best choice elagations.
 
Stores in self.rankingByBestChoosing['result'] a list of (P+,bestChoice) tuples
where P+ gives the best choice complement outranking
average valuation via the computePairwiseClusterComparison
method.
 
If self.rankingByBestChoosing['CoDual'] is True, 
the ranking-by-choosing was computed on the codual of self.
computeRankingByBestChoosingRelation(self, rankingByBestChoosing=None, Debug=False)
Renders the bipolar-valued relation obtained from
the self.rankingByBestChoosing result.
computeRankingByChoosing(self, actionsSubset=None, Debug=False, CoDual=False)
Computes a weak preordring of the self.actions by iterating
jointly first and last choice elagations.
 
Stores in self.rankingByChoosing['result'] a list of ((P+,bestChoice),(P-,worstChoice)) pairs
where P+ (resp. P-) gives the best (resp. worst) choice complement outranking
(resp. outranked) average valuation via the computePairwiseClusterComparison
method.
 
If self.rankingByChoosing['CoDual'] is True, the ranking-by-choosing was computed on the codual of self.
computeRankingByChoosingRelation(self, rankingByChoosing=None, actionsSubset=None, Debug=False)
Renders the bipolar-valued relation obtained from
the self.rankingByChoosing result.
computeRankingByLastChoosing(self, CoDual=False, Debug=False)
Computes a weak preordring of the self.actions by iterating
worst choice elagations.
 
Stores in self.rankingByLastChoosing['result'] a list of (P-,worstChoice) pairs
where P- gives the worst choice complement outranked
average valuation via the computePairwiseClusterComparison
method.
 
If self.rankingByChoosing['CoDual'] is True, the ranking-by-last-chossing 
was computed on the codual of self.
computeRankingByLastChoosingRelation(self, rankingByLastChoosing=None, Debug=False)
Renders the bipolar-valued relation obtained from
the self.rankingByLastChoosing result.
computeRankingCorrelation(self, ranking, Debug=False)
Renders the ordinal correlation K of a digraph instance
when compared with a given linear ranking of its actions
 
K = sum_{x != y} [ min( max(-self.relation(x,y)),other.relation(x,y), max(self.relation(x,y),-other.relation(x,y)) ]
 
K /= sum_{x!=y} [ min(abs(self.relation(x,y),abs(other.relation(x,y)) ]
 
.. note::
 
     Renders a tuple with at position 0 the actual bipolar correlation index
     and in position 1 the minimal determination level D of self and
     the other relation.
 
     D = sum_{x != y} min(abs(self.relation(x,y)),abs(other.relation(x,y)) / n(n-1)
 
     where n is the number of actions considered.
 
     The correlation index with a completely indeterminate relation
     is by convention 0.0 at determination level 0.0 .
computeRelationalStructure(self, Debug=False)
Renders the counted decomposition of the valued relations into
the following type of links:
gt '>', eq '=', lt '<', incomp '<>',
leq '<=', geq '>=', indeterm '?'
computeRubisChoice(self, Comments=False, _OldCoca=False, BrokenCocs=True, Threading=False, nbrOfCPUs=1)
Renders self.strictGoodChoices, self.nullChoices
self.strictBadChoices, self.nonRobustChoices.
 
.. warning::
    Changes in site the outranking digraph by
    adding or braking chordless odd outranking circuits.
computeRubyChoice(self, Comments=False, _OldCoca=False)
dummy for computeRubisChoice()
old versions compatibility.
computeShortestPathLengths(self, WeakPaths=False, Comments=False, Debug=False)
Renders a double dictionary with the directed distances, i.e. the shortest path lengths between all self.actions
 
Equals *None* if there does not exist a directed path between two actions.
 
*Source*: Claude Berge, *The Theory of Graphs*, Dover (2001) pp. 119, original in French Dunod (1958)
computeSingletonRanking(self, Comments=False, Debug=False)
Renders the sorted bipolar net determinatation of outrankingness
minus outrankedness credibilities of all singleton choices.
 
res = ((netdet,singleton,dom,absorb)+)
computeSize(self)
Renders the number of validated non reflexive arcs
computeSizeTransitiveClosure(self)
Renders the size of the transitive closure of a digraph.
computeSlaterOrder(self, isProbabilistic=False, seed=None, sampleSize=1000, Debug=False)
Reversed return from computeSlaterRanking method.
computeSlaterRanking(self, isProbabilistic=False, seed=None, sampleSize=1000, Debug=False)
Renders a ranking of the actions with minimal Slater index.
Return a tuple: slaterOrder, slaterIndex
computeSymmetryDegree(self, InPercents=False, Comments=False)
Renders the symmetry degree (Decimal) of the irreflexive part of a digraph.
 
.. note::
 
   Empty and indeterminate digraphs are considered to be symmetric.
computeTopologicalRanking(self, Debug=False)
Mimetic Wrapper of the topologicalSort() method.
computeTransitivityDegree(self, InPercents=False, Comments=False)
Renders the transitivity degree (Decimal) of a digraph.
 
.. note:: 
 
   An empty or indeterminate digraph is considered to be transitive.
computeUnrelatedPairs(self)
Renders a list of more or less unrelated pairs.
computeValuationLevels(self, choice=None, Debug=False)
renders the symmetric closure of the
apparent valuations levels of self
in an increasingly ordered list.
If parameter choice is given, the
computation is limited to the actions
of the choice.
computeValuationPercentages(self, choice, percentiles, withValues=False)
Parameters: choice and list of percentiles.
renders a series of percentages of the characteristics valuation of
the arcs in the digraph.
computeValuationPercentiles(self, choice, percentages, withValues=False)
Parameters: choice and list of percentages.
renders a series of quantiles of the characteristics valuation of
the arcs in the digraph.
computeValuationStatistics(self, Sampling=False, Comments=False)
Renders the mean and variance of the valuation
of the non reflexive pairs.
computeValuedRankingRelation(self, ranking)
Renders the valued relation characteristics compatible 
with the given linar ranking. Discordant charcateristics 
are set to the indeterminate value.
computeWeakCondorcetLosers(self)
Wrapper for weakCondorcetLosers().
computeWeakCondorcetWinners(self)
Wrapper for weakCondorcetWinners().
computeupdown1(self, s, S)
Help method for show_MIS_HB2 method.
fills self.newmisset, self.upmis, self.downmis.
computeupdown2(self, s, S)
Help method for show_MIS_HB1 method.
Fills self.newmisset, self.upmis, self.downmis.
computeupdown2irred(self, s, S)
Help method for show_MIS_HB1 method.
Fills self.newmisset, self.upmis, self.downmis.
condorcetLosers(self)
Renders the set of decision actions x such that
self.relation[x][y] < self.valuationdomain['med']
for all y != x.
condorcetWinners(self)
Renders the set of decision actions x such that
self.relation[x][y] > self.valuationdomain['med']
for all y != x.
contra(self, v)
Parameter: choice.
Renders the negation of a choice v characteristic's vector.
convertRelationToDecimal(self)
Converts the float valued self.relation in a decimal valued one.
convertValuation2Integer(self, InSite=True, Comments=False)
Converts the self.relation valuation to integer values by converting the Decimals to Fractions and multiply by the least commun multiple of the fraction denominators.
 
*Parameters*:
 
    - If *Insite* == False (True by default) the method returns a modified copy of self.relation without altering the original self.relation, otherwise self.relation and self.valuationdomain is modified.
convertValuationToDecimal(self)
Convert the float valuation limits to Decimals.
coveringIndex(self, choice, direction='out')
Renders the covering index of a given choice in a set of objects,
ie the minimum number of choice members that cover each
non selected object.
crispKDistance(self, digraph, Debug=False)
Renders the crisp Kendall distance between two bipolar valued
digraphs.
 
.. warning::
 
     Obsolete! Is replaced by the self.computeBipolarCorrelation(other, MedianCut=True) Digraph method
detectChordlessCircuits(self, Comments=False, Debug=False)
Detects a chordless circuit in a digraph.
Returns a Boolean
detectChordlessPath(self, Pk, n2, Comments=False, Debug=False)
New procedure from Agrum study April 2009
recursive chordless path extraction starting from path
Pk = [n2, ...., n1] and ending in node n2.
Optimized with marking of visited chordless P1s.
determinateness(self, vec, inPercent=True)
Renders the determinateness of a characteristic vector *vec* = 
[(r(x),x),(r(y),y), ...] of length *n* in valuationdomain [Min,Med,Max]:
 
*result* =  sum_x( abs(r(x)-Med) ) / ( n*(Max-Med) )
 
If inPercent, *result* shifted (+1) and reduced (/2) to [0,1] range.
digraph2Graph(self, valuationDomain={'min': -1, 'med': 0, 'max': 1}, Debug=False, ConjunctiveConversion=True)
Convert a Digraph instance to a Graph instance.
dneighbors(self, node)
Renders the set of dominated out-neighbors of a node.
domin(self, choice)
Renders the dominance degree of a choice.
dominantChoices(self, S)
Generates all minimal dominant choices of a bipolar valued digraph.
 
.. note::
 
     Initiate with S = self.actions.copy().
domirred(self, choice)
Renders the crips +irredundance degree of a choice.
domirredval(self, choice, relation)
Renders the valued +irredundance degree of a choice.
domirredx(self, choice, x)
Renders the crips +irredundance degree of node x in a choice.
domkernelrestrict(self, prekernel)
Parameter: dominant prekernel
Renders dominant prekernel restricted relation.
exportGraphViz(self, fileName=None, actionsSubset=None, bestChoice=set(), worstChoice=set(), firstChoice=set(), lastChoice=set(), Comments=True, graphType='png', pictureFormat=None, graphSize='7,7', relation=None, bgcolor='cornsilk')
export GraphViz dot file  for graph drawing filtering.
exportPrincipalImage(self, plotFileName=None, pictureFormat='pdf', bgcolor='cornsilk', fontcolor='red3', fontsize='0.75', Reduced=False, Colwise=False, tempDir='.', Comments=False)
Export as PDF (default) the principal projection of
the valued relation using the three principal eigen vectors.
 
Implemeted picture formats are: 
'pdf' (default), 'png', 'jpeg' and 'xfig'.
 
The background color is set by default to 'cornsilk'. 
 
Font size and color are set by default to 'red3', resp. '0.75'. 
 
When *Reduced==True*, the valued relation characeteristics are centered and reduced.
 
When *Colwise==True*, the column vectors of the adjacency table are used for the principal projection, otherwise the rows (default) are used. Has no incidence when the *Digraph* instance *self*  is symmetric. 
 
.. warning::
 
    The method, writing and reading temporary files: 
    tempCol.r and rotationCol.csv, resp. tempRow.r and rotationRow.csv,
    by default in the working directory (./),
    is hence not safe for multiprocessing programs, unless a
    temporary directory *tempDir* is provided.
flatChoice(self, ch, Debug=False)
Converts set or list ch recursively to a flat list of items.
forcedBestSingleChoice(self)
Renders the set of most determined outranking singletons in self.
gammaSets(self)
Renders the dictionary of neighborhoods {node: (dx,ax)}
with set *dx* gathering the dominated, and set *ax* gathering
the absorbed neighborhood.
generateAbsPreKernels(self)
Generate all absorbent prekernels from independent choices generator.
generateDomPreKernels(self)
Generate all dominant prekernels from independent choices generator.
htmlChoiceVector(self, ch, ChoiceVector=True, choiceType='good')
Show procedure for annotated bipolar choices.
inDegrees(self)
renders the median cut indegrees
inDegreesDistribution(self)
Renders the distribution of indegrees.
independentChoices(self, U)
Generator for all independent choices with neighborhoods of a bipolar valued digraph:
 
.. note::
 
       * Initiate with U = self.singletons().
       * Yields [(independent choice, domnb, absnb, indnb)].
inner_prod(self, v1, v2)
Parameters: two choice characteristic vectors
Renders the inner product of two characteristic vetors.
intstab(self, choice)
Computes the independence degree of a choice.
irreflex(self, mat)
Puts diagonal entries of mat to valuationdomain['min']
isAsymmetricIndeterminate(self, Debug=False)
Checks the self.relation for assymmetric indeterminateness!!
 
.. warning::
 
    The reflexive links are ignored !!
isComplete(self, Debug=False)
checks the completeness property of self.relation by checking
for the absence of a link between two actions!!
 
.. warning::
 
    The reflexive links are ignored !!
isCyclic(self, Debug=False)
checks the cyclicity of self.relation by checking
for a reflexive loop in its transitive closure-
 
.. warning::
 
     self.relation is supposed to be irreflexive !
isIntegerValued(self, Debug=False)
Checks whether the decimal valuation of self is integer-valued
be using the as_integer_ratio() method of a Decimal 
giving a tuple (numerator,denominator). If denominator == 1, the
number is an integer.
isOutrankingDigraph(self, Comments=True, Debug=False)
Checks the outranking digraph characteristic condition (3.3).
 
relation[x][y] + relation[y][x)[y] >= 0.0
 
.. warning::
 
    The reflexive links are ignored and the valuation must be bipolar !!
isStrictOutrankingDigraph(self, Comments=True, Debug=False)
Checks the strict outranking digraph characteristic condition (3.1).
 
-(relation[x][y] + relation[y][x]) <= 0.0 , x != y
 
.. warning::
 
    The reflexive links are ignored and the valuation must be bipolar !!
isSymmetric(self, Comments=False)
True if symmetry degree == 1.0.
isTransitive(self, Comments=False)
True if transitivity degree == 1.0.
isWeaklyComplete(self, Debug=False)
checks the weakly completeness property of self.relation by checking
for the absence of a link between two actions!!
 
.. warning::
 
    The reflexive links are ignored !!
iterateRankingByChoosing(self, Odd=False, CoDual=False, Comments=True, Debug=False, Limited=None)
Renders a ranking by choosing result when progressively eliminating
all chordless (odd only) circuits with rising valuation cut levels.
 
Parameters
    CoDual = False (default)/True
    Limited = proportion (in [0,1]) * (max - med) valuationdomain
kChoices(self, A, k)
Renders all choices of length k from set A
matmult2(self, m, v)
Parameters: digraph relation and choice characteristic vector
matrix multiply vector by inner production
meanDegree(self)
Renders the mean degree of self.
!!! self.size must be set previously !!!
meanLength(self, Oriented=False)
Renders the (by default non-oriented) mean neighbourhoor depth of self.
!!! self.order must be set previously !!!
minimalChoices(self, S)
Generates all dominant or absorbent choices of a bipolar
valued digraph.
 
.. note:
 
   * Initiate with S = (actions, dict of dominant or absorbent closed neighborhoods)
   * See showMinDom and showMinAbs methods.
minimalValuationLevelForCircuitsElimination(self, Odd=True, Debug=False, Comments=False)
renders the minimal valuation level <lambda> that eliminates all
self.circuitsList stored odd chordless circuits from self.
 
.. warning::
 
    The <lambda> level polarised may still contain newly appearing chordless odd circuits !
neighbourhoodCollection(self, Oriented=False, Potential=False)
Renders the neighbourhood.
neighbourhoodDepthDistribution(self, Oriented=False)
Renders the distribtion of neighbourhood depths.
notGammaSets(self)
Renders the dictionary of neighborhoods {node: (dx,ax)}
with set *dx* gathering the not dominated, and set *ax* gathering
the not absorbed neighborhood.
notaneighbors(self, node)
Renders the set of absorbed not in-neighbors of a node.
notdneighbors(self, node)
Renders the set of not dominated out-neighbors of a node.
outDegrees(self)
renders the median cut outdegrees
outDegreesDistribution(self)
Renders the distribution of outdegrees.
plusirredundant(self, U)
Generates all +irredundant choices of a digraph.
powerset(self, U)
Generates all subsets of a set.
readPerrinMisset(self, file='curd.dat')
read method for 0-1-char-coded MISs by default from the perrinMIS.c curd.dat result file.
readabsvector(self, x, relation)
Parameter: action x
absorbent in vector.
readdomvector(self, x, relation)
Parameter: action x
dominant out vector.
recodeValuation(self, newMin=-1.0, newMax=1.0, ndigits=4, Debug=False)
Recodes the characteristic valuation domain according
to the parameters given. 
 
*ndigits* indicates the number of decimal digits of the valuation.
relationFct(self, x, y)
wrapper for self.relation dictionary access to ensure interoperability
with the sparse and big outranking digraph implementation model.
save(self, fileName='tempdigraph', option=None, DecimalValuation=True, decDigits=2)
Persistent storage of a Digraph class instance in the form of
a python source code file
saveCSV(self, fileName='tempdigraph', Normalized=False, Dual=False, Converse=False, Diagonal=False, Debug=False)
Persistent storage of a Digraph class instance in the form of
a csv file.
saveXMCDA2(self, fileName='temp', fileExt='xmcda2', Comments=True, relationName='R', relationType='binary', category='random', subcategory='valued', author='digraphs Module (RB)', reference='saved from Python', valuationType='standard', digits=2, servingD3=False)
save digraph in XMCDA 2.0 format. Deprecated now.
savedre(self, fileName='temp')
save digraph in nauty format.
sharp(self, x, y)
Paramaters: choice characteristic values.
Renders the sharpest of two characteristic values x and y.
sharpvec(self, v, w)
Paramaters: choice characteristic vectors.
Renders the sharpest of two characteristic vectors v and w.
showActions(self)
presentation methods for digraphs actions
showAll(self)
Detailed show method for genuine digraphs.
showAttributes(self)
Prints out the attributes of self.
showAutomorphismGenerators(self)
Renders the generators of the automorphism group.
showBadChoices(self, Recompute=True)
Characteristic values for potentially bad choices.
showBestChoiceRecommendation(self, Verbose=False, Comments=True, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True)
Shows the RuBis best choice recommendation.
 
.. note::
 
    Computes by default the Rubis best choice recommendation on the corresponding strict (codual) outranking digraph.
 
    By default, with BrokenCocs=True, we brake all chordless circuits at their weakest determined ( abs(r(x>y)) + abs(r(y>x)) ) link.
 
    When BrokenCocs=False we proceed like follows:
 
    In case of chordless circuits, if supporting arcs are more credible
    than the reversed negating arcs, we collapse the circuits into hyper nodes.
    Inversely,  if supporting arcs are not more credible than the reversed negating arcs,
    we brake the circuits on their weakest arc.
 
Usage example:
 
>>> from outrankingDigraphs import *
>>> t = Random3ObjectivesPerformanceTableau(seed=5)
>>> g = BipolarOutrankingDigraph(t)
>>> g.showBestChoiceRecommendation()
***********************
RuBis Best Choice Recommendation (BCR)
(in decreasing order of determinateness)   
Credibility domain:  [-100.0, 100.0]
=== >> potential first choices
* choice              : ['a04', 'a14', 'a19', 'a20']
   independence        : 1.19
   dominance           : 4.76
   absorbency          : -59.52
   covering (%)        : 75.00
   determinateness (%) : 57.86
   - most credible action(s) = { 'a14': 23.81, 'a19': 11.90, 'a04': 2.38, 'a20': 1.19, }  
=== >> potential last choices 
* choice              : ['a03', 'a12', 'a17']
  independence        : 4.76
  dominance           : -76.19
  absorbency          : 4.76
  covering (%)        : 0.00
  determinateness (%) : 65.39
  - most credible action(s) = { 'a03': 38.10, 'a12': 13.10, 'a17': 4.76, }
Execution time: 0.024 seconds
*****************************
showChoiceVector(self, ch, choiceType='good', ChoiceVector=True)
Show procedure for annotated bipolar choices.
showChordlessCircuits(self, Recompute=False)
Show method for chordless circuits observed in a Digraph instance.
 
If previous computation is required, stores the detected circuits in self.circuitsList attribute.
showCorrelation(self, corr=None, ndigits=3)
Renders the valued ordinal correlation index, the crisp Kendall tau index and their epistemic determination degree.
showFirstChoiceRecommendation(self, Verbose=False, Comments=True, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True)
Shows the RuBis first choice recommendation.
 
.. note::
 
    Computes by default the Rubis first choice recommendation on the corresponding strict (codual) outranking digraph.
 
    By default, with BrokenCocs=True, we brake all chordless circuits at their weakest determined ( abs(r(x>y)) + abs(r(y>x)) ) link.
 
    When BrokenCocs=False we proceed like follows:
 
    In case of chordless circuits, if supporting arcs are more credible
    than the reversed negating arcs, we collapse the circuits into hyper nodes.
    Inversely,  if supporting arcs are not more credible than the reversed negating arcs,
    we brake the circuits on their weakest arc.
 
Usage example:
 
>>> from outrankingDigraphs import *
>>> t = Random3ObjectivesPerformanceTableau(seed=5)
>>> g = BipolarOutrankingDigraph(t)
>>> g.showFirstChoiceRecommendation()
***********************
RuBis First Choice Recommendation (BCR)
(in decreasing order of determinateness)   
Credibility domain:  [-100.0, 100.0]
=== >> potential first choices
* choice              : ['a04', 'a14', 'a19', 'a20']
   independence        : 1.19
   dominance           : 4.76
   absorbency          : -59.52
   covering (%)        : 75.00
   determinateness (%) : 57.86
   - most credible action(s) = { 'a14': 23.81, 'a19': 11.90, 'a04': 2.38, 'a20': 1.19, }  
=== >> potential last choices 
* choice              : ['a03', 'a12', 'a17']
  independence        : 4.76
  dominance           : -76.19
  absorbency          : 4.76
  covering (%)        : 0.00
  determinateness (%) : 65.39
  - most credible action(s) = { 'a03': 38.10, 'a12': 13.10, 'a17': 4.76, }
Execution time: 0.024 seconds
*****************************
showGoodChoices(self, Recompute=True)
Characteristic values for potentially good choices.
showHTMLBestChoiceRecommendation(self, pageTitle=None, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True, htmlFileName=None)
showHTMLRelationHeatmap(self, actionsList=None, rankingRule='NetFlows', colorLevels=7, tableTitle='Relation Heatmap', relationName='r(x S y)', ndigits=2, fromIndex=None, toIndex=None, htmlFileName=None)
Launches a browser window with the colored relation map of self.
 
See corresponding :py:class:`~digraphs.Digraph.showHTMLRelationMap` method.
 
The *colorLevels* parameter may be set to 3, 5, 7 (default) or 9.
 
When the *actionsList* parameter is *None* (default), the digraphs actions list may be ranked with the *rankingRule* parameter set to the 'Copeland' (default) or to the 'Netlows' ranking rule.
 
When the *htmlFileName* parameter is set to a string value 'xxx', a html file named 'xxx.html' will be generated in the current working directory. Otherwise, a temporary file named 'tmp*.html' will be generated there.
 
Example::
 
    >>> from outrankingDigraphs import *
    >>> t = RandomCBPerformanceTableau(numberOfActions=25,seed=1)
    >>> g = BipolarOutrankingDigraph(t,ndigits=2)
    >>> gcd = ~(-g)  # strict outranking relation
    >>> gcd.showHTMLRelationHeatmap(colorLevels=7,ndigits=2)
    
.. image:: relationHeatmap.png
   :alt: Browser view of a relation map
   :width: 600 px
   :align: center
showHTMLRelationMap(self, actionsList=None, rankingRule='Copeland', Colored=True, tableTitle='Relation Map', relationName='r(x S y)', symbols=['+', '&middot;', '&nbsp;', '&#150;', '&#151'], fromIndex=None, toIndex=None, htmlFileName=None)
Launches a browser window with the colored relation map of self.
See corresponding Digraph.showRelationMap() method.
 
When *htmlFileName* parameter is set to a string value, a html file
with that name will be stored in the current working directory.
 
By default, a temporary file named: tmp*.html will be generated
instead in the current working directory.
 
Example::
 
    >>> from outrankingDigraphs import *
    >>> t = RandomCBPerformanceTableau(numberOfActions=25,seed=1)
    >>> g = BipolarOutrankingDigraph(t,Normalized=True)
    >>> gcd = ~(-g)  # strict outranking relation
    >>> gcd.showHTMLRelationMap(rankingRule="NetFlows")
    
.. image:: relationMap.png
   :alt: Browser view of a relation map
   :width: 600 px
   :align: center
showHTMLRelationTable(self, actionsList=None, relation=None, IntegerValues=False, ndigits=2, Colored=True, tableTitle='Valued Adjacency Matrix', relationName='r(x S y)', ReflexiveTerms=False, htmlFileName=None, fromIndex=None, toIndex=None)
Launches a browser window with the colored relation table of self.
showMIS(self, withListing=True)
Prints all maximal independent choices:
    Result in self.misset.
showMIS_AH(self, withListing=True)
Prints all MIS using the Hertz method.
 
Result saved in self.hertzmisset.
showMIS_HB2(self, withListing=True)
Prints all MIS using the Hertz-Bisdorff method.
 
Result saved in self.newmisset.
showMIS_RB(self, withListing=True)
Prints all MIS using the Bisdorff method.
 
Result saved in self.newmisset.
showMIS_UD(self, withListing=True)
Prints all MIS using the Hertz-Bisdorff method.
 
Result saved in self.newmisset.
showMaxAbsIrred(self, withListing=True)
Computing maximal -irredundant choices:
    Result in self.absirset.
showMaxDomIrred(self, withListing=True)
Computing maximal +irredundant choices:
   Result in self.domirset.
showMinAbs(self, withListing=True)
Prints minimal absorbent choices:
    Result in self.absset.
showMinDom(self, withListing=True)
Prints all minimal dominant choices:
    Result in self.domset.
showNeighborhoods(self)
Lists the gamma and the notGamma function of self.
showOrbits(self, InChoices, withListing=True)
Prints the orbits of Choices along the automorphisms of
the Digraph instance.
 
Example Python session for computing the non isomorphic MISs from the 12-cycle graph:
 
>>> from digraphs import *
>>> c12 = CirculantDigraph(order=12,circulants=[1,-1])
>>> c12.automorphismGenerators()
...
  Permutations
  {'1': '1', '2': '12', '3': '11', '4': '10', '5': 
   '9', '6': '8', '7': '7', '8': '6', '9': '5', '10': 
   '4', '11': '3', '12': '2'}
  {'1': '2', '2': '1', '3': '12', '4': '11', '5': '10', 
   '6': '9', '7': '8', '8': '7', '9': '6', '10': '5', 
   '11': '4', '12': '3'}
  Reflections {}
>>> print('grpsize = ', c12.automorphismGroupSize)
  grpsize = 24
>>> c12.showMIS(withListing=False)
  *---  Maximal independent choices ---*
  number of solutions:  29
  cardinality distribution
  card.:  [0, 1, 2, 3, 4,  5,  6, 7, 8, 9, 10, 11, 12]
  freq.:  [0, 0, 0, 0, 3, 24,  2, 0, 0, 0,  0,  0,  0]
  Results in c12.misset
>>> c12.showOrbits(c12.misset,withListing=False)
...
  *---- Global result ----
  Number of MIS:  29
  Number of orbits :  4
  Labelled representatives:
  1: ['2','4','6','8','10','12']
  2: ['2','5','8','11']
  3: ['2','4','6','9','11']
  4: ['1','4','7','9','11']
  Symmetry vector
  stabilizer size: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, ...]
  frequency      : [0, 2, 0, 0, 0, 0, 0, 1, 0,  0,  0,  1, ...]
 
*Figure*: The symmetry axes of the non isomorphic MISs of the 12-cycle:
 
.. image:: c12.png
   :width: 400 px
   :align: center
   :alt: The 4 non isomorphic MIS of the 12-cycle graph
 
*Reference*: R. Bisdorff and J.L. Marichal (2008). Counting non-isomorphic maximal independent sets of the n-cycle graph. *Journal of Integer Sequences*, Vol. 11 Article 08.5.7 (`openly accessible here <https://www.cs.uwaterloo.ca/journals/JIS/VOL11/Marichal/marichal.html>`_)
showOrbitsFromFile(self, InFile, withListing=True)
Prints the orbits of Choices along the automorphisms of
the digraph self by reading in the 0-1 misset file format.
See the :py:func:`digraphs.Digraph.readPerrinMisset` method.
showPreKernels(self, withListing=True)
Printing dominant and absorbent preKernels:
    Result in self.dompreKernels and self.abspreKernels
showRankingByBestChoosing(self, rankingByBestChoosing=None)
A show method for self.rankinByBestChoosing result.
 
.. warning::
 
     The self.computeRankingByBestChoosing(CoDual=False/True) method instantiating the self.rankingByBestChoosing slot is pre-required !
showRankingByChoosing(self, rankingByChoosing=None, WithCoverCredibility=False)
A show method for self.rankinByChoosing result.
 
When parameter *WithCoverCredibility* is set to True, the credibility of outranking, respectively being outranked is indicated at each selection step. 
 
.. warning::
 
     The self.computeRankingByChoosing(CoDual=False/True) method instantiating the self.rankingByChoosing slot is pre-required !
showRankingByLastChoosing(self, rankingByLastChoosing=None, Debug=None)
A show method for self.rankinByChoosing result.
 
.. warning::
 
     The self.computeRankingByLastChoosing(CoDual=False/True) method instantiating the self.rankingByChoosing slot is pre-required !
showRelation(self)
prints the relation valuation in ##.## format.
showRelationMap(self, symbols=None, rankingRule='Copeland', fromIndex=None, toIndex=None, actionsList=None)
Prints on the console, in text map format, the location of
certainly validated and certainly invalidated outranking situations.
 
By default, symbols = {'max':'┬','positive': '+', 'median': ' ',
                       'negative': '-', 'min': '┴'}
 
The default ordering of the output is following the Copeland ranking rule
from best to worst actions. Further available ranking rule is the 'NetFlows' net flows rule.
 
 
Example::
 
    >>> from outrankingDigraphs import *
    >>> t = RandomCBPerformanceTableau(numberOfActions=25,seed=1)
    >>> g = BipolarOutrankingDigraph(t,Normalized=True)
    >>> gcd = ~(-g)  # strict outranking relation
    >>> gcd.showRelationMap(rankingRule="NetFlows")
     -   ++++++++  +++++┬+┬┬+
    - -   + +++++ ++┬+┬+++┬++
    ┴+  ┴ + ++  ++++┬+┬┬++┬++
    -   ++ - ++++-++++++┬++┬+
       - - - ++- ┬- + -+┬+-┬┬
    -----  -      -┬┬┬-+  -┬┬
    ----    --+-+++++++++++++
    -- --+- --++ ++ +++-┬+-┬┬
    ----  -  -+-- ++--+++++ +
    ----- ++- --- +---++++┬ +
    -- -- ---+ -++-+++-+ +-++
    -- --┴---+  + +-++-+ -  +
    ---- ┴---+-- ++--++++ - +
      --┴┴--  --- -  --+ --┬┬
     ---------+--+ ----- +-┬┬
    -┴---┴- ---+- + ---+++┬ +
    -┴┴--┴---+--- ++ -++--+++
    -----┴--- ---+-+- ++---+ 
    -┴┴--------------- --++┬ 
    --┴---------------- --+┬ 
    ┴--┴┴ -┴--┴┴-┴ --++  ++-+
    ----┴┴--------------- -  
    ┴┴┴----+-┴+┴---┴-+---+ ┴+
    ┴┴-┴┴┴-┴- - -┴┴---┴┴+ ┬ -
    ----┴┴-┴-----┴┴---  - -- 
    Ranking rule: NetFlows
    >>>
showRelationTable(self, Sorted=True, rankingRule=None, IntegerValues=False, actionsSubset=None, relation=None, ndigits=2, ReflexiveTerms=True, fromIndex=None, toIndex=None)
Prints the relation valuation in actions X actions table format.
Copeland and NetFlows rankings my be used.
showRubisBestChoiceRecommendation(self, **kwargs)
Dummy for backward portable showBestChoiceRecommendation().
showRubyChoice(self, Verbose=False, Comments=True, _OldCoca=True)
Dummy for showBestChoiceRecommendation()
needed for older versions compatibility.
showShort(self)
concise presentation method for genuine digraphs.
showSingletonRanking(self, Comments=True, Debug=False)
Calls self.computeSingletonRanking(comments=True,Debug = False).
Renders and prints the sorted bipolar net determinatation of outrankingness
minus outrankedness credibilities of all singleton choices.
 
res = ((netdet,sigleton,dom,absorb)+)
showStatistics(self)
Computes digraph statistics like order, size and arc-density.
showdre(self)
Shows relation in nauty format.
singletons(self)
list of singletons and neighborhoods
[(singx1, +nx1, -nx1, not(+nx1 or -nx1)),.... ]
sizeSubGraph(self, choice)
Output: (size, undeterm,arcDensity).
Renders the arc density of the induced subgraph.
strongComponents(self, setPotential=False)
Renders the set of strong components of self.
symDegreesDistribution(self)
Renders the distribution of symmetric degrees.
topologicalSort(self, Debug=False)
If self is acyclic, adds topological sort number to each node of self
and renders ordered list of nodes. Otherwise renders None.
Source: M. Golumbic Algorithmic Graph heory and Perfect Graphs,
Annals Of Discrete Mathematics 57 2nd Ed. , Elsevier 2004, Algorithm 2.4 p.44.
weakAneighbors(self, node)
Renders the set of absorbed in-neighbors of a node.
weakCondorcetLosers(self)
Renders the set of decision actions x such that
self.relation[x][y] <= self.valuationdomain['med']
for all y != x.
weakCondorcetWinners(self)
Renders the set of decision actions x such that
self.relation[x][y] >= self.valuationdomain['med']
for all y != x.
weakDneighbors(self, node)
Renders the set of dominated out-neighbors of a node.
weakGammaSets(self)
Renders the dictionary of neighborhoods {node: (dx,ax)}
zoomValuation(self, zoomFactor=1.0)
Zooms in or out, depending on the value of the zoomFactor provided,
the bipolar valuation of a digraph.

Data descriptors inherited from Digraph:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class CSVDigraph(Digraph)
    CSVDigraph(fileName='temp', valuationMin=-1, valuationMax=1)
 
Specialization of the general Digraph class for reading
stored csv formatted digraphs. Using the inbuilt module csv.
 
Param:
    fileName (without the extension .csv).
 
 
Method resolution order:
CSVDigraph
Digraph
builtins.object

Methods defined here:
__init__(self, fileName='temp', valuationMin=-1, valuationMax=1)
Initialize self.  See help(type(self)) for accurate signature.
showAll(self)
Detailed show method for genuine digraphs.

Methods inherited from Digraph:
MISgen(self, S, I)
generator of maximal independent choices (voir Byskov 2004):
    * S ::= remaining nodes;
    * I ::= current independent choice
 
.. note::
 
        Inititalize: self.MISgen(self.actions.copy(),set())
__invert__(self)
Make the inverting operator ~self available for Digraph instances. 
 
Returns a ConverseDigraph instance of self.
__neg__(self)
Make the negation operator -self available for Digraph instances. 
 
Returns a DualDigraph instance of self.
__repr__(self)
Default presentation method for Digraph instances.
absirred(self, choice)
Renders the crips -irredundance degree of a choice.
absirredundant(self, U)
Generates all -irredundant choices of a digraph.
absirredval(self, choice, relation)
Renders the valued -irredundance degree of a choice.
absirredx(self, choice, x)
Computes the crips -irredundance degree of node x in a choice.
abskernelrestrict(self, prekernel)
Parameter: prekernel
Renders absorbent prekernel restricted relation.
absorb(self, choice)
Renders the absorbency degree of a choice.
absorbentChoices(self, S)
Generates all minimal absorbent choices of a bipolar valued digraph.
addValuationAttribute(self)
Adds the numpy valuation attribute
agglomerationDistribution(self)
Output: aggloCoeffDistribution, meanCoeff
Renders the distribution of agglomeration coefficients.
aneighbors(self, node)
Renders the set of absorbed in-neighbors of a node.
automorphismGenerators(self)
Adds automorphism group generators to the digraph instance.
 
.. note::
 
    Dependency: Uses the dreadnaut command from the nauty software package. See https://www3.cs.stonybrook.edu/~algorith/implement/nauty/implement.shtml
 
    On Ubuntu Linux:
      ...$ sudo apt-get install nauty
averageCoveringIndex(self, choice, direction='out')
Renders the average covering index of a given choice in a set of objects,
ie the average number of choice members that cover each
non selected object.
bipolarKCorrelation(self, digraph, Debug=False)
Renders the bipolar Kendall correlation between two bipolar valued
digraphs computed from the average valuation of the
XORDigraph(self,digraph) instance.
 
.. warning::
 
     Obsolete! Is replaced by the self.computeBipolarCorrelation(other) Digraph method
bipolarKDistance(self, digraph, Debug=False)
Renders the bipolar crisp Kendall distance between two bipolar valued
digraphs.
 
.. warning::
 
     Obsolete! Is replaced by the self.computeBipolarCorrelation(other, MedianCut=True) Digraph method
chordlessPaths(self, Pk, n2, Odd=False, Comments=False, Debug=False)
New procedure from Agrum study April 2009
recursive chordless path extraction starting from path
Pk = [n2, ...., n1] and ending in node n2.
Optimized with marking of visited chordless P1s.
circuitAverageCredibility(self, circ)
Renders the average linking credibility of a Chordless Circuit.
circuitCredibilities(self, circuit, Debug=False)
Renders the average linking credibilities and the minimal link of a Chordless Circuit.
circuitMaxCredibility(self, circ)
Renders the maximal linking credibility of a Chordless Circuit.
circuitMinCredibility(self, circ)
Renders the minimal linking credibility of a Chordless Circuit.
closeSymmetric(self, InSite=True)
Produces the symmetric closure of self.relation.
closeTransitive(self, Reverse=False, InSite=True, Comments=False)
Produces the transitive closure of self.relation
 
*Parameters*:
 
    - If *Reverse* == True (False default) all transitive links are dropped, otherwise all transitive links are closed with min[r(x,y),r(y,z)];
    - If *Insite* == False (True by default) the methods return a modified copy of self.relation without altering the original self.relation, otherwise self.relation is modified.
components(self)
Renders the list of connected components.
computeAllDensities(self, choice=None)
parameter: choice in self
renders six densitiy parameters:
arc density, double arc density,
single arc density, strict single arc density,
absence arc density, strict absence arc densitiy.
computeArrowRaynaudOrder(self)
Renders a linear ordering from worst to best of the actions following Arrow&Raynaud's rule.
computeArrowRaynaudRanking(self)
renders a linear ranking from best to worst of the actions following Arrow&Raynaud's rule.
computeAverageValuation(self)
Computes the bipolar average correlation between
self and the crisp complete digraph of same order
of the irreflexive and determined arcs of the digraph
computeBadChoices(self, Comments=False)
Computes characteristic values for potentially bad choices.
 
.. note::
 
     Returns a tuple with following content:
 
     [(0)-determ,(1)degirred,(2)degi,(3)degd,(4)dega,(5)str(choice),(6)absvec]
computeBadPirlotChoices(self, Comments=False)
Characteristic values for potentially bad choices
using the Pirlot's fixpoint algorithm.
computeBestChoiceRecommendation(self, Verbose=False, Comments=False, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True)
Sets self.bestChoice, self.bestChoiceData, self.worstChoice and self.worstChoiceData
with the showBestChoiceRecommendation method.
 
First and last choices data is the following:
[(0)-determ,(1)degirred,(2)degi,(3)degd,(4)dega,(5)str(choice),(6)domvec,(7)cover]
 
self.bestChoice = self.bestChoiceData[5]
self.worstChoice = self.worstChoiceData[5]
computeBipolarCorrelation(self, other, MedianCut=False, filterRelation=None, Debug=False)
obsolete: dummy replacement for Digraph.computeOrdinalCorrelation method
computeChordlessCircuits(self, Odd=False, Comments=False, Debug=False)
Renders the set of all chordless circuits detected in a digraph.
Result is stored in <self.circuitsList>
holding a possibly empty list of tuples with at position 0 the
list of adjacent actions of the circuit and at position 1
the set of actions in the stored circuit.
 
When *Odd* is True, only chordless circuits with an odd length
are collected.
computeChordlessCircuitsMP(self, Odd=False, Threading=False, nbrOfCPUs=None, startMethod=None, Comments=False, Debug=False)
Multiprocessing version of computeChordlessCircuits().
 
Renders the set of all chordless odd circuits detected in a digraph.
Result (possible empty list) stored in <self.circuitsList>
holding a possibly empty list tuples with at position 0 the
list of adjacent actions of the circuit and at position 1
the set of actions in the stored circuit.
Inspired by Dias, Castonguay, Longo, Jradi, Algorithmica (2015).
 
Returns a possibly empty list of tuples (circuit,frozenset(circuit)).
 
If Odd == True, only circuits of odd length are retained in the result.
computeCoSize(self)
Renders the number of non validated non reflexive arcs
computeConcentrationIndex(self, X, N)
Renders the Gini concentration index of the X serie.
N contains the partial frequencies.
Based on the triangle summation formula.
computeConcentrationIndexTrapez(self, X, N)
Renders the Gini concentration index of the X serie.
N contains the partial frequencies.
Based on the triangles summation formula.
computeCondorcetLosers(self)
Wrapper for condorcetLosers().
computeCondorcetWinners(self)
Wrapper for condorcetWinners().
computeCopelandOrder(self)
renders a linear ordering from worst to best of the actions following Arrow&Raynaud's rule.
computeCopelandRanking(self)
renders a linear ranking from best to worst of the actions following Arrow&Raynaud's rule.
computeCutLevelDensities(self, choice, level)
parameter: choice in self, robustness level
renders three robust densitiy parameters:
robust double arc density,
robust single arc density,
robust absence arc densitiy.
computeDensities(self, choice)
parameter: choice in self
renders the four densitiy parameters:
arc density, double arc density, single arc density, absence arc density.
computeDeterminateness(self, InPercents=False)
Computes the Kendalll distance of self
with the all median-valued indeterminate digraph of order n.
 
Return the average determination of the irreflexive part of the digraph.
 
*determination* = sum_(x,y) { abs[ r(xRy) - Med ] } / n(n-1)
 
If *InPercents* is True, returns the average determination in percentage of
(Max - Med) difference.
 
>>> from outrankingDigraphs import BipolarOutrankingDigraph
>>> from randomPerfTabs import Random3ObjectivesPerformanceTableau
>>> t = Random3ObjectivesPerformanceTableau(numberOfActions=7,numberOfCriteria=7,seed=101)
>>> g = BipolarOutrankingDigraph(t,Normalized=True)
>>> g
*------- Object instance description ------*
Instance class      : BipolarOutrankingDigraph
Instance name       : rel_random3ObjectivesPerfTab
Actions             : 7
Criteria            : 7
Size                : 27
Determinateness (%) : 65.67
Valuation domain    : [-1.00;1.00]
>>> print(g.computeDeterminateness())
0.3134920634920634920634920638
>>> print(g.computeDeterminateness(InPercents=True))
65.67460317460317460317460320
>>> g.recodeValuation(0,1)
>>> g
*------- Object instance description ------*
Instance class      : BipolarOutrankingDigraph
Instance name       : rel_random3ObjectivesPerfTab
Actions             : 7
Criteria            : 7
Size                : 27
Determinateness (%) : 65.67
Valuation domain    : [0.00;1.00]
>>> print(g.computeDeterminateness())
0.1567460317460317460317460318
>>> print(g.computeDeterminateness(InPercents=True))
65.67460317460317460317460320
computeDiameter(self, Oriented=True)
Renders the (by default oriented) diameter of the digraph instance
computeDigraphCentres(self, WeakDistances=False, Comments=False)
The centers of a digraph are the nodes with finite minimal shortes path lengths.
 
The maximal neighborhood distances are stored in *self.maximalNeighborhoodDistances*.
 
The corresponding digraph radius and diameter are stored respectively  in *self.radius* and *self.diameter*.
 
With *Comments* = True, all these results are printed out.
 
*Source*: Claude Berge, *The Theory of Graphs*, Dover (2001) pp. 119, original in French Dunod (1958)
computeDynamicProgrammingStages(self, source, sink, Debug=False)
Renders the discrete stages of the optimal substructure for
dynamic pogramming digrahs from a given source node 
to a given sink sink node.
 
Returns a list of list of action identifyers.
computeGoodChoiceVector(self, ker, Comments=False)
| Computing Characteristic values for dominant pre-kernels
| using the von Neumann dual fixoint equation
computeGoodChoices(self, Comments=False)
Computes characteristic values for potentially good choices.
 
..note::
 
     Return a tuple with following content:
 
     [(0)-determ,(1)degirred,(2)degi,(3)degd,(4)dega,(5)str(choice),(6)domvec,(7)cover]
computeGoodPirlotChoices(self, Comments=False)
Characteristic values for potentially good choices
using the Pirlot fixpoint algorithm.
computeIncomparabilityDegree(self, InPercents=False, Comments=False)
Renders the incomparability degree (Decimal), i.e. the relative number of symmetric indeterminate relations of the irreflexive part of a digraph.
computeKemenyIndex(self, otherRelation)
renders the Kemeny index of the self.relation
compared with a given crisp valued relation of a compatible
other digraph (same nodes or actions).
computeKemenyOrder(self, orderLimit=7, Debug=False)
Renders a ordering from worst to best of the actions with maximal Kemeny index.
Return a tuple: kemenyOrder (from worst to best), kemenyIndex
computeKemenyRanking(self, orderLimit=7, seed=None, sampleSize=1000, Debug=False)
Renders a ranking from best to worst of the actions with maximal Kemeny index.
 
.. note::
 
     Returns a tuple: kemenyRanking (from best to worst), kemenyIndex.
computeKernelVector(self, kernel, Initial=True, Comments=False)
| Computing Characteristic values for dominant pre-kernels
| using the von Neumann dual fixpoint equation
computeKohlerOrder(self)
Renders an ordering (worst to best) of the actions following Kohler's rule.
computeKohlerRanking(self)
Renders a ranking (best to worst) of the actions following Kohler's rule.
computeMaxHoleSize(self, Comments=False)
Renders the length of the largest chordless cycle
in the corresponding disjunctive undirected graph.
computeMeanInDegree(self)
Renders the mean indegree of self.
!!! self.size must be set previously !!!
computeMeanOutDegree(self)
Renders the mean degree of self.
!!! self.size must be set previously !!!
computeMeanSymDegree(self)
Renders the mean degree of self.
!!! self.size must be set previously !!!
computeMedianOutDegree(self)
Renders the median outdegree of self.
!!! self.size must be set previously !!!
computeMedianSymDegree(self)
Renders the median symmetric degree of self.
!!! self.size must be set previously !!!
computeMoreOrLessUnrelatedPairs(self)
Renders a list of more or less unrelated pairs.
computeNetFlowsOrder(self)
Renders an ordered list (from best to worst) of the actions
following the net flows ranking rule.
computeNetFlowsOrderDict(self)
Renders an ordered list (from worst to best) of the actions
following the net flows ranking rule.
computeNetFlowsRanking(self)
Renders an ordered list (from best to worst) of the actions
following the net flows ranking rule.
computeNetFlowsRankingDict(self)
Renders an ordered list (from best to worst) of the actions
following the net flows ranking rule.
computeODistance(self, op2, comments=False)
renders the squared normalized distance of
two digraph valuations.
 
.. note::
 
     op2 = digraphs of same order as self.
computeOrbit(self, choice, withListing=False)
renders the set of isomorph copies of a choice following
the automorphism of the digraph self
computeOrderCorrelation(self, order, Debug=False)
Renders the ordinal correlation K of a digraph instance
when compared with a given linear order (from worst to best) of its actions
 
K = sum_{x != y} [ min( max(-self.relation(x,y)),other.relation(x,y), max(self.relation(x,y),-other.relation(x,y)) ]
 
K /= sum_{x!=y} [ min(abs(self.relation(x,y),abs(other.relation(x,y)) ]
 
.. note::
 
     Renders a dictionary with the key 'correlation' containing the actual bipolar correlation index and the key 'determination' containing the minimal determination level D of self and the other relation.
 
     D = sum_{x != y} min(abs(self.relation(x,y)),abs(other.relation(x,y)) / n(n-1)
 
     where n is the number of actions considered.
 
     The correlation index with a completely indeterminate relation
     is by convention 0.0 at determination level 0.0 .
 
.. warning::
 
     self must be a normalized outranking digraph instance !
computeOrdinalCorrelation(self, other, MedianCut=False, filterRelation=None, Debug=False)
Renders the bipolar correlation K of a
self.relation when compared
with a given compatible (same actions set)) digraph or
a [-1,1] valued compatible relation (same actions set).
 
If MedianCut=True, the correlation is computed on the median polarized relations.
 
If filterRelation is not None, the correlation is computed on the partial domain corresponding to the determined part of the filter relation.
 
.. warning::
 
     Notice that the 'other' relation and/or the 'filterRelation',
     the case given, must both be normalized, ie [-1,1]-valued !
 
K = sum_{x != y} [ min( max(-self.relation[x][y]),other.relation[x][y]), max(self.relation[x][y],-other.relation[x][y]) ]
 
K /= sum_{x!=y} [ min(abs(self.relation[x][y]),abs(other.relation[x][y])) ]
 
.. note::
 
     Renders a tuple with at position 0 the actual bipolar correlation index
     and in position 1 the minimal determination level D of self and
     the other relation.
 
     D = sum_{x != y} min(abs(self.relation[x][y]),abs(other.relation[x][y])) / n(n-1)
 
     where n is the number of actions considered.
 
     The correlation index with a completely indeterminate relation
     is by convention 0.0 at determination level 0.0 .
computeOrdinalCorrelationMP(self, other, MedianCut=False, Threading=False, nbrOfCPUs=None, startMethod=None, Comments=False, Debug=False)
Multi processing version of the digraphs.computeOrdinalCorrelation() method.
 
.. note::
     The relation filtering and the MedinaCut option are not implemented in the MP version.
computePairwiseClusterComparison(self, K1, K2, Debug=False)
Computes the pairwise cluster comparison credibility vector
from bipolar-valued digraph g. with K1 and K2 disjoint
lists of action keys from g actions disctionary.
Returns the dictionary
{'I': Decimal(),'P+':Decimal(),'P-':Decimal(),'R' :Decimal()}
where one and only one item is strictly positive.
computePreKernels(self)
computing dominant and absorbent preKernels:
    Result in self.dompreKernels and self.abspreKernels
computePreRankingRelation(self, preRanking, Normalized=True, Debug=False)
Renders the bipolar-valued relation obtained from
a given preRanking in decreasing levels (list of lists) result.
computePreorderRelation(self, preorder, Normalized=True, Debug=False)
Renders the bipolar-valued relation obtained from
a given preordering in increasing levels (list of lists) result.
computePrincipalOrder(self, Colwise=False, Comments=False)
Rendesr an ordering from wrost to best of the decision actions.
computePrincipalRanking(self, Colwise=False, Comments=False)
Rendesr a ranking from best to worst of the decision actions.
computePrincipalScores(self, plotFileName=None, Colwise=False, imageType=None, tempDir=None, bgcolor='cornsilk', Comments=False, Debug=False)
Renders a ordered list of the first principal eigenvector of the covariance of the valued outdegrees of self.
 
.. note::
 
   The method, relying on writing and reading temporary files by default in a temporary directory is threading and multiprocessing safe !
   (see Digraph.exportPrincipalImage method)
computePrudentBetaLevel(self, Debug=False)
computes alpha, ie the lowest valuation level, for which the
bipolarly polarised digraph doesn't contain a chordless circuit.
computeRankingByBestChoosing(self, CoDual=False, Debug=False)
Computes a weak preordering of the self.actions by recursive
best choice elagations.
 
Stores in self.rankingByBestChoosing['result'] a list of (P+,bestChoice) tuples
where P+ gives the best choice complement outranking
average valuation via the computePairwiseClusterComparison
method.
 
If self.rankingByBestChoosing['CoDual'] is True, 
the ranking-by-choosing was computed on the codual of self.
computeRankingByBestChoosingRelation(self, rankingByBestChoosing=None, Debug=False)
Renders the bipolar-valued relation obtained from
the self.rankingByBestChoosing result.
computeRankingByChoosing(self, actionsSubset=None, Debug=False, CoDual=False)
Computes a weak preordring of the self.actions by iterating
jointly first and last choice elagations.
 
Stores in self.rankingByChoosing['result'] a list of ((P+,bestChoice),(P-,worstChoice)) pairs
where P+ (resp. P-) gives the best (resp. worst) choice complement outranking
(resp. outranked) average valuation via the computePairwiseClusterComparison
method.
 
If self.rankingByChoosing['CoDual'] is True, the ranking-by-choosing was computed on the codual of self.
computeRankingByChoosingRelation(self, rankingByChoosing=None, actionsSubset=None, Debug=False)
Renders the bipolar-valued relation obtained from
the self.rankingByChoosing result.
computeRankingByLastChoosing(self, CoDual=False, Debug=False)
Computes a weak preordring of the self.actions by iterating
worst choice elagations.
 
Stores in self.rankingByLastChoosing['result'] a list of (P-,worstChoice) pairs
where P- gives the worst choice complement outranked
average valuation via the computePairwiseClusterComparison
method.
 
If self.rankingByChoosing['CoDual'] is True, the ranking-by-last-chossing 
was computed on the codual of self.
computeRankingByLastChoosingRelation(self, rankingByLastChoosing=None, Debug=False)
Renders the bipolar-valued relation obtained from
the self.rankingByLastChoosing result.
computeRankingCorrelation(self, ranking, Debug=False)
Renders the ordinal correlation K of a digraph instance
when compared with a given linear ranking of its actions
 
K = sum_{x != y} [ min( max(-self.relation(x,y)),other.relation(x,y), max(self.relation(x,y),-other.relation(x,y)) ]
 
K /= sum_{x!=y} [ min(abs(self.relation(x,y),abs(other.relation(x,y)) ]
 
.. note::
 
     Renders a tuple with at position 0 the actual bipolar correlation index
     and in position 1 the minimal determination level D of self and
     the other relation.
 
     D = sum_{x != y} min(abs(self.relation(x,y)),abs(other.relation(x,y)) / n(n-1)
 
     where n is the number of actions considered.
 
     The correlation index with a completely indeterminate relation
     is by convention 0.0 at determination level 0.0 .
computeRelationalStructure(self, Debug=False)
Renders the counted decomposition of the valued relations into
the following type of links:
gt '>', eq '=', lt '<', incomp '<>',
leq '<=', geq '>=', indeterm '?'
computeRubisChoice(self, Comments=False, _OldCoca=False, BrokenCocs=True, Threading=False, nbrOfCPUs=1)
Renders self.strictGoodChoices, self.nullChoices
self.strictBadChoices, self.nonRobustChoices.
 
.. warning::
    Changes in site the outranking digraph by
    adding or braking chordless odd outranking circuits.
computeRubyChoice(self, Comments=False, _OldCoca=False)
dummy for computeRubisChoice()
old versions compatibility.
computeShortestPathLengths(self, WeakPaths=False, Comments=False, Debug=False)
Renders a double dictionary with the directed distances, i.e. the shortest path lengths between all self.actions
 
Equals *None* if there does not exist a directed path between two actions.
 
*Source*: Claude Berge, *The Theory of Graphs*, Dover (2001) pp. 119, original in French Dunod (1958)
computeSingletonRanking(self, Comments=False, Debug=False)
Renders the sorted bipolar net determinatation of outrankingness
minus outrankedness credibilities of all singleton choices.
 
res = ((netdet,singleton,dom,absorb)+)
computeSize(self)
Renders the number of validated non reflexive arcs
computeSizeTransitiveClosure(self)
Renders the size of the transitive closure of a digraph.
computeSlaterOrder(self, isProbabilistic=False, seed=None, sampleSize=1000, Debug=False)
Reversed return from computeSlaterRanking method.
computeSlaterRanking(self, isProbabilistic=False, seed=None, sampleSize=1000, Debug=False)
Renders a ranking of the actions with minimal Slater index.
Return a tuple: slaterOrder, slaterIndex
computeSymmetryDegree(self, InPercents=False, Comments=False)
Renders the symmetry degree (Decimal) of the irreflexive part of a digraph.
 
.. note::
 
   Empty and indeterminate digraphs are considered to be symmetric.
computeTopologicalRanking(self, Debug=False)
Mimetic Wrapper of the topologicalSort() method.
computeTransitivityDegree(self, InPercents=False, Comments=False)
Renders the transitivity degree (Decimal) of a digraph.
 
.. note:: 
 
   An empty or indeterminate digraph is considered to be transitive.
computeUnrelatedPairs(self)
Renders a list of more or less unrelated pairs.
computeValuationLevels(self, choice=None, Debug=False)
renders the symmetric closure of the
apparent valuations levels of self
in an increasingly ordered list.
If parameter choice is given, the
computation is limited to the actions
of the choice.
computeValuationPercentages(self, choice, percentiles, withValues=False)
Parameters: choice and list of percentiles.
renders a series of percentages of the characteristics valuation of
the arcs in the digraph.
computeValuationPercentiles(self, choice, percentages, withValues=False)
Parameters: choice and list of percentages.
renders a series of quantiles of the characteristics valuation of
the arcs in the digraph.
computeValuationStatistics(self, Sampling=False, Comments=False)
Renders the mean and variance of the valuation
of the non reflexive pairs.
computeValuedRankingRelation(self, ranking)
Renders the valued relation characteristics compatible 
with the given linar ranking. Discordant charcateristics 
are set to the indeterminate value.
computeWeakCondorcetLosers(self)
Wrapper for weakCondorcetLosers().
computeWeakCondorcetWinners(self)
Wrapper for weakCondorcetWinners().
computeupdown1(self, s, S)
Help method for show_MIS_HB2 method.
fills self.newmisset, self.upmis, self.downmis.
computeupdown2(self, s, S)
Help method for show_MIS_HB1 method.
Fills self.newmisset, self.upmis, self.downmis.
computeupdown2irred(self, s, S)
Help method for show_MIS_HB1 method.
Fills self.newmisset, self.upmis, self.downmis.
condorcetLosers(self)
Renders the set of decision actions x such that
self.relation[x][y] < self.valuationdomain['med']
for all y != x.
condorcetWinners(self)
Renders the set of decision actions x such that
self.relation[x][y] > self.valuationdomain['med']
for all y != x.
contra(self, v)
Parameter: choice.
Renders the negation of a choice v characteristic's vector.
convertRelationToDecimal(self)
Converts the float valued self.relation in a decimal valued one.
convertValuation2Integer(self, InSite=True, Comments=False)
Converts the self.relation valuation to integer values by converting the Decimals to Fractions and multiply by the least commun multiple of the fraction denominators.
 
*Parameters*:
 
    - If *Insite* == False (True by default) the method returns a modified copy of self.relation without altering the original self.relation, otherwise self.relation and self.valuationdomain is modified.
convertValuationToDecimal(self)
Convert the float valuation limits to Decimals.
coveringIndex(self, choice, direction='out')
Renders the covering index of a given choice in a set of objects,
ie the minimum number of choice members that cover each
non selected object.
crispKDistance(self, digraph, Debug=False)
Renders the crisp Kendall distance between two bipolar valued
digraphs.
 
.. warning::
 
     Obsolete! Is replaced by the self.computeBipolarCorrelation(other, MedianCut=True) Digraph method
detectChordlessCircuits(self, Comments=False, Debug=False)
Detects a chordless circuit in a digraph.
Returns a Boolean
detectChordlessPath(self, Pk, n2, Comments=False, Debug=False)
New procedure from Agrum study April 2009
recursive chordless path extraction starting from path
Pk = [n2, ...., n1] and ending in node n2.
Optimized with marking of visited chordless P1s.
determinateness(self, vec, inPercent=True)
Renders the determinateness of a characteristic vector *vec* = 
[(r(x),x),(r(y),y), ...] of length *n* in valuationdomain [Min,Med,Max]:
 
*result* =  sum_x( abs(r(x)-Med) ) / ( n*(Max-Med) )
 
If inPercent, *result* shifted (+1) and reduced (/2) to [0,1] range.
digraph2Graph(self, valuationDomain={'min': -1, 'med': 0, 'max': 1}, Debug=False, ConjunctiveConversion=True)
Convert a Digraph instance to a Graph instance.
dneighbors(self, node)
Renders the set of dominated out-neighbors of a node.
domin(self, choice)
Renders the dominance degree of a choice.
dominantChoices(self, S)
Generates all minimal dominant choices of a bipolar valued digraph.
 
.. note::
 
     Initiate with S = self.actions.copy().
domirred(self, choice)
Renders the crips +irredundance degree of a choice.
domirredval(self, choice, relation)
Renders the valued +irredundance degree of a choice.
domirredx(self, choice, x)
Renders the crips +irredundance degree of node x in a choice.
domkernelrestrict(self, prekernel)
Parameter: dominant prekernel
Renders dominant prekernel restricted relation.
exportGraphViz(self, fileName=None, actionsSubset=None, bestChoice=set(), worstChoice=set(), firstChoice=set(), lastChoice=set(), Comments=True, graphType='png', pictureFormat=None, graphSize='7,7', relation=None, bgcolor='cornsilk')
export GraphViz dot file  for graph drawing filtering.
exportPrincipalImage(self, plotFileName=None, pictureFormat='pdf', bgcolor='cornsilk', fontcolor='red3', fontsize='0.75', Reduced=False, Colwise=False, tempDir='.', Comments=False)
Export as PDF (default) the principal projection of
the valued relation using the three principal eigen vectors.
 
Implemeted picture formats are: 
'pdf' (default), 'png', 'jpeg' and 'xfig'.
 
The background color is set by default to 'cornsilk'. 
 
Font size and color are set by default to 'red3', resp. '0.75'. 
 
When *Reduced==True*, the valued relation characeteristics are centered and reduced.
 
When *Colwise==True*, the column vectors of the adjacency table are used for the principal projection, otherwise the rows (default) are used. Has no incidence when the *Digraph* instance *self*  is symmetric. 
 
.. warning::
 
    The method, writing and reading temporary files: 
    tempCol.r and rotationCol.csv, resp. tempRow.r and rotationRow.csv,
    by default in the working directory (./),
    is hence not safe for multiprocessing programs, unless a
    temporary directory *tempDir* is provided.
flatChoice(self, ch, Debug=False)
Converts set or list ch recursively to a flat list of items.
forcedBestSingleChoice(self)
Renders the set of most determined outranking singletons in self.
gammaSets(self)
Renders the dictionary of neighborhoods {node: (dx,ax)}
with set *dx* gathering the dominated, and set *ax* gathering
the absorbed neighborhood.
generateAbsPreKernels(self)
Generate all absorbent prekernels from independent choices generator.
generateDomPreKernels(self)
Generate all dominant prekernels from independent choices generator.
htmlChoiceVector(self, ch, ChoiceVector=True, choiceType='good')
Show procedure for annotated bipolar choices.
inDegrees(self)
renders the median cut indegrees
inDegreesDistribution(self)
Renders the distribution of indegrees.
independentChoices(self, U)
Generator for all independent choices with neighborhoods of a bipolar valued digraph:
 
.. note::
 
       * Initiate with U = self.singletons().
       * Yields [(independent choice, domnb, absnb, indnb)].
inner_prod(self, v1, v2)
Parameters: two choice characteristic vectors
Renders the inner product of two characteristic vetors.
intstab(self, choice)
Computes the independence degree of a choice.
irreflex(self, mat)
Puts diagonal entries of mat to valuationdomain['min']
isAsymmetricIndeterminate(self, Debug=False)
Checks the self.relation for assymmetric indeterminateness!!
 
.. warning::
 
    The reflexive links are ignored !!
isComplete(self, Debug=False)
checks the completeness property of self.relation by checking
for the absence of a link between two actions!!
 
.. warning::
 
    The reflexive links are ignored !!
isCyclic(self, Debug=False)
checks the cyclicity of self.relation by checking
for a reflexive loop in its transitive closure-
 
.. warning::
 
     self.relation is supposed to be irreflexive !
isIntegerValued(self, Debug=False)
Checks whether the decimal valuation of self is integer-valued
be using the as_integer_ratio() method of a Decimal 
giving a tuple (numerator,denominator). If denominator == 1, the
number is an integer.
isOutrankingDigraph(self, Comments=True, Debug=False)
Checks the outranking digraph characteristic condition (3.3).
 
relation[x][y] + relation[y][x)[y] >= 0.0
 
.. warning::
 
    The reflexive links are ignored and the valuation must be bipolar !!
isStrictOutrankingDigraph(self, Comments=True, Debug=False)
Checks the strict outranking digraph characteristic condition (3.1).
 
-(relation[x][y] + relation[y][x]) <= 0.0 , x != y
 
.. warning::
 
    The reflexive links are ignored and the valuation must be bipolar !!
isSymmetric(self, Comments=False)
True if symmetry degree == 1.0.
isTransitive(self, Comments=False)
True if transitivity degree == 1.0.
isWeaklyComplete(self, Debug=False)
checks the weakly completeness property of self.relation by checking
for the absence of a link between two actions!!
 
.. warning::
 
    The reflexive links are ignored !!
iterateRankingByChoosing(self, Odd=False, CoDual=False, Comments=True, Debug=False, Limited=None)
Renders a ranking by choosing result when progressively eliminating
all chordless (odd only) circuits with rising valuation cut levels.
 
Parameters
    CoDual = False (default)/True
    Limited = proportion (in [0,1]) * (max - med) valuationdomain
kChoices(self, A, k)
Renders all choices of length k from set A
matmult2(self, m, v)
Parameters: digraph relation and choice characteristic vector
matrix multiply vector by inner production
meanDegree(self)
Renders the mean degree of self.
!!! self.size must be set previously !!!
meanLength(self, Oriented=False)
Renders the (by default non-oriented) mean neighbourhoor depth of self.
!!! self.order must be set previously !!!
minimalChoices(self, S)
Generates all dominant or absorbent choices of a bipolar
valued digraph.
 
.. note:
 
   * Initiate with S = (actions, dict of dominant or absorbent closed neighborhoods)
   * See showMinDom and showMinAbs methods.
minimalValuationLevelForCircuitsElimination(self, Odd=True, Debug=False, Comments=False)
renders the minimal valuation level <lambda> that eliminates all
self.circuitsList stored odd chordless circuits from self.
 
.. warning::
 
    The <lambda> level polarised may still contain newly appearing chordless odd circuits !
neighbourhoodCollection(self, Oriented=False, Potential=False)
Renders the neighbourhood.
neighbourhoodDepthDistribution(self, Oriented=False)
Renders the distribtion of neighbourhood depths.
notGammaSets(self)
Renders the dictionary of neighborhoods {node: (dx,ax)}
with set *dx* gathering the not dominated, and set *ax* gathering
the not absorbed neighborhood.
notaneighbors(self, node)
Renders the set of absorbed not in-neighbors of a node.
notdneighbors(self, node)
Renders the set of not dominated out-neighbors of a node.
outDegrees(self)
renders the median cut outdegrees
outDegreesDistribution(self)
Renders the distribution of outdegrees.
plusirredundant(self, U)
Generates all +irredundant choices of a digraph.
powerset(self, U)
Generates all subsets of a set.
readPerrinMisset(self, file='curd.dat')
read method for 0-1-char-coded MISs by default from the perrinMIS.c curd.dat result file.
readabsvector(self, x, relation)
Parameter: action x
absorbent in vector.
readdomvector(self, x, relation)
Parameter: action x
dominant out vector.
recodeValuation(self, newMin=-1.0, newMax=1.0, ndigits=4, Debug=False)
Recodes the characteristic valuation domain according
to the parameters given. 
 
*ndigits* indicates the number of decimal digits of the valuation.
relationFct(self, x, y)
wrapper for self.relation dictionary access to ensure interoperability
with the sparse and big outranking digraph implementation model.
save(self, fileName='tempdigraph', option=None, DecimalValuation=True, decDigits=2)
Persistent storage of a Digraph class instance in the form of
a python source code file
saveCSV(self, fileName='tempdigraph', Normalized=False, Dual=False, Converse=False, Diagonal=False, Debug=False)
Persistent storage of a Digraph class instance in the form of
a csv file.
saveXMCDA2(self, fileName='temp', fileExt='xmcda2', Comments=True, relationName='R', relationType='binary', category='random', subcategory='valued', author='digraphs Module (RB)', reference='saved from Python', valuationType='standard', digits=2, servingD3=False)
save digraph in XMCDA 2.0 format. Deprecated now.
savedre(self, fileName='temp')
save digraph in nauty format.
sharp(self, x, y)
Paramaters: choice characteristic values.
Renders the sharpest of two characteristic values x and y.
sharpvec(self, v, w)
Paramaters: choice characteristic vectors.
Renders the sharpest of two characteristic vectors v and w.
showActions(self)
presentation methods for digraphs actions
showAttributes(self)
Prints out the attributes of self.
showAutomorphismGenerators(self)
Renders the generators of the automorphism group.
showBadChoices(self, Recompute=True)
Characteristic values for potentially bad choices.
showBestChoiceRecommendation(self, Verbose=False, Comments=True, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True)
Shows the RuBis best choice recommendation.
 
.. note::
 
    Computes by default the Rubis best choice recommendation on the corresponding strict (codual) outranking digraph.
 
    By default, with BrokenCocs=True, we brake all chordless circuits at their weakest determined ( abs(r(x>y)) + abs(r(y>x)) ) link.
 
    When BrokenCocs=False we proceed like follows:
 
    In case of chordless circuits, if supporting arcs are more credible
    than the reversed negating arcs, we collapse the circuits into hyper nodes.
    Inversely,  if supporting arcs are not more credible than the reversed negating arcs,
    we brake the circuits on their weakest arc.
 
Usage example:
 
>>> from outrankingDigraphs import *
>>> t = Random3ObjectivesPerformanceTableau(seed=5)
>>> g = BipolarOutrankingDigraph(t)
>>> g.showBestChoiceRecommendation()
***********************
RuBis Best Choice Recommendation (BCR)
(in decreasing order of determinateness)   
Credibility domain:  [-100.0, 100.0]
=== >> potential first choices
* choice              : ['a04', 'a14', 'a19', 'a20']
   independence        : 1.19
   dominance           : 4.76
   absorbency          : -59.52
   covering (%)        : 75.00
   determinateness (%) : 57.86
   - most credible action(s) = { 'a14': 23.81, 'a19': 11.90, 'a04': 2.38, 'a20': 1.19, }  
=== >> potential last choices 
* choice              : ['a03', 'a12', 'a17']
  independence        : 4.76
  dominance           : -76.19
  absorbency          : 4.76
  covering (%)        : 0.00
  determinateness (%) : 65.39
  - most credible action(s) = { 'a03': 38.10, 'a12': 13.10, 'a17': 4.76, }
Execution time: 0.024 seconds
*****************************
showChoiceVector(self, ch, choiceType='good', ChoiceVector=True)
Show procedure for annotated bipolar choices.
showChordlessCircuits(self, Recompute=False)
Show method for chordless circuits observed in a Digraph instance.
 
If previous computation is required, stores the detected circuits in self.circuitsList attribute.
showComponents(self)
Shows the list of connected components of the digraph instance.
showCorrelation(self, corr=None, ndigits=3)
Renders the valued ordinal correlation index, the crisp Kendall tau index and their epistemic determination degree.
showFirstChoiceRecommendation(self, Verbose=False, Comments=True, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True)
Shows the RuBis first choice recommendation.
 
.. note::
 
    Computes by default the Rubis first choice recommendation on the corresponding strict (codual) outranking digraph.
 
    By default, with BrokenCocs=True, we brake all chordless circuits at their weakest determined ( abs(r(x>y)) + abs(r(y>x)) ) link.
 
    When BrokenCocs=False we proceed like follows:
 
    In case of chordless circuits, if supporting arcs are more credible
    than the reversed negating arcs, we collapse the circuits into hyper nodes.
    Inversely,  if supporting arcs are not more credible than the reversed negating arcs,
    we brake the circuits on their weakest arc.
 
Usage example:
 
>>> from outrankingDigraphs import *
>>> t = Random3ObjectivesPerformanceTableau(seed=5)
>>> g = BipolarOutrankingDigraph(t)
>>> g.showFirstChoiceRecommendation()
***********************
RuBis First Choice Recommendation (BCR)
(in decreasing order of determinateness)   
Credibility domain:  [-100.0, 100.0]
=== >> potential first choices
* choice              : ['a04', 'a14', 'a19', 'a20']
   independence        : 1.19
   dominance           : 4.76
   absorbency          : -59.52
   covering (%)        : 75.00
   determinateness (%) : 57.86
   - most credible action(s) = { 'a14': 23.81, 'a19': 11.90, 'a04': 2.38, 'a20': 1.19, }  
=== >> potential last choices 
* choice              : ['a03', 'a12', 'a17']
  independence        : 4.76
  dominance           : -76.19
  absorbency          : 4.76
  covering (%)        : 0.00
  determinateness (%) : 65.39
  - most credible action(s) = { 'a03': 38.10, 'a12': 13.10, 'a17': 4.76, }
Execution time: 0.024 seconds
*****************************
showGoodChoices(self, Recompute=True)
Characteristic values for potentially good choices.
showHTMLBestChoiceRecommendation(self, pageTitle=None, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True, htmlFileName=None)
showHTMLRelationHeatmap(self, actionsList=None, rankingRule='NetFlows', colorLevels=7, tableTitle='Relation Heatmap', relationName='r(x S y)', ndigits=2, fromIndex=None, toIndex=None, htmlFileName=None)
Launches a browser window with the colored relation map of self.
 
See corresponding :py:class:`~digraphs.Digraph.showHTMLRelationMap` method.
 
The *colorLevels* parameter may be set to 3, 5, 7 (default) or 9.
 
When the *actionsList* parameter is *None* (default), the digraphs actions list may be ranked with the *rankingRule* parameter set to the 'Copeland' (default) or to the 'Netlows' ranking rule.
 
When the *htmlFileName* parameter is set to a string value 'xxx', a html file named 'xxx.html' will be generated in the current working directory. Otherwise, a temporary file named 'tmp*.html' will be generated there.
 
Example::
 
    >>> from outrankingDigraphs import *
    >>> t = RandomCBPerformanceTableau(numberOfActions=25,seed=1)
    >>> g = BipolarOutrankingDigraph(t,ndigits=2)
    >>> gcd = ~(-g)  # strict outranking relation
    >>> gcd.showHTMLRelationHeatmap(colorLevels=7,ndigits=2)
    
.. image:: relationHeatmap.png
   :alt: Browser view of a relation map
   :width: 600 px
   :align: center
showHTMLRelationMap(self, actionsList=None, rankingRule='Copeland', Colored=True, tableTitle='Relation Map', relationName='r(x S y)', symbols=['+', '&middot;', '&nbsp;', '&#150;', '&#151'], fromIndex=None, toIndex=None, htmlFileName=None)
Launches a browser window with the colored relation map of self.
See corresponding Digraph.showRelationMap() method.
 
When *htmlFileName* parameter is set to a string value, a html file
with that name will be stored in the current working directory.
 
By default, a temporary file named: tmp*.html will be generated
instead in the current working directory.
 
Example::
 
    >>> from outrankingDigraphs import *
    >>> t = RandomCBPerformanceTableau(numberOfActions=25,seed=1)
    >>> g = BipolarOutrankingDigraph(t,Normalized=True)
    >>> gcd = ~(-g)  # strict outranking relation
    >>> gcd.showHTMLRelationMap(rankingRule="NetFlows")
    
.. image:: relationMap.png
   :alt: Browser view of a relation map
   :width: 600 px
   :align: center
showHTMLRelationTable(self, actionsList=None, relation=None, IntegerValues=False, ndigits=2, Colored=True, tableTitle='Valued Adjacency Matrix', relationName='r(x S y)', ReflexiveTerms=False, htmlFileName=None, fromIndex=None, toIndex=None)
Launches a browser window with the colored relation table of self.
showMIS(self, withListing=True)
Prints all maximal independent choices:
    Result in self.misset.
showMIS_AH(self, withListing=True)
Prints all MIS using the Hertz method.
 
Result saved in self.hertzmisset.
showMIS_HB2(self, withListing=True)
Prints all MIS using the Hertz-Bisdorff method.
 
Result saved in self.newmisset.
showMIS_RB(self, withListing=True)
Prints all MIS using the Bisdorff method.
 
Result saved in self.newmisset.
showMIS_UD(self, withListing=True)
Prints all MIS using the Hertz-Bisdorff method.
 
Result saved in self.newmisset.
showMaxAbsIrred(self, withListing=True)
Computing maximal -irredundant choices:
    Result in self.absirset.
showMaxDomIrred(self, withListing=True)
Computing maximal +irredundant choices:
   Result in self.domirset.
showMinAbs(self, withListing=True)
Prints minimal absorbent choices:
    Result in self.absset.
showMinDom(self, withListing=True)
Prints all minimal dominant choices:
    Result in self.domset.
showNeighborhoods(self)
Lists the gamma and the notGamma function of self.
showOrbits(self, InChoices, withListing=True)
Prints the orbits of Choices along the automorphisms of
the Digraph instance.
 
Example Python session for computing the non isomorphic MISs from the 12-cycle graph:
 
>>> from digraphs import *
>>> c12 = CirculantDigraph(order=12,circulants=[1,-1])
>>> c12.automorphismGenerators()
...
  Permutations
  {'1': '1', '2': '12', '3': '11', '4': '10', '5': 
   '9', '6': '8', '7': '7', '8': '6', '9': '5', '10': 
   '4', '11': '3', '12': '2'}
  {'1': '2', '2': '1', '3': '12', '4': '11', '5': '10', 
   '6': '9', '7': '8', '8': '7', '9': '6', '10': '5', 
   '11': '4', '12': '3'}
  Reflections {}
>>> print('grpsize = ', c12.automorphismGroupSize)
  grpsize = 24
>>> c12.showMIS(withListing=False)
  *---  Maximal independent choices ---*
  number of solutions:  29
  cardinality distribution
  card.:  [0, 1, 2, 3, 4,  5,  6, 7, 8, 9, 10, 11, 12]
  freq.:  [0, 0, 0, 0, 3, 24,  2, 0, 0, 0,  0,  0,  0]
  Results in c12.misset
>>> c12.showOrbits(c12.misset,withListing=False)
...
  *---- Global result ----
  Number of MIS:  29
  Number of orbits :  4
  Labelled representatives:
  1: ['2','4','6','8','10','12']
  2: ['2','5','8','11']
  3: ['2','4','6','9','11']
  4: ['1','4','7','9','11']
  Symmetry vector
  stabilizer size: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, ...]
  frequency      : [0, 2, 0, 0, 0, 0, 0, 1, 0,  0,  0,  1, ...]
 
*Figure*: The symmetry axes of the non isomorphic MISs of the 12-cycle:
 
.. image:: c12.png
   :width: 400 px
   :align: center
   :alt: The 4 non isomorphic MIS of the 12-cycle graph
 
*Reference*: R. Bisdorff and J.L. Marichal (2008). Counting non-isomorphic maximal independent sets of the n-cycle graph. *Journal of Integer Sequences*, Vol. 11 Article 08.5.7 (`openly accessible here <https://www.cs.uwaterloo.ca/journals/JIS/VOL11/Marichal/marichal.html>`_)
showOrbitsFromFile(self, InFile, withListing=True)
Prints the orbits of Choices along the automorphisms of
the digraph self by reading in the 0-1 misset file format.
See the :py:func:`digraphs.Digraph.readPerrinMisset` method.
showPreKernels(self, withListing=True)
Printing dominant and absorbent preKernels:
    Result in self.dompreKernels and self.abspreKernels
showRankingByBestChoosing(self, rankingByBestChoosing=None)
A show method for self.rankinByBestChoosing result.
 
.. warning::
 
     The self.computeRankingByBestChoosing(CoDual=False/True) method instantiating the self.rankingByBestChoosing slot is pre-required !
showRankingByChoosing(self, rankingByChoosing=None, WithCoverCredibility=False)
A show method for self.rankinByChoosing result.
 
When parameter *WithCoverCredibility* is set to True, the credibility of outranking, respectively being outranked is indicated at each selection step. 
 
.. warning::
 
     The self.computeRankingByChoosing(CoDual=False/True) method instantiating the self.rankingByChoosing slot is pre-required !
showRankingByLastChoosing(self, rankingByLastChoosing=None, Debug=None)
A show method for self.rankinByChoosing result.
 
.. warning::
 
     The self.computeRankingByLastChoosing(CoDual=False/True) method instantiating the self.rankingByChoosing slot is pre-required !
showRelation(self)
prints the relation valuation in ##.## format.
showRelationMap(self, symbols=None, rankingRule='Copeland', fromIndex=None, toIndex=None, actionsList=None)
Prints on the console, in text map format, the location of
certainly validated and certainly invalidated outranking situations.
 
By default, symbols = {'max':'┬','positive': '+', 'median': ' ',
                       'negative': '-', 'min': '┴'}
 
The default ordering of the output is following the Copeland ranking rule
from best to worst actions. Further available ranking rule is the 'NetFlows' net flows rule.
 
 
Example::
 
    >>> from outrankingDigraphs import *
    >>> t = RandomCBPerformanceTableau(numberOfActions=25,seed=1)
    >>> g = BipolarOutrankingDigraph(t,Normalized=True)
    >>> gcd = ~(-g)  # strict outranking relation
    >>> gcd.showRelationMap(rankingRule="NetFlows")
     -   ++++++++  +++++┬+┬┬+
    - -   + +++++ ++┬+┬+++┬++
    ┴+  ┴ + ++  ++++┬+┬┬++┬++
    -   ++ - ++++-++++++┬++┬+
       - - - ++- ┬- + -+┬+-┬┬
    -----  -      -┬┬┬-+  -┬┬
    ----    --+-+++++++++++++
    -- --+- --++ ++ +++-┬+-┬┬
    ----  -  -+-- ++--+++++ +
    ----- ++- --- +---++++┬ +
    -- -- ---+ -++-+++-+ +-++
    -- --┴---+  + +-++-+ -  +
    ---- ┴---+-- ++--++++ - +
      --┴┴--  --- -  --+ --┬┬
     ---------+--+ ----- +-┬┬
    -┴---┴- ---+- + ---+++┬ +
    -┴┴--┴---+--- ++ -++--+++
    -----┴--- ---+-+- ++---+ 
    -┴┴--------------- --++┬ 
    --┴---------------- --+┬ 
    ┴--┴┴ -┴--┴┴-┴ --++  ++-+
    ----┴┴--------------- -  
    ┴┴┴----+-┴+┴---┴-+---+ ┴+
    ┴┴-┴┴┴-┴- - -┴┴---┴┴+ ┬ -
    ----┴┴-┴-----┴┴---  - -- 
    Ranking rule: NetFlows
    >>>
showRelationTable(self, Sorted=True, rankingRule=None, IntegerValues=False, actionsSubset=None, relation=None, ndigits=2, ReflexiveTerms=True, fromIndex=None, toIndex=None)
Prints the relation valuation in actions X actions table format.
Copeland and NetFlows rankings my be used.
showRubisBestChoiceRecommendation(self, **kwargs)
Dummy for backward portable showBestChoiceRecommendation().
showRubyChoice(self, Verbose=False, Comments=True, _OldCoca=True)
Dummy for showBestChoiceRecommendation()
needed for older versions compatibility.
showShort(self)
concise presentation method for genuine digraphs.
showSingletonRanking(self, Comments=True, Debug=False)
Calls self.computeSingletonRanking(comments=True,Debug = False).
Renders and prints the sorted bipolar net determinatation of outrankingness
minus outrankedness credibilities of all singleton choices.
 
res = ((netdet,sigleton,dom,absorb)+)
showStatistics(self)
Computes digraph statistics like order, size and arc-density.
showdre(self)
Shows relation in nauty format.
singletons(self)
list of singletons and neighborhoods
[(singx1, +nx1, -nx1, not(+nx1 or -nx1)),.... ]
sizeSubGraph(self, choice)
Output: (size, undeterm,arcDensity).
Renders the arc density of the induced subgraph.
strongComponents(self, setPotential=False)
Renders the set of strong components of self.
symDegreesDistribution(self)
Renders the distribution of symmetric degrees.
topologicalSort(self, Debug=False)
If self is acyclic, adds topological sort number to each node of self
and renders ordered list of nodes. Otherwise renders None.
Source: M. Golumbic Algorithmic Graph heory and Perfect Graphs,
Annals Of Discrete Mathematics 57 2nd Ed. , Elsevier 2004, Algorithm 2.4 p.44.
weakAneighbors(self, node)
Renders the set of absorbed in-neighbors of a node.
weakCondorcetLosers(self)
Renders the set of decision actions x such that
self.relation[x][y] <= self.valuationdomain['med']
for all y != x.
weakCondorcetWinners(self)
Renders the set of decision actions x such that
self.relation[x][y] >= self.valuationdomain['med']
for all y != x.
weakDneighbors(self, node)
Renders the set of dominated out-neighbors of a node.
weakGammaSets(self)
Renders the dictionary of neighborhoods {node: (dx,ax)}
zoomValuation(self, zoomFactor=1.0)
Zooms in or out, depending on the value of the zoomFactor provided,
the bipolar valuation of a digraph.

Data descriptors inherited from Digraph:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class CirculantDigraph(Digraph)
    CirculantDigraph(order=7, valuationdomain={'min': Decimal('-1.0'), 'max': Decimal('1.0')}, circulants=[-1, 1], IndeterminateInnerPart=False)
 
Specialization of the general Digraph class for generating
temporary circulant digraphs.
 
Parameters:
    | order > 0;
    | valuationdomain ={'min':m, 'max':M};
    | circulant connections = list of positive
           and/or negative circular shifts of value 1 to n.
 
Default instantiation C_7:
    | order = 7,
    | valuationdomain = {'min':-1.0,'max':1.0},
    | circulants = [-1,1].
 
Example session::
 
    >>> from digraphs import CirculantDigraph
    >>> c8 = CirculantDigraph(order=8,circulants=[1,3])
    >>> c8.exportGraphViz('c8')
    *---- exporting a dot file for GraphViz tools ---------*
    Exporting to c8.dot
    circo -Tpng c8.dot -o c8.png
    # see below the graphviz drawing
    >>> c8.showChordlessCircuits()
    No circuits yet computed. Run computeChordlessCircuits()!
    >>> c8.computeChordlessCircuits()
    ...
    >>> c8.showChordlessCircuits()
    *---- Chordless circuits ----*
    ['1', '4', '7', '8'] , credibility : 1.0
    ['1', '4', '5', '6'] , credibility : 1.0
    ['1', '4', '5', '8'] , credibility : 1.0
    ['1', '2', '3', '6'] , credibility : 1.0
    ['1', '2', '5', '6'] , credibility : 1.0
    ['1', '2', '5', '8'] , credibility : 1.0
    ['2', '3', '6', '7'] , credibility : 1.0
    ['2', '3', '4', '7'] , credibility : 1.0
    ['2', '5', '6', '7'] , credibility : 1.0
    ['3', '6', '7', '8'] , credibility : 1.0
    ['3', '4', '7', '8'] , credibility : 1.0
    ['3', '4', '5', '8'] , credibility : 1.0
    12 circuits.
    >>>
    
.. image:: c8.png
    :alt: circulant [1,3] digraph
    :width: 300 px
    :align: center
 
 
Method resolution order:
CirculantDigraph
Digraph
builtins.object

Methods defined here:
__init__(self, order=7, valuationdomain={'min': Decimal('-1.0'), 'max': Decimal('1.0')}, circulants=[-1, 1], IndeterminateInnerPart=False)
Initialize self.  See help(type(self)) for accurate signature.
showShort(self)
concise presentation method for genuine digraphs.

Methods inherited from Digraph:
MISgen(self, S, I)
generator of maximal independent choices (voir Byskov 2004):
    * S ::= remaining nodes;
    * I ::= current independent choice
 
.. note::
 
        Inititalize: self.MISgen(self.actions.copy(),set())
__invert__(self)
Make the inverting operator ~self available for Digraph instances. 
 
Returns a ConverseDigraph instance of self.
__neg__(self)
Make the negation operator -self available for Digraph instances. 
 
Returns a DualDigraph instance of self.
__repr__(self)
Default presentation method for Digraph instances.
absirred(self, choice)
Renders the crips -irredundance degree of a choice.
absirredundant(self, U)
Generates all -irredundant choices of a digraph.
absirredval(self, choice, relation)
Renders the valued -irredundance degree of a choice.
absirredx(self, choice, x)
Computes the crips -irredundance degree of node x in a choice.
abskernelrestrict(self, prekernel)
Parameter: prekernel
Renders absorbent prekernel restricted relation.
absorb(self, choice)
Renders the absorbency degree of a choice.
absorbentChoices(self, S)
Generates all minimal absorbent choices of a bipolar valued digraph.
addValuationAttribute(self)
Adds the numpy valuation attribute
agglomerationDistribution(self)
Output: aggloCoeffDistribution, meanCoeff
Renders the distribution of agglomeration coefficients.
aneighbors(self, node)
Renders the set of absorbed in-neighbors of a node.
automorphismGenerators(self)
Adds automorphism group generators to the digraph instance.
 
.. note::
 
    Dependency: Uses the dreadnaut command from the nauty software package. See https://www3.cs.stonybrook.edu/~algorith/implement/nauty/implement.shtml
 
    On Ubuntu Linux:
      ...$ sudo apt-get install nauty
averageCoveringIndex(self, choice, direction='out')
Renders the average covering index of a given choice in a set of objects,
ie the average number of choice members that cover each
non selected object.
bipolarKCorrelation(self, digraph, Debug=False)
Renders the bipolar Kendall correlation between two bipolar valued
digraphs computed from the average valuation of the
XORDigraph(self,digraph) instance.
 
.. warning::
 
     Obsolete! Is replaced by the self.computeBipolarCorrelation(other) Digraph method
bipolarKDistance(self, digraph, Debug=False)
Renders the bipolar crisp Kendall distance between two bipolar valued
digraphs.
 
.. warning::
 
     Obsolete! Is replaced by the self.computeBipolarCorrelation(other, MedianCut=True) Digraph method
chordlessPaths(self, Pk, n2, Odd=False, Comments=False, Debug=False)
New procedure from Agrum study April 2009
recursive chordless path extraction starting from path
Pk = [n2, ...., n1] and ending in node n2.
Optimized with marking of visited chordless P1s.
circuitAverageCredibility(self, circ)
Renders the average linking credibility of a Chordless Circuit.
circuitCredibilities(self, circuit, Debug=False)
Renders the average linking credibilities and the minimal link of a Chordless Circuit.
circuitMaxCredibility(self, circ)
Renders the maximal linking credibility of a Chordless Circuit.
circuitMinCredibility(self, circ)
Renders the minimal linking credibility of a Chordless Circuit.
closeSymmetric(self, InSite=True)
Produces the symmetric closure of self.relation.
closeTransitive(self, Reverse=False, InSite=True, Comments=False)
Produces the transitive closure of self.relation
 
*Parameters*:
 
    - If *Reverse* == True (False default) all transitive links are dropped, otherwise all transitive links are closed with min[r(x,y),r(y,z)];
    - If *Insite* == False (True by default) the methods return a modified copy of self.relation without altering the original self.relation, otherwise self.relation is modified.
components(self)
Renders the list of connected components.
computeAllDensities(self, choice=None)
parameter: choice in self
renders six densitiy parameters:
arc density, double arc density,
single arc density, strict single arc density,
absence arc density, strict absence arc densitiy.
computeArrowRaynaudOrder(self)
Renders a linear ordering from worst to best of the actions following Arrow&Raynaud's rule.
computeArrowRaynaudRanking(self)
renders a linear ranking from best to worst of the actions following Arrow&Raynaud's rule.
computeAverageValuation(self)
Computes the bipolar average correlation between
self and the crisp complete digraph of same order
of the irreflexive and determined arcs of the digraph
computeBadChoices(self, Comments=False)
Computes characteristic values for potentially bad choices.
 
.. note::
 
     Returns a tuple with following content:
 
     [(0)-determ,(1)degirred,(2)degi,(3)degd,(4)dega,(5)str(choice),(6)absvec]
computeBadPirlotChoices(self, Comments=False)
Characteristic values for potentially bad choices
using the Pirlot's fixpoint algorithm.
computeBestChoiceRecommendation(self, Verbose=False, Comments=False, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True)
Sets self.bestChoice, self.bestChoiceData, self.worstChoice and self.worstChoiceData
with the showBestChoiceRecommendation method.
 
First and last choices data is the following:
[(0)-determ,(1)degirred,(2)degi,(3)degd,(4)dega,(5)str(choice),(6)domvec,(7)cover]
 
self.bestChoice = self.bestChoiceData[5]
self.worstChoice = self.worstChoiceData[5]
computeBipolarCorrelation(self, other, MedianCut=False, filterRelation=None, Debug=False)
obsolete: dummy replacement for Digraph.computeOrdinalCorrelation method
computeChordlessCircuits(self, Odd=False, Comments=False, Debug=False)
Renders the set of all chordless circuits detected in a digraph.
Result is stored in <self.circuitsList>
holding a possibly empty list of tuples with at position 0 the
list of adjacent actions of the circuit and at position 1
the set of actions in the stored circuit.
 
When *Odd* is True, only chordless circuits with an odd length
are collected.
computeChordlessCircuitsMP(self, Odd=False, Threading=False, nbrOfCPUs=None, startMethod=None, Comments=False, Debug=False)
Multiprocessing version of computeChordlessCircuits().
 
Renders the set of all chordless odd circuits detected in a digraph.
Result (possible empty list) stored in <self.circuitsList>
holding a possibly empty list tuples with at position 0 the
list of adjacent actions of the circuit and at position 1
the set of actions in the stored circuit.
Inspired by Dias, Castonguay, Longo, Jradi, Algorithmica (2015).
 
Returns a possibly empty list of tuples (circuit,frozenset(circuit)).
 
If Odd == True, only circuits of odd length are retained in the result.
computeCoSize(self)
Renders the number of non validated non reflexive arcs
computeConcentrationIndex(self, X, N)
Renders the Gini concentration index of the X serie.
N contains the partial frequencies.
Based on the triangle summation formula.
computeConcentrationIndexTrapez(self, X, N)
Renders the Gini concentration index of the X serie.
N contains the partial frequencies.
Based on the triangles summation formula.
computeCondorcetLosers(self)
Wrapper for condorcetLosers().
computeCondorcetWinners(self)
Wrapper for condorcetWinners().
computeCopelandOrder(self)
renders a linear ordering from worst to best of the actions following Arrow&Raynaud's rule.
computeCopelandRanking(self)
renders a linear ranking from best to worst of the actions following Arrow&Raynaud's rule.
computeCutLevelDensities(self, choice, level)
parameter: choice in self, robustness level
renders three robust densitiy parameters:
robust double arc density,
robust single arc density,
robust absence arc densitiy.
computeDensities(self, choice)
parameter: choice in self
renders the four densitiy parameters:
arc density, double arc density, single arc density, absence arc density.
computeDeterminateness(self, InPercents=False)
Computes the Kendalll distance of self
with the all median-valued indeterminate digraph of order n.
 
Return the average determination of the irreflexive part of the digraph.
 
*determination* = sum_(x,y) { abs[ r(xRy) - Med ] } / n(n-1)
 
If *InPercents* is True, returns the average determination in percentage of
(Max - Med) difference.
 
>>> from outrankingDigraphs import BipolarOutrankingDigraph
>>> from randomPerfTabs import Random3ObjectivesPerformanceTableau
>>> t = Random3ObjectivesPerformanceTableau(numberOfActions=7,numberOfCriteria=7,seed=101)
>>> g = BipolarOutrankingDigraph(t,Normalized=True)
>>> g
*------- Object instance description ------*
Instance class      : BipolarOutrankingDigraph
Instance name       : rel_random3ObjectivesPerfTab
Actions             : 7
Criteria            : 7
Size                : 27
Determinateness (%) : 65.67
Valuation domain    : [-1.00;1.00]
>>> print(g.computeDeterminateness())
0.3134920634920634920634920638
>>> print(g.computeDeterminateness(InPercents=True))
65.67460317460317460317460320
>>> g.recodeValuation(0,1)
>>> g
*------- Object instance description ------*
Instance class      : BipolarOutrankingDigraph
Instance name       : rel_random3ObjectivesPerfTab
Actions             : 7
Criteria            : 7
Size                : 27
Determinateness (%) : 65.67
Valuation domain    : [0.00;1.00]
>>> print(g.computeDeterminateness())
0.1567460317460317460317460318
>>> print(g.computeDeterminateness(InPercents=True))
65.67460317460317460317460320
computeDiameter(self, Oriented=True)
Renders the (by default oriented) diameter of the digraph instance
computeDigraphCentres(self, WeakDistances=False, Comments=False)
The centers of a digraph are the nodes with finite minimal shortes path lengths.
 
The maximal neighborhood distances are stored in *self.maximalNeighborhoodDistances*.
 
The corresponding digraph radius and diameter are stored respectively  in *self.radius* and *self.diameter*.
 
With *Comments* = True, all these results are printed out.
 
*Source*: Claude Berge, *The Theory of Graphs*, Dover (2001) pp. 119, original in French Dunod (1958)
computeDynamicProgrammingStages(self, source, sink, Debug=False)
Renders the discrete stages of the optimal substructure for
dynamic pogramming digrahs from a given source node 
to a given sink sink node.
 
Returns a list of list of action identifyers.
computeGoodChoiceVector(self, ker, Comments=False)
| Computing Characteristic values for dominant pre-kernels
| using the von Neumann dual fixoint equation
computeGoodChoices(self, Comments=False)
Computes characteristic values for potentially good choices.
 
..note::
 
     Return a tuple with following content:
 
     [(0)-determ,(1)degirred,(2)degi,(3)degd,(4)dega,(5)str(choice),(6)domvec,(7)cover]
computeGoodPirlotChoices(self, Comments=False)
Characteristic values for potentially good choices
using the Pirlot fixpoint algorithm.
computeIncomparabilityDegree(self, InPercents=False, Comments=False)
Renders the incomparability degree (Decimal), i.e. the relative number of symmetric indeterminate relations of the irreflexive part of a digraph.
computeKemenyIndex(self, otherRelation)
renders the Kemeny index of the self.relation
compared with a given crisp valued relation of a compatible
other digraph (same nodes or actions).
computeKemenyOrder(self, orderLimit=7, Debug=False)
Renders a ordering from worst to best of the actions with maximal Kemeny index.
Return a tuple: kemenyOrder (from worst to best), kemenyIndex
computeKemenyRanking(self, orderLimit=7, seed=None, sampleSize=1000, Debug=False)
Renders a ranking from best to worst of the actions with maximal Kemeny index.
 
.. note::
 
     Returns a tuple: kemenyRanking (from best to worst), kemenyIndex.
computeKernelVector(self, kernel, Initial=True, Comments=False)
| Computing Characteristic values for dominant pre-kernels
| using the von Neumann dual fixpoint equation
computeKohlerOrder(self)
Renders an ordering (worst to best) of the actions following Kohler's rule.
computeKohlerRanking(self)
Renders a ranking (best to worst) of the actions following Kohler's rule.
computeMaxHoleSize(self, Comments=False)
Renders the length of the largest chordless cycle
in the corresponding disjunctive undirected graph.
computeMeanInDegree(self)
Renders the mean indegree of self.
!!! self.size must be set previously !!!
computeMeanOutDegree(self)
Renders the mean degree of self.
!!! self.size must be set previously !!!
computeMeanSymDegree(self)
Renders the mean degree of self.
!!! self.size must be set previously !!!
computeMedianOutDegree(self)
Renders the median outdegree of self.
!!! self.size must be set previously !!!
computeMedianSymDegree(self)
Renders the median symmetric degree of self.
!!! self.size must be set previously !!!
computeMoreOrLessUnrelatedPairs(self)
Renders a list of more or less unrelated pairs.
computeNetFlowsOrder(self)
Renders an ordered list (from best to worst) of the actions
following the net flows ranking rule.
computeNetFlowsOrderDict(self)
Renders an ordered list (from worst to best) of the actions
following the net flows ranking rule.
computeNetFlowsRanking(self)
Renders an ordered list (from best to worst) of the actions
following the net flows ranking rule.
computeNetFlowsRankingDict(self)
Renders an ordered list (from best to worst) of the actions
following the net flows ranking rule.
computeODistance(self, op2, comments=False)
renders the squared normalized distance of
two digraph valuations.
 
.. note::
 
     op2 = digraphs of same order as self.
computeOrbit(self, choice, withListing=False)
renders the set of isomorph copies of a choice following
the automorphism of the digraph self
computeOrderCorrelation(self, order, Debug=False)
Renders the ordinal correlation K of a digraph instance
when compared with a given linear order (from worst to best) of its actions
 
K = sum_{x != y} [ min( max(-self.relation(x,y)),other.relation(x,y), max(self.relation(x,y),-other.relation(x,y)) ]
 
K /= sum_{x!=y} [ min(abs(self.relation(x,y),abs(other.relation(x,y)) ]
 
.. note::
 
     Renders a dictionary with the key 'correlation' containing the actual bipolar correlation index and the key 'determination' containing the minimal determination level D of self and the other relation.
 
     D = sum_{x != y} min(abs(self.relation(x,y)),abs(other.relation(x,y)) / n(n-1)
 
     where n is the number of actions considered.
 
     The correlation index with a completely indeterminate relation
     is by convention 0.0 at determination level 0.0 .
 
.. warning::
 
     self must be a normalized outranking digraph instance !
computeOrdinalCorrelation(self, other, MedianCut=False, filterRelation=None, Debug=False)
Renders the bipolar correlation K of a
self.relation when compared
with a given compatible (same actions set)) digraph or
a [-1,1] valued compatible relation (same actions set).
 
If MedianCut=True, the correlation is computed on the median polarized relations.
 
If filterRelation is not None, the correlation is computed on the partial domain corresponding to the determined part of the filter relation.
 
.. warning::
 
     Notice that the 'other' relation and/or the 'filterRelation',
     the case given, must both be normalized, ie [-1,1]-valued !
 
K = sum_{x != y} [ min( max(-self.relation[x][y]),other.relation[x][y]), max(self.relation[x][y],-other.relation[x][y]) ]
 
K /= sum_{x!=y} [ min(abs(self.relation[x][y]),abs(other.relation[x][y])) ]
 
.. note::
 
     Renders a tuple with at position 0 the actual bipolar correlation index
     and in position 1 the minimal determination level D of self and
     the other relation.
 
     D = sum_{x != y} min(abs(self.relation[x][y]),abs(other.relation[x][y])) / n(n-1)
 
     where n is the number of actions considered.
 
     The correlation index with a completely indeterminate relation
     is by convention 0.0 at determination level 0.0 .
computeOrdinalCorrelationMP(self, other, MedianCut=False, Threading=False, nbrOfCPUs=None, startMethod=None, Comments=False, Debug=False)
Multi processing version of the digraphs.computeOrdinalCorrelation() method.
 
.. note::
     The relation filtering and the MedinaCut option are not implemented in the MP version.
computePairwiseClusterComparison(self, K1, K2, Debug=False)
Computes the pairwise cluster comparison credibility vector
from bipolar-valued digraph g. with K1 and K2 disjoint
lists of action keys from g actions disctionary.
Returns the dictionary
{'I': Decimal(),'P+':Decimal(),'P-':Decimal(),'R' :Decimal()}
where one and only one item is strictly positive.
computePreKernels(self)
computing dominant and absorbent preKernels:
    Result in self.dompreKernels and self.abspreKernels
computePreRankingRelation(self, preRanking, Normalized=True, Debug=False)
Renders the bipolar-valued relation obtained from
a given preRanking in decreasing levels (list of lists) result.
computePreorderRelation(self, preorder, Normalized=True, Debug=False)
Renders the bipolar-valued relation obtained from
a given preordering in increasing levels (list of lists) result.
computePrincipalOrder(self, Colwise=False, Comments=False)
Rendesr an ordering from wrost to best of the decision actions.
computePrincipalRanking(self, Colwise=False, Comments=False)
Rendesr a ranking from best to worst of the decision actions.
computePrincipalScores(self, plotFileName=None, Colwise=False, imageType=None, tempDir=None, bgcolor='cornsilk', Comments=False, Debug=False)
Renders a ordered list of the first principal eigenvector of the covariance of the valued outdegrees of self.
 
.. note::
 
   The method, relying on writing and reading temporary files by default in a temporary directory is threading and multiprocessing safe !
   (see Digraph.exportPrincipalImage method)
computePrudentBetaLevel(self, Debug=False)
computes alpha, ie the lowest valuation level, for which the
bipolarly polarised digraph doesn't contain a chordless circuit.
computeRankingByBestChoosing(self, CoDual=False, Debug=False)
Computes a weak preordering of the self.actions by recursive
best choice elagations.
 
Stores in self.rankingByBestChoosing['result'] a list of (P+,bestChoice) tuples
where P+ gives the best choice complement outranking
average valuation via the computePairwiseClusterComparison
method.
 
If self.rankingByBestChoosing['CoDual'] is True, 
the ranking-by-choosing was computed on the codual of self.
computeRankingByBestChoosingRelation(self, rankingByBestChoosing=None, Debug=False)
Renders the bipolar-valued relation obtained from
the self.rankingByBestChoosing result.
computeRankingByChoosing(self, actionsSubset=None, Debug=False, CoDual=False)
Computes a weak preordring of the self.actions by iterating
jointly first and last choice elagations.
 
Stores in self.rankingByChoosing['result'] a list of ((P+,bestChoice),(P-,worstChoice)) pairs
where P+ (resp. P-) gives the best (resp. worst) choice complement outranking
(resp. outranked) average valuation via the computePairwiseClusterComparison
method.
 
If self.rankingByChoosing['CoDual'] is True, the ranking-by-choosing was computed on the codual of self.
computeRankingByChoosingRelation(self, rankingByChoosing=None, actionsSubset=None, Debug=False)
Renders the bipolar-valued relation obtained from
the self.rankingByChoosing result.
computeRankingByLastChoosing(self, CoDual=False, Debug=False)
Computes a weak preordring of the self.actions by iterating
worst choice elagations.
 
Stores in self.rankingByLastChoosing['result'] a list of (P-,worstChoice) pairs
where P- gives the worst choice complement outranked
average valuation via the computePairwiseClusterComparison
method.
 
If self.rankingByChoosing['CoDual'] is True, the ranking-by-last-chossing 
was computed on the codual of self.
computeRankingByLastChoosingRelation(self, rankingByLastChoosing=None, Debug=False)
Renders the bipolar-valued relation obtained from
the self.rankingByLastChoosing result.
computeRankingCorrelation(self, ranking, Debug=False)
Renders the ordinal correlation K of a digraph instance
when compared with a given linear ranking of its actions
 
K = sum_{x != y} [ min( max(-self.relation(x,y)),other.relation(x,y), max(self.relation(x,y),-other.relation(x,y)) ]
 
K /= sum_{x!=y} [ min(abs(self.relation(x,y),abs(other.relation(x,y)) ]
 
.. note::
 
     Renders a tuple with at position 0 the actual bipolar correlation index
     and in position 1 the minimal determination level D of self and
     the other relation.
 
     D = sum_{x != y} min(abs(self.relation(x,y)),abs(other.relation(x,y)) / n(n-1)
 
     where n is the number of actions considered.
 
     The correlation index with a completely indeterminate relation
     is by convention 0.0 at determination level 0.0 .
computeRelationalStructure(self, Debug=False)
Renders the counted decomposition of the valued relations into
the following type of links:
gt '>', eq '=', lt '<', incomp '<>',
leq '<=', geq '>=', indeterm '?'
computeRubisChoice(self, Comments=False, _OldCoca=False, BrokenCocs=True, Threading=False, nbrOfCPUs=1)
Renders self.strictGoodChoices, self.nullChoices
self.strictBadChoices, self.nonRobustChoices.
 
.. warning::
    Changes in site the outranking digraph by
    adding or braking chordless odd outranking circuits.
computeRubyChoice(self, Comments=False, _OldCoca=False)
dummy for computeRubisChoice()
old versions compatibility.
computeShortestPathLengths(self, WeakPaths=False, Comments=False, Debug=False)
Renders a double dictionary with the directed distances, i.e. the shortest path lengths between all self.actions
 
Equals *None* if there does not exist a directed path between two actions.
 
*Source*: Claude Berge, *The Theory of Graphs*, Dover (2001) pp. 119, original in French Dunod (1958)
computeSingletonRanking(self, Comments=False, Debug=False)
Renders the sorted bipolar net determinatation of outrankingness
minus outrankedness credibilities of all singleton choices.
 
res = ((netdet,singleton,dom,absorb)+)
computeSize(self)
Renders the number of validated non reflexive arcs
computeSizeTransitiveClosure(self)
Renders the size of the transitive closure of a digraph.
computeSlaterOrder(self, isProbabilistic=False, seed=None, sampleSize=1000, Debug=False)
Reversed return from computeSlaterRanking method.
computeSlaterRanking(self, isProbabilistic=False, seed=None, sampleSize=1000, Debug=False)
Renders a ranking of the actions with minimal Slater index.
Return a tuple: slaterOrder, slaterIndex
computeSymmetryDegree(self, InPercents=False, Comments=False)
Renders the symmetry degree (Decimal) of the irreflexive part of a digraph.
 
.. note::
 
   Empty and indeterminate digraphs are considered to be symmetric.
computeTopologicalRanking(self, Debug=False)
Mimetic Wrapper of the topologicalSort() method.
computeTransitivityDegree(self, InPercents=False, Comments=False)
Renders the transitivity degree (Decimal) of a digraph.
 
.. note:: 
 
   An empty or indeterminate digraph is considered to be transitive.
computeUnrelatedPairs(self)
Renders a list of more or less unrelated pairs.
computeValuationLevels(self, choice=None, Debug=False)
renders the symmetric closure of the
apparent valuations levels of self
in an increasingly ordered list.
If parameter choice is given, the
computation is limited to the actions
of the choice.
computeValuationPercentages(self, choice, percentiles, withValues=False)
Parameters: choice and list of percentiles.
renders a series of percentages of the characteristics valuation of
the arcs in the digraph.
computeValuationPercentiles(self, choice, percentages, withValues=False)
Parameters: choice and list of percentages.
renders a series of quantiles of the characteristics valuation of
the arcs in the digraph.
computeValuationStatistics(self, Sampling=False, Comments=False)
Renders the mean and variance of the valuation
of the non reflexive pairs.
computeValuedRankingRelation(self, ranking)
Renders the valued relation characteristics compatible 
with the given linar ranking. Discordant charcateristics 
are set to the indeterminate value.
computeWeakCondorcetLosers(self)
Wrapper for weakCondorcetLosers().
computeWeakCondorcetWinners(self)
Wrapper for weakCondorcetWinners().
computeupdown1(self, s, S)
Help method for show_MIS_HB2 method.
fills self.newmisset, self.upmis, self.downmis.
computeupdown2(self, s, S)
Help method for show_MIS_HB1 method.
Fills self.newmisset, self.upmis, self.downmis.
computeupdown2irred(self, s, S)
Help method for show_MIS_HB1 method.
Fills self.newmisset, self.upmis, self.downmis.
condorcetLosers(self)
Renders the set of decision actions x such that
self.relation[x][y] < self.valuationdomain['med']
for all y != x.
condorcetWinners(self)
Renders the set of decision actions x such that
self.relation[x][y] > self.valuationdomain['med']
for all y != x.
contra(self, v)
Parameter: choice.
Renders the negation of a choice v characteristic's vector.
convertRelationToDecimal(self)
Converts the float valued self.relation in a decimal valued one.
convertValuation2Integer(self, InSite=True, Comments=False)
Converts the self.relation valuation to integer values by converting the Decimals to Fractions and multiply by the least commun multiple of the fraction denominators.
 
*Parameters*:
 
    - If *Insite* == False (True by default) the method returns a modified copy of self.relation without altering the original self.relation, otherwise self.relation and self.valuationdomain is modified.
convertValuationToDecimal(self)
Convert the float valuation limits to Decimals.
coveringIndex(self, choice, direction='out')
Renders the covering index of a given choice in a set of objects,
ie the minimum number of choice members that cover each
non selected object.
crispKDistance(self, digraph, Debug=False)
Renders the crisp Kendall distance between two bipolar valued
digraphs.
 
.. warning::
 
     Obsolete! Is replaced by the self.computeBipolarCorrelation(other, MedianCut=True) Digraph method
detectChordlessCircuits(self, Comments=False, Debug=False)
Detects a chordless circuit in a digraph.
Returns a Boolean
detectChordlessPath(self, Pk, n2, Comments=False, Debug=False)
New procedure from Agrum study April 2009
recursive chordless path extraction starting from path
Pk = [n2, ...., n1] and ending in node n2.
Optimized with marking of visited chordless P1s.
determinateness(self, vec, inPercent=True)
Renders the determinateness of a characteristic vector *vec* = 
[(r(x),x),(r(y),y), ...] of length *n* in valuationdomain [Min,Med,Max]:
 
*result* =  sum_x( abs(r(x)-Med) ) / ( n*(Max-Med) )
 
If inPercent, *result* shifted (+1) and reduced (/2) to [0,1] range.
digraph2Graph(self, valuationDomain={'min': -1, 'med': 0, 'max': 1}, Debug=False, ConjunctiveConversion=True)
Convert a Digraph instance to a Graph instance.
dneighbors(self, node)
Renders the set of dominated out-neighbors of a node.
domin(self, choice)
Renders the dominance degree of a choice.
dominantChoices(self, S)
Generates all minimal dominant choices of a bipolar valued digraph.
 
.. note::
 
     Initiate with S = self.actions.copy().
domirred(self, choice)
Renders the crips +irredundance degree of a choice.
domirredval(self, choice, relation)
Renders the valued +irredundance degree of a choice.
domirredx(self, choice, x)
Renders the crips +irredundance degree of node x in a choice.
domkernelrestrict(self, prekernel)
Parameter: dominant prekernel
Renders dominant prekernel restricted relation.
exportGraphViz(self, fileName=None, actionsSubset=None, bestChoice=set(), worstChoice=set(), firstChoice=set(), lastChoice=set(), Comments=True, graphType='png', pictureFormat=None, graphSize='7,7', relation=None, bgcolor='cornsilk')
export GraphViz dot file  for graph drawing filtering.
exportPrincipalImage(self, plotFileName=None, pictureFormat='pdf', bgcolor='cornsilk', fontcolor='red3', fontsize='0.75', Reduced=False, Colwise=False, tempDir='.', Comments=False)
Export as PDF (default) the principal projection of
the valued relation using the three principal eigen vectors.
 
Implemeted picture formats are: 
'pdf' (default), 'png', 'jpeg' and 'xfig'.
 
The background color is set by default to 'cornsilk'. 
 
Font size and color are set by default to 'red3', resp. '0.75'. 
 
When *Reduced==True*, the valued relation characeteristics are centered and reduced.
 
When *Colwise==True*, the column vectors of the adjacency table are used for the principal projection, otherwise the rows (default) are used. Has no incidence when the *Digraph* instance *self*  is symmetric. 
 
.. warning::
 
    The method, writing and reading temporary files: 
    tempCol.r and rotationCol.csv, resp. tempRow.r and rotationRow.csv,
    by default in the working directory (./),
    is hence not safe for multiprocessing programs, unless a
    temporary directory *tempDir* is provided.
flatChoice(self, ch, Debug=False)
Converts set or list ch recursively to a flat list of items.
forcedBestSingleChoice(self)
Renders the set of most determined outranking singletons in self.
gammaSets(self)
Renders the dictionary of neighborhoods {node: (dx,ax)}
with set *dx* gathering the dominated, and set *ax* gathering
the absorbed neighborhood.
generateAbsPreKernels(self)
Generate all absorbent prekernels from independent choices generator.
generateDomPreKernels(self)
Generate all dominant prekernels from independent choices generator.
htmlChoiceVector(self, ch, ChoiceVector=True, choiceType='good')
Show procedure for annotated bipolar choices.
inDegrees(self)
renders the median cut indegrees
inDegreesDistribution(self)
Renders the distribution of indegrees.
independentChoices(self, U)
Generator for all independent choices with neighborhoods of a bipolar valued digraph:
 
.. note::
 
       * Initiate with U = self.singletons().
       * Yields [(independent choice, domnb, absnb, indnb)].
inner_prod(self, v1, v2)
Parameters: two choice characteristic vectors
Renders the inner product of two characteristic vetors.
intstab(self, choice)
Computes the independence degree of a choice.
irreflex(self, mat)
Puts diagonal entries of mat to valuationdomain['min']
isAsymmetricIndeterminate(self, Debug=False)
Checks the self.relation for assymmetric indeterminateness!!
 
.. warning::
 
    The reflexive links are ignored !!
isComplete(self, Debug=False)
checks the completeness property of self.relation by checking
for the absence of a link between two actions!!
 
.. warning::
 
    The reflexive links are ignored !!
isCyclic(self, Debug=False)
checks the cyclicity of self.relation by checking
for a reflexive loop in its transitive closure-
 
.. warning::
 
     self.relation is supposed to be irreflexive !
isIntegerValued(self, Debug=False)
Checks whether the decimal valuation of self is integer-valued
be using the as_integer_ratio() method of a Decimal 
giving a tuple (numerator,denominator). If denominator == 1, the
number is an integer.
isOutrankingDigraph(self, Comments=True, Debug=False)
Checks the outranking digraph characteristic condition (3.3).
 
relation[x][y] + relation[y][x)[y] >= 0.0
 
.. warning::
 
    The reflexive links are ignored and the valuation must be bipolar !!
isStrictOutrankingDigraph(self, Comments=True, Debug=False)
Checks the strict outranking digraph characteristic condition (3.1).
 
-(relation[x][y] + relation[y][x]) <= 0.0 , x != y
 
.. warning::
 
    The reflexive links are ignored and the valuation must be bipolar !!
isSymmetric(self, Comments=False)
True if symmetry degree == 1.0.
isTransitive(self, Comments=False)
True if transitivity degree == 1.0.
isWeaklyComplete(self, Debug=False)
checks the weakly completeness property of self.relation by checking
for the absence of a link between two actions!!
 
.. warning::
 
    The reflexive links are ignored !!
iterateRankingByChoosing(self, Odd=False, CoDual=False, Comments=True, Debug=False, Limited=None)
Renders a ranking by choosing result when progressively eliminating
all chordless (odd only) circuits with rising valuation cut levels.
 
Parameters
    CoDual = False (default)/True
    Limited = proportion (in [0,1]) * (max - med) valuationdomain
kChoices(self, A, k)
Renders all choices of length k from set A
matmult2(self, m, v)
Parameters: digraph relation and choice characteristic vector
matrix multiply vector by inner production
meanDegree(self)
Renders the mean degree of self.
!!! self.size must be set previously !!!
meanLength(self, Oriented=False)
Renders the (by default non-oriented) mean neighbourhoor depth of self.
!!! self.order must be set previously !!!
minimalChoices(self, S)
Generates all dominant or absorbent choices of a bipolar
valued digraph.
 
.. note:
 
   * Initiate with S = (actions, dict of dominant or absorbent closed neighborhoods)
   * See showMinDom and showMinAbs methods.
minimalValuationLevelForCircuitsElimination(self, Odd=True, Debug=False, Comments=False)
renders the minimal valuation level <lambda> that eliminates all
self.circuitsList stored odd chordless circuits from self.
 
.. warning::
 
    The <lambda> level polarised may still contain newly appearing chordless odd circuits !
neighbourhoodCollection(self, Oriented=False, Potential=False)
Renders the neighbourhood.
neighbourhoodDepthDistribution(self, Oriented=False)
Renders the distribtion of neighbourhood depths.
notGammaSets(self)
Renders the dictionary of neighborhoods {node: (dx,ax)}
with set *dx* gathering the not dominated, and set *ax* gathering
the not absorbed neighborhood.
notaneighbors(self, node)
Renders the set of absorbed not in-neighbors of a node.
notdneighbors(self, node)
Renders the set of not dominated out-neighbors of a node.
outDegrees(self)
renders the median cut outdegrees
outDegreesDistribution(self)
Renders the distribution of outdegrees.
plusirredundant(self, U)
Generates all +irredundant choices of a digraph.
powerset(self, U)
Generates all subsets of a set.
readPerrinMisset(self, file='curd.dat')
read method for 0-1-char-coded MISs by default from the perrinMIS.c curd.dat result file.
readabsvector(self, x, relation)
Parameter: action x
absorbent in vector.
readdomvector(self, x, relation)
Parameter: action x
dominant out vector.
recodeValuation(self, newMin=-1.0, newMax=1.0, ndigits=4, Debug=False)
Recodes the characteristic valuation domain according
to the parameters given. 
 
*ndigits* indicates the number of decimal digits of the valuation.
relationFct(self, x, y)
wrapper for self.relation dictionary access to ensure interoperability
with the sparse and big outranking digraph implementation model.
save(self, fileName='tempdigraph', option=None, DecimalValuation=True, decDigits=2)
Persistent storage of a Digraph class instance in the form of
a python source code file
saveCSV(self, fileName='tempdigraph', Normalized=False, Dual=False, Converse=False, Diagonal=False, Debug=False)
Persistent storage of a Digraph class instance in the form of
a csv file.
saveXMCDA2(self, fileName='temp', fileExt='xmcda2', Comments=True, relationName='R', relationType='binary', category='random', subcategory='valued', author='digraphs Module (RB)', reference='saved from Python', valuationType='standard', digits=2, servingD3=False)
save digraph in XMCDA 2.0 format. Deprecated now.
savedre(self, fileName='temp')
save digraph in nauty format.
sharp(self, x, y)
Paramaters: choice characteristic values.
Renders the sharpest of two characteristic values x and y.
sharpvec(self, v, w)
Paramaters: choice characteristic vectors.
Renders the sharpest of two characteristic vectors v and w.
showActions(self)
presentation methods for digraphs actions
showAll(self)
Detailed show method for genuine digraphs.
showAttributes(self)
Prints out the attributes of self.
showAutomorphismGenerators(self)
Renders the generators of the automorphism group.
showBadChoices(self, Recompute=True)
Characteristic values for potentially bad choices.
showBestChoiceRecommendation(self, Verbose=False, Comments=True, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True)
Shows the RuBis best choice recommendation.
 
.. note::
 
    Computes by default the Rubis best choice recommendation on the corresponding strict (codual) outranking digraph.
 
    By default, with BrokenCocs=True, we brake all chordless circuits at their weakest determined ( abs(r(x>y)) + abs(r(y>x)) ) link.
 
    When BrokenCocs=False we proceed like follows:
 
    In case of chordless circuits, if supporting arcs are more credible
    than the reversed negating arcs, we collapse the circuits into hyper nodes.
    Inversely,  if supporting arcs are not more credible than the reversed negating arcs,
    we brake the circuits on their weakest arc.
 
Usage example:
 
>>> from outrankingDigraphs import *
>>> t = Random3ObjectivesPerformanceTableau(seed=5)
>>> g = BipolarOutrankingDigraph(t)
>>> g.showBestChoiceRecommendation()
***********************
RuBis Best Choice Recommendation (BCR)
(in decreasing order of determinateness)   
Credibility domain:  [-100.0, 100.0]
=== >> potential first choices
* choice              : ['a04', 'a14', 'a19', 'a20']
   independence        : 1.19
   dominance           : 4.76
   absorbency          : -59.52
   covering (%)        : 75.00
   determinateness (%) : 57.86
   - most credible action(s) = { 'a14': 23.81, 'a19': 11.90, 'a04': 2.38, 'a20': 1.19, }  
=== >> potential last choices 
* choice              : ['a03', 'a12', 'a17']
  independence        : 4.76
  dominance           : -76.19
  absorbency          : 4.76
  covering (%)        : 0.00
  determinateness (%) : 65.39
  - most credible action(s) = { 'a03': 38.10, 'a12': 13.10, 'a17': 4.76, }
Execution time: 0.024 seconds
*****************************
showChoiceVector(self, ch, choiceType='good', ChoiceVector=True)
Show procedure for annotated bipolar choices.
showChordlessCircuits(self, Recompute=False)
Show method for chordless circuits observed in a Digraph instance.
 
If previous computation is required, stores the detected circuits in self.circuitsList attribute.
showComponents(self)
Shows the list of connected components of the digraph instance.
showCorrelation(self, corr=None, ndigits=3)
Renders the valued ordinal correlation index, the crisp Kendall tau index and their epistemic determination degree.
showFirstChoiceRecommendation(self, Verbose=False, Comments=True, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True)
Shows the RuBis first choice recommendation.
 
.. note::
 
    Computes by default the Rubis first choice recommendation on the corresponding strict (codual) outranking digraph.
 
    By default, with BrokenCocs=True, we brake all chordless circuits at their weakest determined ( abs(r(x>y)) + abs(r(y>x)) ) link.
 
    When BrokenCocs=False we proceed like follows:
 
    In case of chordless circuits, if supporting arcs are more credible
    than the reversed negating arcs, we collapse the circuits into hyper nodes.
    Inversely,  if supporting arcs are not more credible than the reversed negating arcs,
    we brake the circuits on their weakest arc.
 
Usage example:
 
>>> from outrankingDigraphs import *
>>> t = Random3ObjectivesPerformanceTableau(seed=5)
>>> g = BipolarOutrankingDigraph(t)
>>> g.showFirstChoiceRecommendation()
***********************
RuBis First Choice Recommendation (BCR)
(in decreasing order of determinateness)   
Credibility domain:  [-100.0, 100.0]
=== >> potential first choices
* choice              : ['a04', 'a14', 'a19', 'a20']
   independence        : 1.19
   dominance           : 4.76
   absorbency          : -59.52
   covering (%)        : 75.00
   determinateness (%) : 57.86
   - most credible action(s) = { 'a14': 23.81, 'a19': 11.90, 'a04': 2.38, 'a20': 1.19, }  
=== >> potential last choices 
* choice              : ['a03', 'a12', 'a17']
  independence        : 4.76
  dominance           : -76.19
  absorbency          : 4.76
  covering (%)        : 0.00
  determinateness (%) : 65.39
  - most credible action(s) = { 'a03': 38.10, 'a12': 13.10, 'a17': 4.76, }
Execution time: 0.024 seconds
*****************************
showGoodChoices(self, Recompute=True)
Characteristic values for potentially good choices.
showHTMLBestChoiceRecommendation(self, pageTitle=None, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True, htmlFileName=None)
showHTMLRelationHeatmap(self, actionsList=None, rankingRule='NetFlows', colorLevels=7, tableTitle='Relation Heatmap', relationName='r(x S y)', ndigits=2, fromIndex=None, toIndex=None, htmlFileName=None)
Launches a browser window with the colored relation map of self.
 
See corresponding :py:class:`~digraphs.Digraph.showHTMLRelationMap` method.
 
The *colorLevels* parameter may be set to 3, 5, 7 (default) or 9.
 
When the *actionsList* parameter is *None* (default), the digraphs actions list may be ranked with the *rankingRule* parameter set to the 'Copeland' (default) or to the 'Netlows' ranking rule.
 
When the *htmlFileName* parameter is set to a string value 'xxx', a html file named 'xxx.html' will be generated in the current working directory. Otherwise, a temporary file named 'tmp*.html' will be generated there.
 
Example::
 
    >>> from outrankingDigraphs import *
    >>> t = RandomCBPerformanceTableau(numberOfActions=25,seed=1)
    >>> g = BipolarOutrankingDigraph(t,ndigits=2)
    >>> gcd = ~(-g)  # strict outranking relation
    >>> gcd.showHTMLRelationHeatmap(colorLevels=7,ndigits=2)
    
.. image:: relationHeatmap.png
   :alt: Browser view of a relation map
   :width: 600 px
   :align: center
showHTMLRelationMap(self, actionsList=None, rankingRule='Copeland', Colored=True, tableTitle='Relation Map', relationName='r(x S y)', symbols=['+', '&middot;', '&nbsp;', '&#150;', '&#151'], fromIndex=None, toIndex=None, htmlFileName=None)
Launches a browser window with the colored relation map of self.
See corresponding Digraph.showRelationMap() method.
 
When *htmlFileName* parameter is set to a string value, a html file
with that name will be stored in the current working directory.
 
By default, a temporary file named: tmp*.html will be generated
instead in the current working directory.
 
Example::
 
    >>> from outrankingDigraphs import *
    >>> t = RandomCBPerformanceTableau(numberOfActions=25,seed=1)
    >>> g = BipolarOutrankingDigraph(t,Normalized=True)
    >>> gcd = ~(-g)  # strict outranking relation
    >>> gcd.showHTMLRelationMap(rankingRule="NetFlows")
    
.. image:: relationMap.png
   :alt: Browser view of a relation map
   :width: 600 px
   :align: center
showHTMLRelationTable(self, actionsList=None, relation=None, IntegerValues=False, ndigits=2, Colored=True, tableTitle='Valued Adjacency Matrix', relationName='r(x S y)', ReflexiveTerms=False, htmlFileName=None, fromIndex=None, toIndex=None)
Launches a browser window with the colored relation table of self.
showMIS(self, withListing=True)
Prints all maximal independent choices:
    Result in self.misset.
showMIS_AH(self, withListing=True)
Prints all MIS using the Hertz method.
 
Result saved in self.hertzmisset.
showMIS_HB2(self, withListing=True)
Prints all MIS using the Hertz-Bisdorff method.
 
Result saved in self.newmisset.
showMIS_RB(self, withListing=True)
Prints all MIS using the Bisdorff method.
 
Result saved in self.newmisset.
showMIS_UD(self, withListing=True)
Prints all MIS using the Hertz-Bisdorff method.
 
Result saved in self.newmisset.
showMaxAbsIrred(self, withListing=True)
Computing maximal -irredundant choices:
    Result in self.absirset.
showMaxDomIrred(self, withListing=True)
Computing maximal +irredundant choices:
   Result in self.domirset.
showMinAbs(self, withListing=True)
Prints minimal absorbent choices:
    Result in self.absset.
showMinDom(self, withListing=True)
Prints all minimal dominant choices:
    Result in self.domset.
showNeighborhoods(self)
Lists the gamma and the notGamma function of self.
showOrbits(self, InChoices, withListing=True)
Prints the orbits of Choices along the automorphisms of
the Digraph instance.
 
Example Python session for computing the non isomorphic MISs from the 12-cycle graph:
 
>>> from digraphs import *
>>> c12 = CirculantDigraph(order=12,circulants=[1,-1])
>>> c12.automorphismGenerators()
...
  Permutations
  {'1': '1', '2': '12', '3': '11', '4': '10', '5': 
   '9', '6': '8', '7': '7', '8': '6', '9': '5', '10': 
   '4', '11': '3', '12': '2'}
  {'1': '2', '2': '1', '3': '12', '4': '11', '5': '10', 
   '6': '9', '7': '8', '8': '7', '9': '6', '10': '5', 
   '11': '4', '12': '3'}
  Reflections {}
>>> print('grpsize = ', c12.automorphismGroupSize)
  grpsize = 24
>>> c12.showMIS(withListing=False)
  *---  Maximal independent choices ---*
  number of solutions:  29
  cardinality distribution
  card.:  [0, 1, 2, 3, 4,  5,  6, 7, 8, 9, 10, 11, 12]
  freq.:  [0, 0, 0, 0, 3, 24,  2, 0, 0, 0,  0,  0,  0]
  Results in c12.misset
>>> c12.showOrbits(c12.misset,withListing=False)
...
  *---- Global result ----
  Number of MIS:  29
  Number of orbits :  4
  Labelled representatives:
  1: ['2','4','6','8','10','12']
  2: ['2','5','8','11']
  3: ['2','4','6','9','11']
  4: ['1','4','7','9','11']
  Symmetry vector
  stabilizer size: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, ...]
  frequency      : [0, 2, 0, 0, 0, 0, 0, 1, 0,  0,  0,  1, ...]
 
*Figure*: The symmetry axes of the non isomorphic MISs of the 12-cycle:
 
.. image:: c12.png
   :width: 400 px
   :align: center
   :alt: The 4 non isomorphic MIS of the 12-cycle graph
 
*Reference*: R. Bisdorff and J.L. Marichal (2008). Counting non-isomorphic maximal independent sets of the n-cycle graph. *Journal of Integer Sequences*, Vol. 11 Article 08.5.7 (`openly accessible here <https://www.cs.uwaterloo.ca/journals/JIS/VOL11/Marichal/marichal.html>`_)
showOrbitsFromFile(self, InFile, withListing=True)
Prints the orbits of Choices along the automorphisms of
the digraph self by reading in the 0-1 misset file format.
See the :py:func:`digraphs.Digraph.readPerrinMisset` method.
showPreKernels(self, withListing=True)
Printing dominant and absorbent preKernels:
    Result in self.dompreKernels and self.abspreKernels
showRankingByBestChoosing(self, rankingByBestChoosing=None)
A show method for self.rankinByBestChoosing result.
 
.. warning::
 
     The self.computeRankingByBestChoosing(CoDual=False/True) method instantiating the self.rankingByBestChoosing slot is pre-required !
showRankingByChoosing(self, rankingByChoosing=None, WithCoverCredibility=False)
A show method for self.rankinByChoosing result.
 
When parameter *WithCoverCredibility* is set to True, the credibility of outranking, respectively being outranked is indicated at each selection step. 
 
.. warning::
 
     The self.computeRankingByChoosing(CoDual=False/True) method instantiating the self.rankingByChoosing slot is pre-required !
showRankingByLastChoosing(self, rankingByLastChoosing=None, Debug=None)
A show method for self.rankinByChoosing result.
 
.. warning::
 
     The self.computeRankingByLastChoosing(CoDual=False/True) method instantiating the self.rankingByChoosing slot is pre-required !
showRelation(self)
prints the relation valuation in ##.## format.
showRelationMap(self, symbols=None, rankingRule='Copeland', fromIndex=None, toIndex=None, actionsList=None)
Prints on the console, in text map format, the location of
certainly validated and certainly invalidated outranking situations.
 
By default, symbols = {'max':'┬','positive': '+', 'median': ' ',
                       'negative': '-', 'min': '┴'}
 
The default ordering of the output is following the Copeland ranking rule
from best to worst actions. Further available ranking rule is the 'NetFlows' net flows rule.
 
 
Example::
 
    >>> from outrankingDigraphs import *
    >>> t = RandomCBPerformanceTableau(numberOfActions=25,seed=1)
    >>> g = BipolarOutrankingDigraph(t,Normalized=True)
    >>> gcd = ~(-g)  # strict outranking relation
    >>> gcd.showRelationMap(rankingRule="NetFlows")
     -   ++++++++  +++++┬+┬┬+
    - -   + +++++ ++┬+┬+++┬++
    ┴+  ┴ + ++  ++++┬+┬┬++┬++
    -   ++ - ++++-++++++┬++┬+
       - - - ++- ┬- + -+┬+-┬┬
    -----  -      -┬┬┬-+  -┬┬
    ----    --+-+++++++++++++
    -- --+- --++ ++ +++-┬+-┬┬
    ----  -  -+-- ++--+++++ +
    ----- ++- --- +---++++┬ +
    -- -- ---+ -++-+++-+ +-++
    -- --┴---+  + +-++-+ -  +
    ---- ┴---+-- ++--++++ - +
      --┴┴--  --- -  --+ --┬┬
     ---------+--+ ----- +-┬┬
    -┴---┴- ---+- + ---+++┬ +
    -┴┴--┴---+--- ++ -++--+++
    -----┴--- ---+-+- ++---+ 
    -┴┴--------------- --++┬ 
    --┴---------------- --+┬ 
    ┴--┴┴ -┴--┴┴-┴ --++  ++-+
    ----┴┴--------------- -  
    ┴┴┴----+-┴+┴---┴-+---+ ┴+
    ┴┴-┴┴┴-┴- - -┴┴---┴┴+ ┬ -
    ----┴┴-┴-----┴┴---  - -- 
    Ranking rule: NetFlows
    >>>
showRelationTable(self, Sorted=True, rankingRule=None, IntegerValues=False, actionsSubset=None, relation=None, ndigits=2, ReflexiveTerms=True, fromIndex=None, toIndex=None)
Prints the relation valuation in actions X actions table format.
Copeland and NetFlows rankings my be used.
showRubisBestChoiceRecommendation(self, **kwargs)
Dummy for backward portable showBestChoiceRecommendation().
showRubyChoice(self, Verbose=False, Comments=True, _OldCoca=True)
Dummy for showBestChoiceRecommendation()
needed for older versions compatibility.
showSingletonRanking(self, Comments=True, Debug=False)
Calls self.computeSingletonRanking(comments=True,Debug = False).
Renders and prints the sorted bipolar net determinatation of outrankingness
minus outrankedness credibilities of all singleton choices.
 
res = ((netdet,sigleton,dom,absorb)+)
showStatistics(self)
Computes digraph statistics like order, size and arc-density.
showdre(self)
Shows relation in nauty format.
singletons(self)
list of singletons and neighborhoods
[(singx1, +nx1, -nx1, not(+nx1 or -nx1)),.... ]
sizeSubGraph(self, choice)
Output: (size, undeterm,arcDensity).
Renders the arc density of the induced subgraph.
strongComponents(self, setPotential=False)
Renders the set of strong components of self.
symDegreesDistribution(self)
Renders the distribution of symmetric degrees.
topologicalSort(self, Debug=False)
If self is acyclic, adds topological sort number to each node of self
and renders ordered list of nodes. Otherwise renders None.
Source: M. Golumbic Algorithmic Graph heory and Perfect Graphs,
Annals Of Discrete Mathematics 57 2nd Ed. , Elsevier 2004, Algorithm 2.4 p.44.
weakAneighbors(self, node)
Renders the set of absorbed in-neighbors of a node.
weakCondorcetLosers(self)
Renders the set of decision actions x such that
self.relation[x][y] <= self.valuationdomain['med']
for all y != x.
weakCondorcetWinners(self)
Renders the set of decision actions x such that
self.relation[x][y] >= self.valuationdomain['med']
for all y != x.
weakDneighbors(self, node)
Renders the set of dominated out-neighbors of a node.
weakGammaSets(self)
Renders the dictionary of neighborhoods {node: (dx,ax)}
zoomValuation(self, zoomFactor=1.0)
Zooms in or out, depending on the value of the zoomFactor provided,
the bipolar valuation of a digraph.

Data descriptors inherited from Digraph:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class CoDualDigraph(Digraph)
    CoDualDigraph(other, Debug=False)
 
Instantiates the associated codual -converse of the negation- from a deep copy of
a given Digraph instance called *other*.
 
.. note::
 
     Instantiates *self* as other.__class__ !
     And, deepcopies, the case given, the other.description, the other.criteria
     and the other.evaluation dictionaries into self.
 
 
Method resolution order:
CoDualDigraph
Digraph
builtins.object

Methods defined here:
__init__(self, other, Debug=False)
Initialize self.  See help(type(self)) for accurate signature.

Methods inherited from Digraph:
MISgen(self, S, I)
generator of maximal independent choices (voir Byskov 2004):
    * S ::= remaining nodes;
    * I ::= current independent choice
 
.. note::
 
        Inititalize: self.MISgen(self.actions.copy(),set())
__invert__(self)
Make the inverting operator ~self available for Digraph instances. 
 
Returns a ConverseDigraph instance of self.
__neg__(self)
Make the negation operator -self available for Digraph instances. 
 
Returns a DualDigraph instance of self.
__repr__(self)
Default presentation method for Digraph instances.
absirred(self, choice)
Renders the crips -irredundance degree of a choice.
absirredundant(self, U)
Generates all -irredundant choices of a digraph.
absirredval(self, choice, relation)
Renders the valued -irredundance degree of a choice.
absirredx(self, choice, x)
Computes the crips -irredundance degree of node x in a choice.
abskernelrestrict(self, prekernel)
Parameter: prekernel
Renders absorbent prekernel restricted relation.
absorb(self, choice)
Renders the absorbency degree of a choice.
absorbentChoices(self, S)
Generates all minimal absorbent choices of a bipolar valued digraph.
addValuationAttribute(self)
Adds the numpy valuation attribute
agglomerationDistribution(self)
Output: aggloCoeffDistribution, meanCoeff
Renders the distribution of agglomeration coefficients.
aneighbors(self, node)
Renders the set of absorbed in-neighbors of a node.
automorphismGenerators(self)
Adds automorphism group generators to the digraph instance.
 
.. note::
 
    Dependency: Uses the dreadnaut command from the nauty software package. See https://www3.cs.stonybrook.edu/~algorith/implement/nauty/implement.shtml
 
    On Ubuntu Linux:
      ...$ sudo apt-get install nauty
averageCoveringIndex(self, choice, direction='out')
Renders the average covering index of a given choice in a set of objects,
ie the average number of choice members that cover each
non selected object.
bipolarKCorrelation(self, digraph, Debug=False)
Renders the bipolar Kendall correlation between two bipolar valued
digraphs computed from the average valuation of the
XORDigraph(self,digraph) instance.
 
.. warning::
 
     Obsolete! Is replaced by the self.computeBipolarCorrelation(other) Digraph method
bipolarKDistance(self, digraph, Debug=False)
Renders the bipolar crisp Kendall distance between two bipolar valued
digraphs.
 
.. warning::
 
     Obsolete! Is replaced by the self.computeBipolarCorrelation(other, MedianCut=True) Digraph method
chordlessPaths(self, Pk, n2, Odd=False, Comments=False, Debug=False)
New procedure from Agrum study April 2009
recursive chordless path extraction starting from path
Pk = [n2, ...., n1] and ending in node n2.
Optimized with marking of visited chordless P1s.
circuitAverageCredibility(self, circ)
Renders the average linking credibility of a Chordless Circuit.
circuitCredibilities(self, circuit, Debug=False)
Renders the average linking credibilities and the minimal link of a Chordless Circuit.
circuitMaxCredibility(self, circ)
Renders the maximal linking credibility of a Chordless Circuit.
circuitMinCredibility(self, circ)
Renders the minimal linking credibility of a Chordless Circuit.
closeSymmetric(self, InSite=True)
Produces the symmetric closure of self.relation.
closeTransitive(self, Reverse=False, InSite=True, Comments=False)
Produces the transitive closure of self.relation
 
*Parameters*:
 
    - If *Reverse* == True (False default) all transitive links are dropped, otherwise all transitive links are closed with min[r(x,y),r(y,z)];
    - If *Insite* == False (True by default) the methods return a modified copy of self.relation without altering the original self.relation, otherwise self.relation is modified.
components(self)
Renders the list of connected components.
computeAllDensities(self, choice=None)
parameter: choice in self
renders six densitiy parameters:
arc density, double arc density,
single arc density, strict single arc density,
absence arc density, strict absence arc densitiy.
computeArrowRaynaudOrder(self)
Renders a linear ordering from worst to best of the actions following Arrow&Raynaud's rule.
computeArrowRaynaudRanking(self)
renders a linear ranking from best to worst of the actions following Arrow&Raynaud's rule.
computeAverageValuation(self)
Computes the bipolar average correlation between
self and the crisp complete digraph of same order
of the irreflexive and determined arcs of the digraph
computeBadChoices(self, Comments=False)
Computes characteristic values for potentially bad choices.
 
.. note::
 
     Returns a tuple with following content:
 
     [(0)-determ,(1)degirred,(2)degi,(3)degd,(4)dega,(5)str(choice),(6)absvec]
computeBadPirlotChoices(self, Comments=False)
Characteristic values for potentially bad choices
using the Pirlot's fixpoint algorithm.
computeBestChoiceRecommendation(self, Verbose=False, Comments=False, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True)
Sets self.bestChoice, self.bestChoiceData, self.worstChoice and self.worstChoiceData
with the showBestChoiceRecommendation method.
 
First and last choices data is the following:
[(0)-determ,(1)degirred,(2)degi,(3)degd,(4)dega,(5)str(choice),(6)domvec,(7)cover]
 
self.bestChoice = self.bestChoiceData[5]
self.worstChoice = self.worstChoiceData[5]
computeBipolarCorrelation(self, other, MedianCut=False, filterRelation=None, Debug=False)
obsolete: dummy replacement for Digraph.computeOrdinalCorrelation method
computeChordlessCircuits(self, Odd=False, Comments=False, Debug=False)
Renders the set of all chordless circuits detected in a digraph.
Result is stored in <self.circuitsList>
holding a possibly empty list of tuples with at position 0 the
list of adjacent actions of the circuit and at position 1
the set of actions in the stored circuit.
 
When *Odd* is True, only chordless circuits with an odd length
are collected.
computeChordlessCircuitsMP(self, Odd=False, Threading=False, nbrOfCPUs=None, startMethod=None, Comments=False, Debug=False)
Multiprocessing version of computeChordlessCircuits().
 
Renders the set of all chordless odd circuits detected in a digraph.
Result (possible empty list) stored in <self.circuitsList>
holding a possibly empty list tuples with at position 0 the
list of adjacent actions of the circuit and at position 1
the set of actions in the stored circuit.
Inspired by Dias, Castonguay, Longo, Jradi, Algorithmica (2015).
 
Returns a possibly empty list of tuples (circuit,frozenset(circuit)).
 
If Odd == True, only circuits of odd length are retained in the result.
computeCoSize(self)
Renders the number of non validated non reflexive arcs
computeConcentrationIndex(self, X, N)
Renders the Gini concentration index of the X serie.
N contains the partial frequencies.
Based on the triangle summation formula.
computeConcentrationIndexTrapez(self, X, N)
Renders the Gini concentration index of the X serie.
N contains the partial frequencies.
Based on the triangles summation formula.
computeCondorcetLosers(self)
Wrapper for condorcetLosers().
computeCondorcetWinners(self)
Wrapper for condorcetWinners().
computeCopelandOrder(self)
renders a linear ordering from worst to best of the actions following Arrow&Raynaud's rule.
computeCopelandRanking(self)
renders a linear ranking from best to worst of the actions following Arrow&Raynaud's rule.
computeCutLevelDensities(self, choice, level)
parameter: choice in self, robustness level
renders three robust densitiy parameters:
robust double arc density,
robust single arc density,
robust absence arc densitiy.
computeDensities(self, choice)
parameter: choice in self
renders the four densitiy parameters:
arc density, double arc density, single arc density, absence arc density.
computeDeterminateness(self, InPercents=False)
Computes the Kendalll distance of self
with the all median-valued indeterminate digraph of order n.
 
Return the average determination of the irreflexive part of the digraph.
 
*determination* = sum_(x,y) { abs[ r(xRy) - Med ] } / n(n-1)
 
If *InPercents* is True, returns the average determination in percentage of
(Max - Med) difference.
 
>>> from outrankingDigraphs import BipolarOutrankingDigraph
>>> from randomPerfTabs import Random3ObjectivesPerformanceTableau
>>> t = Random3ObjectivesPerformanceTableau(numberOfActions=7,numberOfCriteria=7,seed=101)
>>> g = BipolarOutrankingDigraph(t,Normalized=True)
>>> g
*------- Object instance description ------*
Instance class      : BipolarOutrankingDigraph
Instance name       : rel_random3ObjectivesPerfTab
Actions             : 7
Criteria            : 7
Size                : 27
Determinateness (%) : 65.67
Valuation domain    : [-1.00;1.00]
>>> print(g.computeDeterminateness())
0.3134920634920634920634920638
>>> print(g.computeDeterminateness(InPercents=True))
65.67460317460317460317460320
>>> g.recodeValuation(0,1)
>>> g
*------- Object instance description ------*
Instance class      : BipolarOutrankingDigraph
Instance name       : rel_random3ObjectivesPerfTab
Actions             : 7
Criteria            : 7
Size                : 27
Determinateness (%) : 65.67
Valuation domain    : [0.00;1.00]
>>> print(g.computeDeterminateness())
0.1567460317460317460317460318
>>> print(g.computeDeterminateness(InPercents=True))
65.67460317460317460317460320
computeDiameter(self, Oriented=True)
Renders the (by default oriented) diameter of the digraph instance
computeDigraphCentres(self, WeakDistances=False, Comments=False)
The centers of a digraph are the nodes with finite minimal shortes path lengths.
 
The maximal neighborhood distances are stored in *self.maximalNeighborhoodDistances*.
 
The corresponding digraph radius and diameter are stored respectively  in *self.radius* and *self.diameter*.
 
With *Comments* = True, all these results are printed out.
 
*Source*: Claude Berge, *The Theory of Graphs*, Dover (2001) pp. 119, original in French Dunod (1958)
computeDynamicProgrammingStages(self, source, sink, Debug=False)
Renders the discrete stages of the optimal substructure for
dynamic pogramming digrahs from a given source node 
to a given sink sink node.
 
Returns a list of list of action identifyers.
computeGoodChoiceVector(self, ker, Comments=False)
| Computing Characteristic values for dominant pre-kernels
| using the von Neumann dual fixoint equation
computeGoodChoices(self, Comments=False)
Computes characteristic values for potentially good choices.
 
..note::
 
     Return a tuple with following content:
 
     [(0)-determ,(1)degirred,(2)degi,(3)degd,(4)dega,(5)str(choice),(6)domvec,(7)cover]
computeGoodPirlotChoices(self, Comments=False)
Characteristic values for potentially good choices
using the Pirlot fixpoint algorithm.
computeIncomparabilityDegree(self, InPercents=False, Comments=False)
Renders the incomparability degree (Decimal), i.e. the relative number of symmetric indeterminate relations of the irreflexive part of a digraph.
computeKemenyIndex(self, otherRelation)
renders the Kemeny index of the self.relation
compared with a given crisp valued relation of a compatible
other digraph (same nodes or actions).
computeKemenyOrder(self, orderLimit=7, Debug=False)
Renders a ordering from worst to best of the actions with maximal Kemeny index.
Return a tuple: kemenyOrder (from worst to best), kemenyIndex
computeKemenyRanking(self, orderLimit=7, seed=None, sampleSize=1000, Debug=False)
Renders a ranking from best to worst of the actions with maximal Kemeny index.
 
.. note::
 
     Returns a tuple: kemenyRanking (from best to worst), kemenyIndex.
computeKernelVector(self, kernel, Initial=True, Comments=False)
| Computing Characteristic values for dominant pre-kernels
| using the von Neumann dual fixpoint equation
computeKohlerOrder(self)
Renders an ordering (worst to best) of the actions following Kohler's rule.
computeKohlerRanking(self)
Renders a ranking (best to worst) of the actions following Kohler's rule.
computeMaxHoleSize(self, Comments=False)
Renders the length of the largest chordless cycle
in the corresponding disjunctive undirected graph.
computeMeanInDegree(self)
Renders the mean indegree of self.
!!! self.size must be set previously !!!
computeMeanOutDegree(self)
Renders the mean degree of self.
!!! self.size must be set previously !!!
computeMeanSymDegree(self)
Renders the mean degree of self.
!!! self.size must be set previously !!!
computeMedianOutDegree(self)
Renders the median outdegree of self.
!!! self.size must be set previously !!!
computeMedianSymDegree(self)
Renders the median symmetric degree of self.
!!! self.size must be set previously !!!
computeMoreOrLessUnrelatedPairs(self)
Renders a list of more or less unrelated pairs.
computeNetFlowsOrder(self)
Renders an ordered list (from best to worst) of the actions
following the net flows ranking rule.
computeNetFlowsOrderDict(self)
Renders an ordered list (from worst to best) of the actions
following the net flows ranking rule.
computeNetFlowsRanking(self)
Renders an ordered list (from best to worst) of the actions
following the net flows ranking rule.
computeNetFlowsRankingDict(self)
Renders an ordered list (from best to worst) of the actions
following the net flows ranking rule.
computeODistance(self, op2, comments=False)
renders the squared normalized distance of
two digraph valuations.
 
.. note::
 
     op2 = digraphs of same order as self.
computeOrbit(self, choice, withListing=False)
renders the set of isomorph copies of a choice following
the automorphism of the digraph self
computeOrderCorrelation(self, order, Debug=False)
Renders the ordinal correlation K of a digraph instance
when compared with a given linear order (from worst to best) of its actions
 
K = sum_{x != y} [ min( max(-self.relation(x,y)),other.relation(x,y), max(self.relation(x,y),-other.relation(x,y)) ]
 
K /= sum_{x!=y} [ min(abs(self.relation(x,y),abs(other.relation(x,y)) ]
 
.. note::
 
     Renders a dictionary with the key 'correlation' containing the actual bipolar correlation index and the key 'determination' containing the minimal determination level D of self and the other relation.
 
     D = sum_{x != y} min(abs(self.relation(x,y)),abs(other.relation(x,y)) / n(n-1)
 
     where n is the number of actions considered.
 
     The correlation index with a completely indeterminate relation
     is by convention 0.0 at determination level 0.0 .
 
.. warning::
 
     self must be a normalized outranking digraph instance !
computeOrdinalCorrelation(self, other, MedianCut=False, filterRelation=None, Debug=False)
Renders the bipolar correlation K of a
self.relation when compared
with a given compatible (same actions set)) digraph or
a [-1,1] valued compatible relation (same actions set).
 
If MedianCut=True, the correlation is computed on the median polarized relations.
 
If filterRelation is not None, the correlation is computed on the partial domain corresponding to the determined part of the filter relation.
 
.. warning::
 
     Notice that the 'other' relation and/or the 'filterRelation',
     the case given, must both be normalized, ie [-1,1]-valued !
 
K = sum_{x != y} [ min( max(-self.relation[x][y]),other.relation[x][y]), max(self.relation[x][y],-other.relation[x][y]) ]
 
K /= sum_{x!=y} [ min(abs(self.relation[x][y]),abs(other.relation[x][y])) ]
 
.. note::
 
     Renders a tuple with at position 0 the actual bipolar correlation index
     and in position 1 the minimal determination level D of self and
     the other relation.
 
     D = sum_{x != y} min(abs(self.relation[x][y]),abs(other.relation[x][y])) / n(n-1)
 
     where n is the number of actions considered.
 
     The correlation index with a completely indeterminate relation
     is by convention 0.0 at determination level 0.0 .
computeOrdinalCorrelationMP(self, other, MedianCut=False, Threading=False, nbrOfCPUs=None, startMethod=None, Comments=False, Debug=False)
Multi processing version of the digraphs.computeOrdinalCorrelation() method.
 
.. note::
     The relation filtering and the MedinaCut option are not implemented in the MP version.
computePairwiseClusterComparison(self, K1, K2, Debug=False)
Computes the pairwise cluster comparison credibility vector
from bipolar-valued digraph g. with K1 and K2 disjoint
lists of action keys from g actions disctionary.
Returns the dictionary
{'I': Decimal(),'P+':Decimal(),'P-':Decimal(),'R' :Decimal()}
where one and only one item is strictly positive.
computePreKernels(self)
computing dominant and absorbent preKernels:
    Result in self.dompreKernels and self.abspreKernels
computePreRankingRelation(self, preRanking, Normalized=True, Debug=False)
Renders the bipolar-valued relation obtained from
a given preRanking in decreasing levels (list of lists) result.
computePreorderRelation(self, preorder, Normalized=True, Debug=False)
Renders the bipolar-valued relation obtained from
a given preordering in increasing levels (list of lists) result.
computePrincipalOrder(self, Colwise=False, Comments=False)
Rendesr an ordering from wrost to best of the decision actions.
computePrincipalRanking(self, Colwise=False, Comments=False)
Rendesr a ranking from best to worst of the decision actions.
computePrincipalScores(self, plotFileName=None, Colwise=False, imageType=None, tempDir=None, bgcolor='cornsilk', Comments=False, Debug=False)
Renders a ordered list of the first principal eigenvector of the covariance of the valued outdegrees of self.
 
.. note::
 
   The method, relying on writing and reading temporary files by default in a temporary directory is threading and multiprocessing safe !
   (see Digraph.exportPrincipalImage method)
computePrudentBetaLevel(self, Debug=False)
computes alpha, ie the lowest valuation level, for which the
bipolarly polarised digraph doesn't contain a chordless circuit.
computeRankingByBestChoosing(self, CoDual=False, Debug=False)
Computes a weak preordering of the self.actions by recursive
best choice elagations.
 
Stores in self.rankingByBestChoosing['result'] a list of (P+,bestChoice) tuples
where P+ gives the best choice complement outranking
average valuation via the computePairwiseClusterComparison
method.
 
If self.rankingByBestChoosing['CoDual'] is True, 
the ranking-by-choosing was computed on the codual of self.
computeRankingByBestChoosingRelation(self, rankingByBestChoosing=None, Debug=False)
Renders the bipolar-valued relation obtained from
the self.rankingByBestChoosing result.
computeRankingByChoosing(self, actionsSubset=None, Debug=False, CoDual=False)
Computes a weak preordring of the self.actions by iterating
jointly first and last choice elagations.
 
Stores in self.rankingByChoosing['result'] a list of ((P+,bestChoice),(P-,worstChoice)) pairs
where P+ (resp. P-) gives the best (resp. worst) choice complement outranking
(resp. outranked) average valuation via the computePairwiseClusterComparison
method.
 
If self.rankingByChoosing['CoDual'] is True, the ranking-by-choosing was computed on the codual of self.
computeRankingByChoosingRelation(self, rankingByChoosing=None, actionsSubset=None, Debug=False)
Renders the bipolar-valued relation obtained from
the self.rankingByChoosing result.
computeRankingByLastChoosing(self, CoDual=False, Debug=False)
Computes a weak preordring of the self.actions by iterating
worst choice elagations.
 
Stores in self.rankingByLastChoosing['result'] a list of (P-,worstChoice) pairs
where P- gives the worst choice complement outranked
average valuation via the computePairwiseClusterComparison
method.
 
If self.rankingByChoosing['CoDual'] is True, the ranking-by-last-chossing 
was computed on the codual of self.
computeRankingByLastChoosingRelation(self, rankingByLastChoosing=None, Debug=False)
Renders the bipolar-valued relation obtained from
the self.rankingByLastChoosing result.
computeRankingCorrelation(self, ranking, Debug=False)
Renders the ordinal correlation K of a digraph instance
when compared with a given linear ranking of its actions
 
K = sum_{x != y} [ min( max(-self.relation(x,y)),other.relation(x,y), max(self.relation(x,y),-other.relation(x,y)) ]
 
K /= sum_{x!=y} [ min(abs(self.relation(x,y),abs(other.relation(x,y)) ]
 
.. note::
 
     Renders a tuple with at position 0 the actual bipolar correlation index
     and in position 1 the minimal determination level D of self and
     the other relation.
 
     D = sum_{x != y} min(abs(self.relation(x,y)),abs(other.relation(x,y)) / n(n-1)
 
     where n is the number of actions considered.
 
     The correlation index with a completely indeterminate relation
     is by convention 0.0 at determination level 0.0 .
computeRelationalStructure(self, Debug=False)
Renders the counted decomposition of the valued relations into
the following type of links:
gt '>', eq '=', lt '<', incomp '<>',
leq '<=', geq '>=', indeterm '?'
computeRubisChoice(self, Comments=False, _OldCoca=False, BrokenCocs=True, Threading=False, nbrOfCPUs=1)
Renders self.strictGoodChoices, self.nullChoices
self.strictBadChoices, self.nonRobustChoices.
 
.. warning::
    Changes in site the outranking digraph by
    adding or braking chordless odd outranking circuits.
computeRubyChoice(self, Comments=False, _OldCoca=False)
dummy for computeRubisChoice()
old versions compatibility.
computeShortestPathLengths(self, WeakPaths=False, Comments=False, Debug=False)
Renders a double dictionary with the directed distances, i.e. the shortest path lengths between all self.actions
 
Equals *None* if there does not exist a directed path between two actions.
 
*Source*: Claude Berge, *The Theory of Graphs*, Dover (2001) pp. 119, original in French Dunod (1958)
computeSingletonRanking(self, Comments=False, Debug=False)
Renders the sorted bipolar net determinatation of outrankingness
minus outrankedness credibilities of all singleton choices.
 
res = ((netdet,singleton,dom,absorb)+)
computeSize(self)
Renders the number of validated non reflexive arcs
computeSizeTransitiveClosure(self)
Renders the size of the transitive closure of a digraph.
computeSlaterOrder(self, isProbabilistic=False, seed=None, sampleSize=1000, Debug=False)
Reversed return from computeSlaterRanking method.
computeSlaterRanking(self, isProbabilistic=False, seed=None, sampleSize=1000, Debug=False)
Renders a ranking of the actions with minimal Slater index.
Return a tuple: slaterOrder, slaterIndex
computeSymmetryDegree(self, InPercents=False, Comments=False)
Renders the symmetry degree (Decimal) of the irreflexive part of a digraph.
 
.. note::
 
   Empty and indeterminate digraphs are considered to be symmetric.
computeTopologicalRanking(self, Debug=False)
Mimetic Wrapper of the topologicalSort() method.
computeTransitivityDegree(self, InPercents=False, Comments=False)
Renders the transitivity degree (Decimal) of a digraph.
 
.. note:: 
 
   An empty or indeterminate digraph is considered to be transitive.
computeUnrelatedPairs(self)
Renders a list of more or less unrelated pairs.
computeValuationLevels(self, choice=None, Debug=False)
renders the symmetric closure of the
apparent valuations levels of self
in an increasingly ordered list.
If parameter choice is given, the
computation is limited to the actions
of the choice.
computeValuationPercentages(self, choice, percentiles, withValues=False)
Parameters: choice and list of percentiles.
renders a series of percentages of the characteristics valuation of
the arcs in the digraph.
computeValuationPercentiles(self, choice, percentages, withValues=False)
Parameters: choice and list of percentages.
renders a series of quantiles of the characteristics valuation of
the arcs in the digraph.
computeValuationStatistics(self, Sampling=False, Comments=False)
Renders the mean and variance of the valuation
of the non reflexive pairs.
computeValuedRankingRelation(self, ranking)
Renders the valued relation characteristics compatible 
with the given linar ranking. Discordant charcateristics 
are set to the indeterminate value.
computeWeakCondorcetLosers(self)
Wrapper for weakCondorcetLosers().
computeWeakCondorcetWinners(self)
Wrapper for weakCondorcetWinners().
computeupdown1(self, s, S)
Help method for show_MIS_HB2 method.
fills self.newmisset, self.upmis, self.downmis.
computeupdown2(self, s, S)
Help method for show_MIS_HB1 method.
Fills self.newmisset, self.upmis, self.downmis.
computeupdown2irred(self, s, S)
Help method for show_MIS_HB1 method.
Fills self.newmisset, self.upmis, self.downmis.
condorcetLosers(self)
Renders the set of decision actions x such that
self.relation[x][y] < self.valuationdomain['med']
for all y != x.
condorcetWinners(self)
Renders the set of decision actions x such that
self.relation[x][y] > self.valuationdomain['med']
for all y != x.
contra(self, v)
Parameter: choice.
Renders the negation of a choice v characteristic's vector.
convertRelationToDecimal(self)
Converts the float valued self.relation in a decimal valued one.
convertValuation2Integer(self, InSite=True, Comments=False)
Converts the self.relation valuation to integer values by converting the Decimals to Fractions and multiply by the least commun multiple of the fraction denominators.
 
*Parameters*:
 
    - If *Insite* == False (True by default) the method returns a modified copy of self.relation without altering the original self.relation, otherwise self.relation and self.valuationdomain is modified.
convertValuationToDecimal(self)
Convert the float valuation limits to Decimals.
coveringIndex(self, choice, direction='out')
Renders the covering index of a given choice in a set of objects,
ie the minimum number of choice members that cover each
non selected object.
crispKDistance(self, digraph, Debug=False)
Renders the crisp Kendall distance between two bipolar valued
digraphs.
 
.. warning::
 
     Obsolete! Is replaced by the self.computeBipolarCorrelation(other, MedianCut=True) Digraph method
detectChordlessCircuits(self, Comments=False, Debug=False)
Detects a chordless circuit in a digraph.
Returns a Boolean
detectChordlessPath(self, Pk, n2, Comments=False, Debug=False)
New procedure from Agrum study April 2009
recursive chordless path extraction starting from path
Pk = [n2, ...., n1] and ending in node n2.
Optimized with marking of visited chordless P1s.
determinateness(self, vec, inPercent=True)
Renders the determinateness of a characteristic vector *vec* = 
[(r(x),x),(r(y),y), ...] of length *n* in valuationdomain [Min,Med,Max]:
 
*result* =  sum_x( abs(r(x)-Med) ) / ( n*(Max-Med) )
 
If inPercent, *result* shifted (+1) and reduced (/2) to [0,1] range.
digraph2Graph(self, valuationDomain={'min': -1, 'med': 0, 'max': 1}, Debug=False, ConjunctiveConversion=True)
Convert a Digraph instance to a Graph instance.
dneighbors(self, node)
Renders the set of dominated out-neighbors of a node.
domin(self, choice)
Renders the dominance degree of a choice.
dominantChoices(self, S)
Generates all minimal dominant choices of a bipolar valued digraph.
 
.. note::
 
     Initiate with S = self.actions.copy().
domirred(self, choice)
Renders the crips +irredundance degree of a choice.
domirredval(self, choice, relation)
Renders the valued +irredundance degree of a choice.
domirredx(self, choice, x)
Renders the crips +irredundance degree of node x in a choice.
domkernelrestrict(self, prekernel)
Parameter: dominant prekernel
Renders dominant prekernel restricted relation.
exportGraphViz(self, fileName=None, actionsSubset=None, bestChoice=set(), worstChoice=set(), firstChoice=set(), lastChoice=set(), Comments=True, graphType='png', pictureFormat=None, graphSize='7,7', relation=None, bgcolor='cornsilk')
export GraphViz dot file  for graph drawing filtering.
exportPrincipalImage(self, plotFileName=None, pictureFormat='pdf', bgcolor='cornsilk', fontcolor='red3', fontsize='0.75', Reduced=False, Colwise=False, tempDir='.', Comments=False)
Export as PDF (default) the principal projection of
the valued relation using the three principal eigen vectors.
 
Implemeted picture formats are: 
'pdf' (default), 'png', 'jpeg' and 'xfig'.
 
The background color is set by default to 'cornsilk'. 
 
Font size and color are set by default to 'red3', resp. '0.75'. 
 
When *Reduced==True*, the valued relation characeteristics are centered and reduced.
 
When *Colwise==True*, the column vectors of the adjacency table are used for the principal projection, otherwise the rows (default) are used. Has no incidence when the *Digraph* instance *self*  is symmetric. 
 
.. warning::
 
    The method, writing and reading temporary files: 
    tempCol.r and rotationCol.csv, resp. tempRow.r and rotationRow.csv,
    by default in the working directory (./),
    is hence not safe for multiprocessing programs, unless a
    temporary directory *tempDir* is provided.
flatChoice(self, ch, Debug=False)
Converts set or list ch recursively to a flat list of items.
forcedBestSingleChoice(self)
Renders the set of most determined outranking singletons in self.
gammaSets(self)
Renders the dictionary of neighborhoods {node: (dx,ax)}
with set *dx* gathering the dominated, and set *ax* gathering
the absorbed neighborhood.
generateAbsPreKernels(self)
Generate all absorbent prekernels from independent choices generator.
generateDomPreKernels(self)
Generate all dominant prekernels from independent choices generator.
htmlChoiceVector(self, ch, ChoiceVector=True, choiceType='good')
Show procedure for annotated bipolar choices.
inDegrees(self)
renders the median cut indegrees
inDegreesDistribution(self)
Renders the distribution of indegrees.
independentChoices(self, U)
Generator for all independent choices with neighborhoods of a bipolar valued digraph:
 
.. note::
 
       * Initiate with U = self.singletons().
       * Yields [(independent choice, domnb, absnb, indnb)].
inner_prod(self, v1, v2)
Parameters: two choice characteristic vectors
Renders the inner product of two characteristic vetors.
intstab(self, choice)
Computes the independence degree of a choice.
irreflex(self, mat)
Puts diagonal entries of mat to valuationdomain['min']
isAsymmetricIndeterminate(self, Debug=False)
Checks the self.relation for assymmetric indeterminateness!!
 
.. warning::
 
    The reflexive links are ignored !!
isComplete(self, Debug=False)
checks the completeness property of self.relation by checking
for the absence of a link between two actions!!
 
.. warning::
 
    The reflexive links are ignored !!
isCyclic(self, Debug=False)
checks the cyclicity of self.relation by checking
for a reflexive loop in its transitive closure-
 
.. warning::
 
     self.relation is supposed to be irreflexive !
isIntegerValued(self, Debug=False)
Checks whether the decimal valuation of self is integer-valued
be using the as_integer_ratio() method of a Decimal 
giving a tuple (numerator,denominator). If denominator == 1, the
number is an integer.
isOutrankingDigraph(self, Comments=True, Debug=False)
Checks the outranking digraph characteristic condition (3.3).
 
relation[x][y] + relation[y][x)[y] >= 0.0
 
.. warning::
 
    The reflexive links are ignored and the valuation must be bipolar !!
isStrictOutrankingDigraph(self, Comments=True, Debug=False)
Checks the strict outranking digraph characteristic condition (3.1).
 
-(relation[x][y] + relation[y][x]) <= 0.0 , x != y
 
.. warning::
 
    The reflexive links are ignored and the valuation must be bipolar !!
isSymmetric(self, Comments=False)
True if symmetry degree == 1.0.
isTransitive(self, Comments=False)
True if transitivity degree == 1.0.
isWeaklyComplete(self, Debug=False)
checks the weakly completeness property of self.relation by checking
for the absence of a link between two actions!!
 
.. warning::
 
    The reflexive links are ignored !!
iterateRankingByChoosing(self, Odd=False, CoDual=False, Comments=True, Debug=False, Limited=None)
Renders a ranking by choosing result when progressively eliminating
all chordless (odd only) circuits with rising valuation cut levels.
 
Parameters
    CoDual = False (default)/True
    Limited = proportion (in [0,1]) * (max - med) valuationdomain
kChoices(self, A, k)
Renders all choices of length k from set A
matmult2(self, m, v)
Parameters: digraph relation and choice characteristic vector
matrix multiply vector by inner production
meanDegree(self)
Renders the mean degree of self.
!!! self.size must be set previously !!!
meanLength(self, Oriented=False)
Renders the (by default non-oriented) mean neighbourhoor depth of self.
!!! self.order must be set previously !!!
minimalChoices(self, S)
Generates all dominant or absorbent choices of a bipolar
valued digraph.
 
.. note:
 
   * Initiate with S = (actions, dict of dominant or absorbent closed neighborhoods)
   * See showMinDom and showMinAbs methods.
minimalValuationLevelForCircuitsElimination(self, Odd=True, Debug=False, Comments=False)
renders the minimal valuation level <lambda> that eliminates all
self.circuitsList stored odd chordless circuits from self.
 
.. warning::
 
    The <lambda> level polarised may still contain newly appearing chordless odd circuits !
neighbourhoodCollection(self, Oriented=False, Potential=False)
Renders the neighbourhood.
neighbourhoodDepthDistribution(self, Oriented=False)
Renders the distribtion of neighbourhood depths.
notGammaSets(self)
Renders the dictionary of neighborhoods {node: (dx,ax)}
with set *dx* gathering the not dominated, and set *ax* gathering
the not absorbed neighborhood.
notaneighbors(self, node)
Renders the set of absorbed not in-neighbors of a node.
notdneighbors(self, node)
Renders the set of not dominated out-neighbors of a node.
outDegrees(self)
renders the median cut outdegrees
outDegreesDistribution(self)
Renders the distribution of outdegrees.
plusirredundant(self, U)
Generates all +irredundant choices of a digraph.
powerset(self, U)
Generates all subsets of a set.
readPerrinMisset(self, file='curd.dat')
read method for 0-1-char-coded MISs by default from the perrinMIS.c curd.dat result file.
readabsvector(self, x, relation)
Parameter: action x
absorbent in vector.
readdomvector(self, x, relation)
Parameter: action x
dominant out vector.
recodeValuation(self, newMin=-1.0, newMax=1.0, ndigits=4, Debug=False)
Recodes the characteristic valuation domain according
to the parameters given. 
 
*ndigits* indicates the number of decimal digits of the valuation.
relationFct(self, x, y)
wrapper for self.relation dictionary access to ensure interoperability
with the sparse and big outranking digraph implementation model.
save(self, fileName='tempdigraph', option=None, DecimalValuation=True, decDigits=2)
Persistent storage of a Digraph class instance in the form of
a python source code file
saveCSV(self, fileName='tempdigraph', Normalized=False, Dual=False, Converse=False, Diagonal=False, Debug=False)
Persistent storage of a Digraph class instance in the form of
a csv file.
saveXMCDA2(self, fileName='temp', fileExt='xmcda2', Comments=True, relationName='R', relationType='binary', category='random', subcategory='valued', author='digraphs Module (RB)', reference='saved from Python', valuationType='standard', digits=2, servingD3=False)
save digraph in XMCDA 2.0 format. Deprecated now.
savedre(self, fileName='temp')
save digraph in nauty format.
sharp(self, x, y)
Paramaters: choice characteristic values.
Renders the sharpest of two characteristic values x and y.
sharpvec(self, v, w)
Paramaters: choice characteristic vectors.
Renders the sharpest of two characteristic vectors v and w.
showActions(self)
presentation methods for digraphs actions
showAll(self)
Detailed show method for genuine digraphs.
showAttributes(self)
Prints out the attributes of self.
showAutomorphismGenerators(self)
Renders the generators of the automorphism group.
showBadChoices(self, Recompute=True)
Characteristic values for potentially bad choices.
showBestChoiceRecommendation(self, Verbose=False, Comments=True, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True)
Shows the RuBis best choice recommendation.
 
.. note::
 
    Computes by default the Rubis best choice recommendation on the corresponding strict (codual) outranking digraph.
 
    By default, with BrokenCocs=True, we brake all chordless circuits at their weakest determined ( abs(r(x>y)) + abs(r(y>x)) ) link.
 
    When BrokenCocs=False we proceed like follows:
 
    In case of chordless circuits, if supporting arcs are more credible
    than the reversed negating arcs, we collapse the circuits into hyper nodes.
    Inversely,  if supporting arcs are not more credible than the reversed negating arcs,
    we brake the circuits on their weakest arc.
 
Usage example:
 
>>> from outrankingDigraphs import *
>>> t = Random3ObjectivesPerformanceTableau(seed=5)
>>> g = BipolarOutrankingDigraph(t)
>>> g.showBestChoiceRecommendation()
***********************
RuBis Best Choice Recommendation (BCR)
(in decreasing order of determinateness)   
Credibility domain:  [-100.0, 100.0]
=== >> potential first choices
* choice              : ['a04', 'a14', 'a19', 'a20']
   independence        : 1.19
   dominance           : 4.76
   absorbency          : -59.52
   covering (%)        : 75.00
   determinateness (%) : 57.86
   - most credible action(s) = { 'a14': 23.81, 'a19': 11.90, 'a04': 2.38, 'a20': 1.19, }  
=== >> potential last choices 
* choice              : ['a03', 'a12', 'a17']
  independence        : 4.76
  dominance           : -76.19
  absorbency          : 4.76
  covering (%)        : 0.00
  determinateness (%) : 65.39
  - most credible action(s) = { 'a03': 38.10, 'a12': 13.10, 'a17': 4.76, }
Execution time: 0.024 seconds
*****************************
showChoiceVector(self, ch, choiceType='good', ChoiceVector=True)
Show procedure for annotated bipolar choices.
showChordlessCircuits(self, Recompute=False)
Show method for chordless circuits observed in a Digraph instance.
 
If previous computation is required, stores the detected circuits in self.circuitsList attribute.
showComponents(self)
Shows the list of connected components of the digraph instance.
showCorrelation(self, corr=None, ndigits=3)
Renders the valued ordinal correlation index, the crisp Kendall tau index and their epistemic determination degree.
showFirstChoiceRecommendation(self, Verbose=False, Comments=True, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True)
Shows the RuBis first choice recommendation.
 
.. note::
 
    Computes by default the Rubis first choice recommendation on the corresponding strict (codual) outranking digraph.
 
    By default, with BrokenCocs=True, we brake all chordless circuits at their weakest determined ( abs(r(x>y)) + abs(r(y>x)) ) link.
 
    When BrokenCocs=False we proceed like follows:
 
    In case of chordless circuits, if supporting arcs are more credible
    than the reversed negating arcs, we collapse the circuits into hyper nodes.
    Inversely,  if supporting arcs are not more credible than the reversed negating arcs,
    we brake the circuits on their weakest arc.
 
Usage example:
 
>>> from outrankingDigraphs import *
>>> t = Random3ObjectivesPerformanceTableau(seed=5)
>>> g = BipolarOutrankingDigraph(t)
>>> g.showFirstChoiceRecommendation()
***********************
RuBis First Choice Recommendation (BCR)
(in decreasing order of determinateness)   
Credibility domain:  [-100.0, 100.0]
=== >> potential first choices
* choice              : ['a04', 'a14', 'a19', 'a20']
   independence        : 1.19
   dominance           : 4.76
   absorbency          : -59.52
   covering (%)        : 75.00
   determinateness (%) : 57.86
   - most credible action(s) = { 'a14': 23.81, 'a19': 11.90, 'a04': 2.38, 'a20': 1.19, }  
=== >> potential last choices 
* choice              : ['a03', 'a12', 'a17']
  independence        : 4.76
  dominance           : -76.19
  absorbency          : 4.76
  covering (%)        : 0.00
  determinateness (%) : 65.39
  - most credible action(s) = { 'a03': 38.10, 'a12': 13.10, 'a17': 4.76, }
Execution time: 0.024 seconds
*****************************
showGoodChoices(self, Recompute=True)
Characteristic values for potentially good choices.
showHTMLBestChoiceRecommendation(self, pageTitle=None, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True, htmlFileName=None)
showHTMLRelationHeatmap(self, actionsList=None, rankingRule='NetFlows', colorLevels=7, tableTitle='Relation Heatmap', relationName='r(x S y)', ndigits=2, fromIndex=None, toIndex=None, htmlFileName=None)
Launches a browser window with the colored relation map of self.
 
See corresponding :py:class:`~digraphs.Digraph.showHTMLRelationMap` method.
 
The *colorLevels* parameter may be set to 3, 5, 7 (default) or 9.
 
When the *actionsList* parameter is *None* (default), the digraphs actions list may be ranked with the *rankingRule* parameter set to the 'Copeland' (default) or to the 'Netlows' ranking rule.
 
When the *htmlFileName* parameter is set to a string value 'xxx', a html file named 'xxx.html' will be generated in the current working directory. Otherwise, a temporary file named 'tmp*.html' will be generated there.
 
Example::
 
    >>> from outrankingDigraphs import *
    >>> t = RandomCBPerformanceTableau(numberOfActions=25,seed=1)
    >>> g = BipolarOutrankingDigraph(t,ndigits=2)
    >>> gcd = ~(-g)  # strict outranking relation
    >>> gcd.showHTMLRelationHeatmap(colorLevels=7,ndigits=2)
    
.. image:: relationHeatmap.png
   :alt: Browser view of a relation map
   :width: 600 px
   :align: center
showHTMLRelationMap(self, actionsList=None, rankingRule='Copeland', Colored=True, tableTitle='Relation Map', relationName='r(x S y)', symbols=['+', '&middot;', '&nbsp;', '&#150;', '&#151'], fromIndex=None, toIndex=None, htmlFileName=None)
Launches a browser window with the colored relation map of self.
See corresponding Digraph.showRelationMap() method.
 
When *htmlFileName* parameter is set to a string value, a html file
with that name will be stored in the current working directory.
 
By default, a temporary file named: tmp*.html will be generated
instead in the current working directory.
 
Example::
 
    >>> from outrankingDigraphs import *
    >>> t = RandomCBPerformanceTableau(numberOfActions=25,seed=1)
    >>> g = BipolarOutrankingDigraph(t,Normalized=True)
    >>> gcd = ~(-g)  # strict outranking relation
    >>> gcd.showHTMLRelationMap(rankingRule="NetFlows")
    
.. image:: relationMap.png
   :alt: Browser view of a relation map
   :width: 600 px
   :align: center
showHTMLRelationTable(self, actionsList=None, relation=None, IntegerValues=False, ndigits=2, Colored=True, tableTitle='Valued Adjacency Matrix', relationName='r(x S y)', ReflexiveTerms=False, htmlFileName=None, fromIndex=None, toIndex=None)
Launches a browser window with the colored relation table of self.
showMIS(self, withListing=True)
Prints all maximal independent choices:
    Result in self.misset.
showMIS_AH(self, withListing=True)
Prints all MIS using the Hertz method.
 
Result saved in self.hertzmisset.
showMIS_HB2(self, withListing=True)
Prints all MIS using the Hertz-Bisdorff method.
 
Result saved in self.newmisset.
showMIS_RB(self, withListing=True)
Prints all MIS using the Bisdorff method.
 
Result saved in self.newmisset.
showMIS_UD(self, withListing=True)
Prints all MIS using the Hertz-Bisdorff method.
 
Result saved in self.newmisset.
showMaxAbsIrred(self, withListing=True)
Computing maximal -irredundant choices:
    Result in self.absirset.
showMaxDomIrred(self, withListing=True)
Computing maximal +irredundant choices:
   Result in self.domirset.
showMinAbs(self, withListing=True)
Prints minimal absorbent choices:
    Result in self.absset.
showMinDom(self, withListing=True)
Prints all minimal dominant choices:
    Result in self.domset.
showNeighborhoods(self)
Lists the gamma and the notGamma function of self.
showOrbits(self, InChoices, withListing=True)
Prints the orbits of Choices along the automorphisms of
the Digraph instance.
 
Example Python session for computing the non isomorphic MISs from the 12-cycle graph:
 
>>> from digraphs import *
>>> c12 = CirculantDigraph(order=12,circulants=[1,-1])
>>> c12.automorphismGenerators()
...
  Permutations
  {'1': '1', '2': '12', '3': '11', '4': '10', '5': 
   '9', '6': '8', '7': '7', '8': '6', '9': '5', '10': 
   '4', '11': '3', '12': '2'}
  {'1': '2', '2': '1', '3': '12', '4': '11', '5': '10', 
   '6': '9', '7': '8', '8': '7', '9': '6', '10': '5', 
   '11': '4', '12': '3'}
  Reflections {}
>>> print('grpsize = ', c12.automorphismGroupSize)
  grpsize = 24
>>> c12.showMIS(withListing=False)
  *---  Maximal independent choices ---*
  number of solutions:  29
  cardinality distribution
  card.:  [0, 1, 2, 3, 4,  5,  6, 7, 8, 9, 10, 11, 12]
  freq.:  [0, 0, 0, 0, 3, 24,  2, 0, 0, 0,  0,  0,  0]
  Results in c12.misset
>>> c12.showOrbits(c12.misset,withListing=False)
...
  *---- Global result ----
  Number of MIS:  29
  Number of orbits :  4
  Labelled representatives:
  1: ['2','4','6','8','10','12']
  2: ['2','5','8','11']
  3: ['2','4','6','9','11']
  4: ['1','4','7','9','11']
  Symmetry vector
  stabilizer size: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, ...]
  frequency      : [0, 2, 0, 0, 0, 0, 0, 1, 0,  0,  0,  1, ...]
 
*Figure*: The symmetry axes of the non isomorphic MISs of the 12-cycle:
 
.. image:: c12.png
   :width: 400 px
   :align: center
   :alt: The 4 non isomorphic MIS of the 12-cycle graph
 
*Reference*: R. Bisdorff and J.L. Marichal (2008). Counting non-isomorphic maximal independent sets of the n-cycle graph. *Journal of Integer Sequences*, Vol. 11 Article 08.5.7 (`openly accessible here <https://www.cs.uwaterloo.ca/journals/JIS/VOL11/Marichal/marichal.html>`_)
showOrbitsFromFile(self, InFile, withListing=True)
Prints the orbits of Choices along the automorphisms of
the digraph self by reading in the 0-1 misset file format.
See the :py:func:`digraphs.Digraph.readPerrinMisset` method.
showPreKernels(self, withListing=True)
Printing dominant and absorbent preKernels:
    Result in self.dompreKernels and self.abspreKernels
showRankingByBestChoosing(self, rankingByBestChoosing=None)
A show method for self.rankinByBestChoosing result.
 
.. warning::
 
     The self.computeRankingByBestChoosing(CoDual=False/True) method instantiating the self.rankingByBestChoosing slot is pre-required !
showRankingByChoosing(self, rankingByChoosing=None, WithCoverCredibility=False)
A show method for self.rankinByChoosing result.
 
When parameter *WithCoverCredibility* is set to True, the credibility of outranking, respectively being outranked is indicated at each selection step. 
 
.. warning::
 
     The self.computeRankingByChoosing(CoDual=False/True) method instantiating the self.rankingByChoosing slot is pre-required !
showRankingByLastChoosing(self, rankingByLastChoosing=None, Debug=None)
A show method for self.rankinByChoosing result.
 
.. warning::
 
     The self.computeRankingByLastChoosing(CoDual=False/True) method instantiating the self.rankingByChoosing slot is pre-required !
showRelation(self)
prints the relation valuation in ##.## format.
showRelationMap(self, symbols=None, rankingRule='Copeland', fromIndex=None, toIndex=None, actionsList=None)
Prints on the console, in text map format, the location of
certainly validated and certainly invalidated outranking situations.
 
By default, symbols = {'max':'┬','positive': '+', 'median': ' ',
                       'negative': '-', 'min': '┴'}
 
The default ordering of the output is following the Copeland ranking rule
from best to worst actions. Further available ranking rule is the 'NetFlows' net flows rule.
 
 
Example::
 
    >>> from outrankingDigraphs import *
    >>> t = RandomCBPerformanceTableau(numberOfActions=25,seed=1)
    >>> g = BipolarOutrankingDigraph(t,Normalized=True)
    >>> gcd = ~(-g)  # strict outranking relation
    >>> gcd.showRelationMap(rankingRule="NetFlows")
     -   ++++++++  +++++┬+┬┬+
    - -   + +++++ ++┬+┬+++┬++
    ┴+  ┴ + ++  ++++┬+┬┬++┬++
    -   ++ - ++++-++++++┬++┬+
       - - - ++- ┬- + -+┬+-┬┬
    -----  -      -┬┬┬-+  -┬┬
    ----    --+-+++++++++++++
    -- --+- --++ ++ +++-┬+-┬┬
    ----  -  -+-- ++--+++++ +
    ----- ++- --- +---++++┬ +
    -- -- ---+ -++-+++-+ +-++
    -- --┴---+  + +-++-+ -  +
    ---- ┴---+-- ++--++++ - +
      --┴┴--  --- -  --+ --┬┬
     ---------+--+ ----- +-┬┬
    -┴---┴- ---+- + ---+++┬ +
    -┴┴--┴---+--- ++ -++--+++
    -----┴--- ---+-+- ++---+ 
    -┴┴--------------- --++┬ 
    --┴---------------- --+┬ 
    ┴--┴┴ -┴--┴┴-┴ --++  ++-+
    ----┴┴--------------- -  
    ┴┴┴----+-┴+┴---┴-+---+ ┴+
    ┴┴-┴┴┴-┴- - -┴┴---┴┴+ ┬ -
    ----┴┴-┴-----┴┴---  - -- 
    Ranking rule: NetFlows
    >>>
showRelationTable(self, Sorted=True, rankingRule=None, IntegerValues=False, actionsSubset=None, relation=None, ndigits=2, ReflexiveTerms=True, fromIndex=None, toIndex=None)
Prints the relation valuation in actions X actions table format.
Copeland and NetFlows rankings my be used.
showRubisBestChoiceRecommendation(self, **kwargs)
Dummy for backward portable showBestChoiceRecommendation().
showRubyChoice(self, Verbose=False, Comments=True, _OldCoca=True)
Dummy for showBestChoiceRecommendation()
needed for older versions compatibility.
showShort(self)
concise presentation method for genuine digraphs.
showSingletonRanking(self, Comments=True, Debug=False)
Calls self.computeSingletonRanking(comments=True,Debug = False).
Renders and prints the sorted bipolar net determinatation of outrankingness
minus outrankedness credibilities of all singleton choices.
 
res = ((netdet,sigleton,dom,absorb)+)
showStatistics(self)
Computes digraph statistics like order, size and arc-density.
showdre(self)
Shows relation in nauty format.
singletons(self)
list of singletons and neighborhoods
[(singx1, +nx1, -nx1, not(+nx1 or -nx1)),.... ]
sizeSubGraph(self, choice)
Output: (size, undeterm,arcDensity).
Renders the arc density of the induced subgraph.
strongComponents(self, setPotential=False)
Renders the set of strong components of self.
symDegreesDistribution(self)
Renders the distribution of symmetric degrees.
topologicalSort(self, Debug=False)
If self is acyclic, adds topological sort number to each node of self
and renders ordered list of nodes. Otherwise renders None.
Source: M. Golumbic Algorithmic Graph heory and Perfect Graphs,
Annals Of Discrete Mathematics 57 2nd Ed. , Elsevier 2004, Algorithm 2.4 p.44.
weakAneighbors(self, node)
Renders the set of absorbed in-neighbors of a node.
weakCondorcetLosers(self)
Renders the set of decision actions x such that
self.relation[x][y] <= self.valuationdomain['med']
for all y != x.
weakCondorcetWinners(self)
Renders the set of decision actions x such that
self.relation[x][y] >= self.valuationdomain['med']
for all y != x.
weakDneighbors(self, node)
Renders the set of dominated out-neighbors of a node.
weakGammaSets(self)
Renders the dictionary of neighborhoods {node: (dx,ax)}
zoomValuation(self, zoomFactor=1.0)
Zooms in or out, depending on the value of the zoomFactor provided,
the bipolar valuation of a digraph.

Data descriptors inherited from Digraph:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class CocaDigraph(Digraph)
    CocaDigraph(digraph=None, Piping=False, Comments=False)
 
Old CocaDigraph class without circuit breakings; all circuits and circuits of circuits are added as hyper-nodes.
 
.. warning::
 
    May sometimes give inconsistent results when an autranking digraph shows loads of chordless cuircuits.
    It is recommended in this case to use instead either the BrokenCocsDigraph class (preferred option)
    or the  BreakAddCocsDigraph class.
 
Parameters:
 
    - digraph: Stored or memory resident digraph instance.
    - Piping: using OS pipes for data in- and output between Python and C++.
 
Specialization of general Digraph class for instantiation
of chordless odd circuits augmented digraphs.
 
 
Method resolution order:
CocaDigraph
Digraph
builtins.object

Methods defined here:
__init__(self, digraph=None, Piping=False, Comments=False)
Initialize self.  See help(type(self)) for accurate signature.
addCircuits(self, Comments=False)
Augmenting self with self.circuits.
closureChordlessOddCircuits(self, Piping=False, Comments=False)
Closure of chordless odd circuits extraction.
showCircuits(self, credibility=None)
show methods for chordless odd circuits in CocaGraph
showComponents(self)
Shows the list of connected components of the digraph instance.

Methods inherited from Digraph:
MISgen(self, S, I)
generator of maximal independent choices (voir Byskov 2004):
    * S ::= remaining nodes;
    * I ::= current independent choice
 
.. note::
 
        Inititalize: self.MISgen(self.actions.copy(),set())
__invert__(self)
Make the inverting operator ~self available for Digraph instances. 
 
Returns a ConverseDigraph instance of self.
__neg__(self)
Make the negation operator -self available for Digraph instances. 
 
Returns a DualDigraph instance of self.
__repr__(self)
Default presentation method for Digraph instances.
absirred(self, choice)
Renders the crips -irredundance degree of a choice.
absirredundant(self, U)
Generates all -irredundant choices of a digraph.
absirredval(self, choice, relation)
Renders the valued -irredundance degree of a choice.
absirredx(self, choice, x)
Computes the crips -irredundance degree of node x in a choice.
abskernelrestrict(self, prekernel)
Parameter: prekernel
Renders absorbent prekernel restricted relation.
absorb(self, choice)
Renders the absorbency degree of a choice.
absorbentChoices(self, S)
Generates all minimal absorbent choices of a bipolar valued digraph.
addValuationAttribute(self)
Adds the numpy valuation attribute
agglomerationDistribution(self)
Output: aggloCoeffDistribution, meanCoeff
Renders the distribution of agglomeration coefficients.
aneighbors(self, node)
Renders the set of absorbed in-neighbors of a node.
automorphismGenerators(self)
Adds automorphism group generators to the digraph instance.
 
.. note::
 
    Dependency: Uses the dreadnaut command from the nauty software package. See https://www3.cs.stonybrook.edu/~algorith/implement/nauty/implement.shtml
 
    On Ubuntu Linux:
      ...$ sudo apt-get install nauty
averageCoveringIndex(self, choice, direction='out')
Renders the average covering index of a given choice in a set of objects,
ie the average number of choice members that cover each
non selected object.
bipolarKCorrelation(self, digraph, Debug=False)
Renders the bipolar Kendall correlation between two bipolar valued
digraphs computed from the average valuation of the
XORDigraph(self,digraph) instance.
 
.. warning::
 
     Obsolete! Is replaced by the self.computeBipolarCorrelation(other) Digraph method
bipolarKDistance(self, digraph, Debug=False)
Renders the bipolar crisp Kendall distance between two bipolar valued
digraphs.
 
.. warning::
 
     Obsolete! Is replaced by the self.computeBipolarCorrelation(other, MedianCut=True) Digraph method
chordlessPaths(self, Pk, n2, Odd=False, Comments=False, Debug=False)
New procedure from Agrum study April 2009
recursive chordless path extraction starting from path
Pk = [n2, ...., n1] and ending in node n2.
Optimized with marking of visited chordless P1s.
circuitAverageCredibility(self, circ)
Renders the average linking credibility of a Chordless Circuit.
circuitCredibilities(self, circuit, Debug=False)
Renders the average linking credibilities and the minimal link of a Chordless Circuit.
circuitMaxCredibility(self, circ)
Renders the maximal linking credibility of a Chordless Circuit.
circuitMinCredibility(self, circ)
Renders the minimal linking credibility of a Chordless Circuit.
closeSymmetric(self, InSite=True)
Produces the symmetric closure of self.relation.
closeTransitive(self, Reverse=False, InSite=True, Comments=False)
Produces the transitive closure of self.relation
 
*Parameters*:
 
    - If *Reverse* == True (False default) all transitive links are dropped, otherwise all transitive links are closed with min[r(x,y),r(y,z)];
    - If *Insite* == False (True by default) the methods return a modified copy of self.relation without altering the original self.relation, otherwise self.relation is modified.
components(self)
Renders the list of connected components.
computeAllDensities(self, choice=None)
parameter: choice in self
renders six densitiy parameters:
arc density, double arc density,
single arc density, strict single arc density,
absence arc density, strict absence arc densitiy.
computeArrowRaynaudOrder(self)
Renders a linear ordering from worst to best of the actions following Arrow&Raynaud's rule.
computeArrowRaynaudRanking(self)
renders a linear ranking from best to worst of the actions following Arrow&Raynaud's rule.
computeAverageValuation(self)
Computes the bipolar average correlation between
self and the crisp complete digraph of same order
of the irreflexive and determined arcs of the digraph
computeBadChoices(self, Comments=False)
Computes characteristic values for potentially bad choices.
 
.. note::
 
     Returns a tuple with following content:
 
     [(0)-determ,(1)degirred,(2)degi,(3)degd,(4)dega,(5)str(choice),(6)absvec]
computeBadPirlotChoices(self, Comments=False)
Characteristic values for potentially bad choices
using the Pirlot's fixpoint algorithm.
computeBestChoiceRecommendation(self, Verbose=False, Comments=False, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True)
Sets self.bestChoice, self.bestChoiceData, self.worstChoice and self.worstChoiceData
with the showBestChoiceRecommendation method.
 
First and last choices data is the following:
[(0)-determ,(1)degirred,(2)degi,(3)degd,(4)dega,(5)str(choice),(6)domvec,(7)cover]
 
self.bestChoice = self.bestChoiceData[5]
self.worstChoice = self.worstChoiceData[5]
computeBipolarCorrelation(self, other, MedianCut=False, filterRelation=None, Debug=False)
obsolete: dummy replacement for Digraph.computeOrdinalCorrelation method
computeChordlessCircuits(self, Odd=False, Comments=False, Debug=False)
Renders the set of all chordless circuits detected in a digraph.
Result is stored in <self.circuitsList>
holding a possibly empty list of tuples with at position 0 the
list of adjacent actions of the circuit and at position 1
the set of actions in the stored circuit.
 
When *Odd* is True, only chordless circuits with an odd length
are collected.
computeChordlessCircuitsMP(self, Odd=False, Threading=False, nbrOfCPUs=None, startMethod=None, Comments=False, Debug=False)
Multiprocessing version of computeChordlessCircuits().
 
Renders the set of all chordless odd circuits detected in a digraph.
Result (possible empty list) stored in <self.circuitsList>
holding a possibly empty list tuples with at position 0 the
list of adjacent actions of the circuit and at position 1
the set of actions in the stored circuit.
Inspired by Dias, Castonguay, Longo, Jradi, Algorithmica (2015).
 
Returns a possibly empty list of tuples (circuit,frozenset(circuit)).
 
If Odd == True, only circuits of odd length are retained in the result.
computeCoSize(self)
Renders the number of non validated non reflexive arcs
computeConcentrationIndex(self, X, N)
Renders the Gini concentration index of the X serie.
N contains the partial frequencies.
Based on the triangle summation formula.
computeConcentrationIndexTrapez(self, X, N)
Renders the Gini concentration index of the X serie.
N contains the partial frequencies.
Based on the triangles summation formula.
computeCondorcetLosers(self)
Wrapper for condorcetLosers().
computeCondorcetWinners(self)
Wrapper for condorcetWinners().
computeCopelandOrder(self)
renders a linear ordering from worst to best of the actions following Arrow&Raynaud's rule.
computeCopelandRanking(self)
renders a linear ranking from best to worst of the actions following Arrow&Raynaud's rule.
computeCutLevelDensities(self, choice, level)
parameter: choice in self, robustness level
renders three robust densitiy parameters:
robust double arc density,
robust single arc density,
robust absence arc densitiy.
computeDensities(self, choice)
parameter: choice in self
renders the four densitiy parameters:
arc density, double arc density, single arc density, absence arc density.
computeDeterminateness(self, InPercents=False)
Computes the Kendalll distance of self
with the all median-valued indeterminate digraph of order n.
 
Return the average determination of the irreflexive part of the digraph.
 
*determination* = sum_(x,y) { abs[ r(xRy) - Med ] } / n(n-1)
 
If *InPercents* is True, returns the average determination in percentage of
(Max - Med) difference.
 
>>> from outrankingDigraphs import BipolarOutrankingDigraph
>>> from randomPerfTabs import Random3ObjectivesPerformanceTableau
>>> t = Random3ObjectivesPerformanceTableau(numberOfActions=7,numberOfCriteria=7,seed=101)
>>> g = BipolarOutrankingDigraph(t,Normalized=True)
>>> g
*------- Object instance description ------*
Instance class      : BipolarOutrankingDigraph
Instance name       : rel_random3ObjectivesPerfTab
Actions             : 7
Criteria            : 7
Size                : 27
Determinateness (%) : 65.67
Valuation domain    : [-1.00;1.00]
>>> print(g.computeDeterminateness())
0.3134920634920634920634920638
>>> print(g.computeDeterminateness(InPercents=True))
65.67460317460317460317460320
>>> g.recodeValuation(0,1)
>>> g
*------- Object instance description ------*
Instance class      : BipolarOutrankingDigraph
Instance name       : rel_random3ObjectivesPerfTab
Actions             : 7
Criteria            : 7
Size                : 27
Determinateness (%) : 65.67
Valuation domain    : [0.00;1.00]
>>> print(g.computeDeterminateness())
0.1567460317460317460317460318
>>> print(g.computeDeterminateness(InPercents=True))
65.67460317460317460317460320
computeDiameter(self, Oriented=True)
Renders the (by default oriented) diameter of the digraph instance
computeDigraphCentres(self, WeakDistances=False, Comments=False)
The centers of a digraph are the nodes with finite minimal shortes path lengths.
 
The maximal neighborhood distances are stored in *self.maximalNeighborhoodDistances*.
 
The corresponding digraph radius and diameter are stored respectively  in *self.radius* and *self.diameter*.
 
With *Comments* = True, all these results are printed out.
 
*Source*: Claude Berge, *The Theory of Graphs*, Dover (2001) pp. 119, original in French Dunod (1958)
computeDynamicProgrammingStages(self, source, sink, Debug=False)
Renders the discrete stages of the optimal substructure for
dynamic pogramming digrahs from a given source node 
to a given sink sink node.
 
Returns a list of list of action identifyers.
computeGoodChoiceVector(self, ker, Comments=False)
| Computing Characteristic values for dominant pre-kernels
| using the von Neumann dual fixoint equation
computeGoodChoices(self, Comments=False)
Computes characteristic values for potentially good choices.
 
..note::
 
     Return a tuple with following content:
 
     [(0)-determ,(1)degirred,(2)degi,(3)degd,(4)dega,(5)str(choice),(6)domvec,(7)cover]
computeGoodPirlotChoices(self, Comments=False)
Characteristic values for potentially good choices
using the Pirlot fixpoint algorithm.
computeIncomparabilityDegree(self, InPercents=False, Comments=False)
Renders the incomparability degree (Decimal), i.e. the relative number of symmetric indeterminate relations of the irreflexive part of a digraph.
computeKemenyIndex(self, otherRelation)
renders the Kemeny index of the self.relation
compared with a given crisp valued relation of a compatible
other digraph (same nodes or actions).
computeKemenyOrder(self, orderLimit=7, Debug=False)
Renders a ordering from worst to best of the actions with maximal Kemeny index.
Return a tuple: kemenyOrder (from worst to best), kemenyIndex
computeKemenyRanking(self, orderLimit=7, seed=None, sampleSize=1000, Debug=False)
Renders a ranking from best to worst of the actions with maximal Kemeny index.
 
.. note::
 
     Returns a tuple: kemenyRanking (from best to worst), kemenyIndex.
computeKernelVector(self, kernel, Initial=True, Comments=False)
| Computing Characteristic values for dominant pre-kernels
| using the von Neumann dual fixpoint equation
computeKohlerOrder(self)
Renders an ordering (worst to best) of the actions following Kohler's rule.
computeKohlerRanking(self)
Renders a ranking (best to worst) of the actions following Kohler's rule.
computeMaxHoleSize(self, Comments=False)
Renders the length of the largest chordless cycle
in the corresponding disjunctive undirected graph.
computeMeanInDegree(self)
Renders the mean indegree of self.
!!! self.size must be set previously !!!
computeMeanOutDegree(self)
Renders the mean degree of self.
!!! self.size must be set previously !!!
computeMeanSymDegree(self)
Renders the mean degree of self.
!!! self.size must be set previously !!!
computeMedianOutDegree(self)
Renders the median outdegree of self.
!!! self.size must be set previously !!!
computeMedianSymDegree(self)
Renders the median symmetric degree of self.
!!! self.size must be set previously !!!
computeMoreOrLessUnrelatedPairs(self)
Renders a list of more or less unrelated pairs.
computeNetFlowsOrder(self)
Renders an ordered list (from best to worst) of the actions
following the net flows ranking rule.
computeNetFlowsOrderDict(self)
Renders an ordered list (from worst to best) of the actions
following the net flows ranking rule.
computeNetFlowsRanking(self)
Renders an ordered list (from best to worst) of the actions
following the net flows ranking rule.
computeNetFlowsRankingDict(self)
Renders an ordered list (from best to worst) of the actions
following the net flows ranking rule.
computeODistance(self, op2, comments=False)
renders the squared normalized distance of
two digraph valuations.
 
.. note::
 
     op2 = digraphs of same order as self.
computeOrbit(self, choice, withListing=False)
renders the set of isomorph copies of a choice following
the automorphism of the digraph self
computeOrderCorrelation(self, order, Debug=False)
Renders the ordinal correlation K of a digraph instance
when compared with a given linear order (from worst to best) of its actions
 
K = sum_{x != y} [ min( max(-self.relation(x,y)),other.relation(x,y), max(self.relation(x,y),-other.relation(x,y)) ]
 
K /= sum_{x!=y} [ min(abs(self.relation(x,y),abs(other.relation(x,y)) ]
 
.. note::
 
     Renders a dictionary with the key 'correlation' containing the actual bipolar correlation index and the key 'determination' containing the minimal determination level D of self and the other relation.
 
     D = sum_{x != y} min(abs(self.relation(x,y)),abs(other.relation(x,y)) / n(n-1)
 
     where n is the number of actions considered.
 
     The correlation index with a completely indeterminate relation
     is by convention 0.0 at determination level 0.0 .
 
.. warning::
 
     self must be a normalized outranking digraph instance !
computeOrdinalCorrelation(self, other, MedianCut=False, filterRelation=None, Debug=False)
Renders the bipolar correlation K of a
self.relation when compared
with a given compatible (same actions set)) digraph or
a [-1,1] valued compatible relation (same actions set).
 
If MedianCut=True, the correlation is computed on the median polarized relations.
 
If filterRelation is not None, the correlation is computed on the partial domain corresponding to the determined part of the filter relation.
 
.. warning::
 
     Notice that the 'other' relation and/or the 'filterRelation',
     the case given, must both be normalized, ie [-1,1]-valued !
 
K = sum_{x != y} [ min( max(-self.relation[x][y]),other.relation[x][y]), max(self.relation[x][y],-other.relation[x][y]) ]
 
K /= sum_{x!=y} [ min(abs(self.relation[x][y]),abs(other.relation[x][y])) ]
 
.. note::
 
     Renders a tuple with at position 0 the actual bipolar correlation index
     and in position 1 the minimal determination level D of self and
     the other relation.
 
     D = sum_{x != y} min(abs(self.relation[x][y]),abs(other.relation[x][y])) / n(n-1)
 
     where n is the number of actions considered.
 
     The correlation index with a completely indeterminate relation
     is by convention 0.0 at determination level 0.0 .
computeOrdinalCorrelationMP(self, other, MedianCut=False, Threading=False, nbrOfCPUs=None, startMethod=None, Comments=False, Debug=False)
Multi processing version of the digraphs.computeOrdinalCorrelation() method.
 
.. note::
     The relation filtering and the MedinaCut option are not implemented in the MP version.
computePairwiseClusterComparison(self, K1, K2, Debug=False)
Computes the pairwise cluster comparison credibility vector
from bipolar-valued digraph g. with K1 and K2 disjoint
lists of action keys from g actions disctionary.
Returns the dictionary
{'I': Decimal(),'P+':Decimal(),'P-':Decimal(),'R' :Decimal()}
where one and only one item is strictly positive.
computePreKernels(self)
computing dominant and absorbent preKernels:
    Result in self.dompreKernels and self.abspreKernels
computePreRankingRelation(self, preRanking, Normalized=True, Debug=False)
Renders the bipolar-valued relation obtained from
a given preRanking in decreasing levels (list of lists) result.
computePreorderRelation(self, preorder, Normalized=True, Debug=False)
Renders the bipolar-valued relation obtained from
a given preordering in increasing levels (list of lists) result.
computePrincipalOrder(self, Colwise=False, Comments=False)
Rendesr an ordering from wrost to best of the decision actions.
computePrincipalRanking(self, Colwise=False, Comments=False)
Rendesr a ranking from best to worst of the decision actions.
computePrincipalScores(self, plotFileName=None, Colwise=False, imageType=None, tempDir=None, bgcolor='cornsilk', Comments=False, Debug=False)
Renders a ordered list of the first principal eigenvector of the covariance of the valued outdegrees of self.
 
.. note::
 
   The method, relying on writing and reading temporary files by default in a temporary directory is threading and multiprocessing safe !
   (see Digraph.exportPrincipalImage method)
computePrudentBetaLevel(self, Debug=False)
computes alpha, ie the lowest valuation level, for which the
bipolarly polarised digraph doesn't contain a chordless circuit.
computeRankingByBestChoosing(self, CoDual=False, Debug=False)
Computes a weak preordering of the self.actions by recursive
best choice elagations.
 
Stores in self.rankingByBestChoosing['result'] a list of (P+,bestChoice) tuples
where P+ gives the best choice complement outranking
average valuation via the computePairwiseClusterComparison
method.
 
If self.rankingByBestChoosing['CoDual'] is True, 
the ranking-by-choosing was computed on the codual of self.
computeRankingByBestChoosingRelation(self, rankingByBestChoosing=None, Debug=False)
Renders the bipolar-valued relation obtained from
the self.rankingByBestChoosing result.
computeRankingByChoosing(self, actionsSubset=None, Debug=False, CoDual=False)
Computes a weak preordring of the self.actions by iterating
jointly first and last choice elagations.
 
Stores in self.rankingByChoosing['result'] a list of ((P+,bestChoice),(P-,worstChoice)) pairs
where P+ (resp. P-) gives the best (resp. worst) choice complement outranking
(resp. outranked) average valuation via the computePairwiseClusterComparison
method.
 
If self.rankingByChoosing['CoDual'] is True, the ranking-by-choosing was computed on the codual of self.
computeRankingByChoosingRelation(self, rankingByChoosing=None, actionsSubset=None, Debug=False)
Renders the bipolar-valued relation obtained from
the self.rankingByChoosing result.
computeRankingByLastChoosing(self, CoDual=False, Debug=False)
Computes a weak preordring of the self.actions by iterating
worst choice elagations.
 
Stores in self.rankingByLastChoosing['result'] a list of (P-,worstChoice) pairs
where P- gives the worst choice complement outranked
average valuation via the computePairwiseClusterComparison
method.
 
If self.rankingByChoosing['CoDual'] is True, the ranking-by-last-chossing 
was computed on the codual of self.
computeRankingByLastChoosingRelation(self, rankingByLastChoosing=None, Debug=False)
Renders the bipolar-valued relation obtained from
the self.rankingByLastChoosing result.
computeRankingCorrelation(self, ranking, Debug=False)
Renders the ordinal correlation K of a digraph instance
when compared with a given linear ranking of its actions
 
K = sum_{x != y} [ min( max(-self.relation(x,y)),other.relation(x,y), max(self.relation(x,y),-other.relation(x,y)) ]
 
K /= sum_{x!=y} [ min(abs(self.relation(x,y),abs(other.relation(x,y)) ]
 
.. note::
 
     Renders a tuple with at position 0 the actual bipolar correlation index
     and in position 1 the minimal determination level D of self and
     the other relation.
 
     D = sum_{x != y} min(abs(self.relation(x,y)),abs(other.relation(x,y)) / n(n-1)
 
     where n is the number of actions considered.
 
     The correlation index with a completely indeterminate relation
     is by convention 0.0 at determination level 0.0 .
computeRelationalStructure(self, Debug=False)
Renders the counted decomposition of the valued relations into
the following type of links:
gt '>', eq '=', lt '<', incomp '<>',
leq '<=', geq '>=', indeterm '?'
computeRubisChoice(self, Comments=False, _OldCoca=False, BrokenCocs=True, Threading=False, nbrOfCPUs=1)
Renders self.strictGoodChoices, self.nullChoices
self.strictBadChoices, self.nonRobustChoices.
 
.. warning::
    Changes in site the outranking digraph by
    adding or braking chordless odd outranking circuits.
computeRubyChoice(self, Comments=False, _OldCoca=False)
dummy for computeRubisChoice()
old versions compatibility.
computeShortestPathLengths(self, WeakPaths=False, Comments=False, Debug=False)
Renders a double dictionary with the directed distances, i.e. the shortest path lengths between all self.actions
 
Equals *None* if there does not exist a directed path between two actions.
 
*Source*: Claude Berge, *The Theory of Graphs*, Dover (2001) pp. 119, original in French Dunod (1958)
computeSingletonRanking(self, Comments=False, Debug=False)
Renders the sorted bipolar net determinatation of outrankingness
minus outrankedness credibilities of all singleton choices.
 
res = ((netdet,singleton,dom,absorb)+)
computeSize(self)
Renders the number of validated non reflexive arcs
computeSizeTransitiveClosure(self)
Renders the size of the transitive closure of a digraph.
computeSlaterOrder(self, isProbabilistic=False, seed=None, sampleSize=1000, Debug=False)
Reversed return from computeSlaterRanking method.
computeSlaterRanking(self, isProbabilistic=False, seed=None, sampleSize=1000, Debug=False)
Renders a ranking of the actions with minimal Slater index.
Return a tuple: slaterOrder, slaterIndex
computeSymmetryDegree(self, InPercents=False, Comments=False)
Renders the symmetry degree (Decimal) of the irreflexive part of a digraph.
 
.. note::
 
   Empty and indeterminate digraphs are considered to be symmetric.
computeTopologicalRanking(self, Debug=False)
Mimetic Wrapper of the topologicalSort() method.
computeTransitivityDegree(self, InPercents=False, Comments=False)
Renders the transitivity degree (Decimal) of a digraph.
 
.. note:: 
 
   An empty or indeterminate digraph is considered to be transitive.
computeUnrelatedPairs(self)
Renders a list of more or less unrelated pairs.
computeValuationLevels(self, choice=None, Debug=False)
renders the symmetric closure of the
apparent valuations levels of self
in an increasingly ordered list.
If parameter choice is given, the
computation is limited to the actions
of the choice.
computeValuationPercentages(self, choice, percentiles, withValues=False)
Parameters: choice and list of percentiles.
renders a series of percentages of the characteristics valuation of
the arcs in the digraph.
computeValuationPercentiles(self, choice, percentages, withValues=False)
Parameters: choice and list of percentages.
renders a series of quantiles of the characteristics valuation of
the arcs in the digraph.
computeValuationStatistics(self, Sampling=False, Comments=False)
Renders the mean and variance of the valuation
of the non reflexive pairs.
computeValuedRankingRelation(self, ranking)
Renders the valued relation characteristics compatible 
with the given linar ranking. Discordant charcateristics 
are set to the indeterminate value.
computeWeakCondorcetLosers(self)
Wrapper for weakCondorcetLosers().
computeWeakCondorcetWinners(self)
Wrapper for weakCondorcetWinners().
computeupdown1(self, s, S)
Help method for show_MIS_HB2 method.
fills self.newmisset, self.upmis, self.downmis.
computeupdown2(self, s, S)
Help method for show_MIS_HB1 method.
Fills self.newmisset, self.upmis, self.downmis.
computeupdown2irred(self, s, S)
Help method for show_MIS_HB1 method.
Fills self.newmisset, self.upmis, self.downmis.
condorcetLosers(self)
Renders the set of decision actions x such that
self.relation[x][y] < self.valuationdomain['med']
for all y != x.
condorcetWinners(self)
Renders the set of decision actions x such that
self.relation[x][y] > self.valuationdomain['med']
for all y != x.
contra(self, v)
Parameter: choice.
Renders the negation of a choice v characteristic's vector.
convertRelationToDecimal(self)
Converts the float valued self.relation in a decimal valued one.
convertValuation2Integer(self, InSite=True, Comments=False)
Converts the self.relation valuation to integer values by converting the Decimals to Fractions and multiply by the least commun multiple of the fraction denominators.
 
*Parameters*:
 
    - If *Insite* == False (True by default) the method returns a modified copy of self.relation without altering the original self.relation, otherwise self.relation and self.valuationdomain is modified.
convertValuationToDecimal(self)
Convert the float valuation limits to Decimals.
coveringIndex(self, choice, direction='out')
Renders the covering index of a given choice in a set of objects,
ie the minimum number of choice members that cover each
non selected object.
crispKDistance(self, digraph, Debug=False)
Renders the crisp Kendall distance between two bipolar valued
digraphs.
 
.. warning::
 
     Obsolete! Is replaced by the self.computeBipolarCorrelation(other, MedianCut=True) Digraph method
detectChordlessCircuits(self, Comments=False, Debug=False)
Detects a chordless circuit in a digraph.
Returns a Boolean
detectChordlessPath(self, Pk, n2, Comments=False, Debug=False)
New procedure from Agrum study April 2009
recursive chordless path extraction starting from path
Pk = [n2, ...., n1] and ending in node n2.
Optimized with marking of visited chordless P1s.
determinateness(self, vec, inPercent=True)
Renders the determinateness of a characteristic vector *vec* = 
[(r(x),x),(r(y),y), ...] of length *n* in valuationdomain [Min,Med,Max]:
 
*result* =  sum_x( abs(r(x)-Med) ) / ( n*(Max-Med) )
 
If inPercent, *result* shifted (+1) and reduced (/2) to [0,1] range.
digraph2Graph(self, valuationDomain={'min': -1, 'med': 0, 'max': 1}, Debug=False, ConjunctiveConversion=True)
Convert a Digraph instance to a Graph instance.
dneighbors(self, node)
Renders the set of dominated out-neighbors of a node.
domin(self, choice)
Renders the dominance degree of a choice.
dominantChoices(self, S)
Generates all minimal dominant choices of a bipolar valued digraph.
 
.. note::
 
     Initiate with S = self.actions.copy().
domirred(self, choice)
Renders the crips +irredundance degree of a choice.
domirredval(self, choice, relation)
Renders the valued +irredundance degree of a choice.
domirredx(self, choice, x)
Renders the crips +irredundance degree of node x in a choice.
domkernelrestrict(self, prekernel)
Parameter: dominant prekernel
Renders dominant prekernel restricted relation.
exportGraphViz(self, fileName=None, actionsSubset=None, bestChoice=set(), worstChoice=set(), firstChoice=set(), lastChoice=set(), Comments=True, graphType='png', pictureFormat=None, graphSize='7,7', relation=None, bgcolor='cornsilk')
export GraphViz dot file  for graph drawing filtering.
exportPrincipalImage(self, plotFileName=None, pictureFormat='pdf', bgcolor='cornsilk', fontcolor='red3', fontsize='0.75', Reduced=False, Colwise=False, tempDir='.', Comments=False)
Export as PDF (default) the principal projection of
the valued relation using the three principal eigen vectors.
 
Implemeted picture formats are: 
'pdf' (default), 'png', 'jpeg' and 'xfig'.
 
The background color is set by default to 'cornsilk'. 
 
Font size and color are set by default to 'red3', resp. '0.75'. 
 
When *Reduced==True*, the valued relation characeteristics are centered and reduced.
 
When *Colwise==True*, the column vectors of the adjacency table are used for the principal projection, otherwise the rows (default) are used. Has no incidence when the *Digraph* instance *self*  is symmetric. 
 
.. warning::
 
    The method, writing and reading temporary files: 
    tempCol.r and rotationCol.csv, resp. tempRow.r and rotationRow.csv,
    by default in the working directory (./),
    is hence not safe for multiprocessing programs, unless a
    temporary directory *tempDir* is provided.
flatChoice(self, ch, Debug=False)
Converts set or list ch recursively to a flat list of items.
forcedBestSingleChoice(self)
Renders the set of most determined outranking singletons in self.
gammaSets(self)
Renders the dictionary of neighborhoods {node: (dx,ax)}
with set *dx* gathering the dominated, and set *ax* gathering
the absorbed neighborhood.
generateAbsPreKernels(self)
Generate all absorbent prekernels from independent choices generator.
generateDomPreKernels(self)
Generate all dominant prekernels from independent choices generator.
htmlChoiceVector(self, ch, ChoiceVector=True, choiceType='good')
Show procedure for annotated bipolar choices.
inDegrees(self)
renders the median cut indegrees
inDegreesDistribution(self)
Renders the distribution of indegrees.
independentChoices(self, U)
Generator for all independent choices with neighborhoods of a bipolar valued digraph:
 
.. note::
 
       * Initiate with U = self.singletons().
       * Yields [(independent choice, domnb, absnb, indnb)].
inner_prod(self, v1, v2)
Parameters: two choice characteristic vectors
Renders the inner product of two characteristic vetors.
intstab(self, choice)
Computes the independence degree of a choice.
irreflex(self, mat)
Puts diagonal entries of mat to valuationdomain['min']
isAsymmetricIndeterminate(self, Debug=False)
Checks the self.relation for assymmetric indeterminateness!!
 
.. warning::
 
    The reflexive links are ignored !!
isComplete(self, Debug=False)
checks the completeness property of self.relation by checking
for the absence of a link between two actions!!
 
.. warning::
 
    The reflexive links are ignored !!
isCyclic(self, Debug=False)
checks the cyclicity of self.relation by checking
for a reflexive loop in its transitive closure-
 
.. warning::
 
     self.relation is supposed to be irreflexive !
isIntegerValued(self, Debug=False)
Checks whether the decimal valuation of self is integer-valued
be using the as_integer_ratio() method of a Decimal 
giving a tuple (numerator,denominator). If denominator == 1, the
number is an integer.
isOutrankingDigraph(self, Comments=True, Debug=False)
Checks the outranking digraph characteristic condition (3.3).
 
relation[x][y] + relation[y][x)[y] >= 0.0
 
.. warning::
 
    The reflexive links are ignored and the valuation must be bipolar !!
isStrictOutrankingDigraph(self, Comments=True, Debug=False)
Checks the strict outranking digraph characteristic condition (3.1).
 
-(relation[x][y] + relation[y][x]) <= 0.0 , x != y
 
.. warning::
 
    The reflexive links are ignored and the valuation must be bipolar !!
isSymmetric(self, Comments=False)
True if symmetry degree == 1.0.
isTransitive(self, Comments=False)
True if transitivity degree == 1.0.
isWeaklyComplete(self, Debug=False)
checks the weakly completeness property of self.relation by checking
for the absence of a link between two actions!!
 
.. warning::
 
    The reflexive links are ignored !!
iterateRankingByChoosing(self, Odd=False, CoDual=False, Comments=True, Debug=False, Limited=None)
Renders a ranking by choosing result when progressively eliminating
all chordless (odd only) circuits with rising valuation cut levels.
 
Parameters
    CoDual = False (default)/True
    Limited = proportion (in [0,1]) * (max - med) valuationdomain
kChoices(self, A, k)
Renders all choices of length k from set A
matmult2(self, m, v)
Parameters: digraph relation and choice characteristic vector
matrix multiply vector by inner production
meanDegree(self)
Renders the mean degree of self.
!!! self.size must be set previously !!!
meanLength(self, Oriented=False)
Renders the (by default non-oriented) mean neighbourhoor depth of self.
!!! self.order must be set previously !!!
minimalChoices(self, S)
Generates all dominant or absorbent choices of a bipolar
valued digraph.
 
.. note:
 
   * Initiate with S = (actions, dict of dominant or absorbent closed neighborhoods)
   * See showMinDom and showMinAbs methods.
minimalValuationLevelForCircuitsElimination(self, Odd=True, Debug=False, Comments=False)
renders the minimal valuation level <lambda> that eliminates all
self.circuitsList stored odd chordless circuits from self.
 
.. warning::
 
    The <lambda> level polarised may still contain newly appearing chordless odd circuits !
neighbourhoodCollection(self, Oriented=False, Potential=False)
Renders the neighbourhood.
neighbourhoodDepthDistribution(self, Oriented=False)
Renders the distribtion of neighbourhood depths.
notGammaSets(self)
Renders the dictionary of neighborhoods {node: (dx,ax)}
with set *dx* gathering the not dominated, and set *ax* gathering
the not absorbed neighborhood.
notaneighbors(self, node)
Renders the set of absorbed not in-neighbors of a node.
notdneighbors(self, node)
Renders the set of not dominated out-neighbors of a node.
outDegrees(self)
renders the median cut outdegrees
outDegreesDistribution(self)
Renders the distribution of outdegrees.
plusirredundant(self, U)
Generates all +irredundant choices of a digraph.
powerset(self, U)
Generates all subsets of a set.
readPerrinMisset(self, file='curd.dat')
read method for 0-1-char-coded MISs by default from the perrinMIS.c curd.dat result file.
readabsvector(self, x, relation)
Parameter: action x
absorbent in vector.
readdomvector(self, x, relation)
Parameter: action x
dominant out vector.
recodeValuation(self, newMin=-1.0, newMax=1.0, ndigits=4, Debug=False)
Recodes the characteristic valuation domain according
to the parameters given. 
 
*ndigits* indicates the number of decimal digits of the valuation.
relationFct(self, x, y)
wrapper for self.relation dictionary access to ensure interoperability
with the sparse and big outranking digraph implementation model.
save(self, fileName='tempdigraph', option=None, DecimalValuation=True, decDigits=2)
Persistent storage of a Digraph class instance in the form of
a python source code file
saveCSV(self, fileName='tempdigraph', Normalized=False, Dual=False, Converse=False, Diagonal=False, Debug=False)
Persistent storage of a Digraph class instance in the form of
a csv file.
saveXMCDA2(self, fileName='temp', fileExt='xmcda2', Comments=True, relationName='R', relationType='binary', category='random', subcategory='valued', author='digraphs Module (RB)', reference='saved from Python', valuationType='standard', digits=2, servingD3=False)
save digraph in XMCDA 2.0 format. Deprecated now.
savedre(self, fileName='temp')
save digraph in nauty format.
sharp(self, x, y)
Paramaters: choice characteristic values.
Renders the sharpest of two characteristic values x and y.
sharpvec(self, v, w)
Paramaters: choice characteristic vectors.
Renders the sharpest of two characteristic vectors v and w.
showActions(self)
presentation methods for digraphs actions
showAll(self)
Detailed show method for genuine digraphs.
showAttributes(self)
Prints out the attributes of self.
showAutomorphismGenerators(self)
Renders the generators of the automorphism group.
showBadChoices(self, Recompute=True)
Characteristic values for potentially bad choices.
showBestChoiceRecommendation(self, Verbose=False, Comments=True, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True)
Shows the RuBis best choice recommendation.
 
.. note::
 
    Computes by default the Rubis best choice recommendation on the corresponding strict (codual) outranking digraph.
 
    By default, with BrokenCocs=True, we brake all chordless circuits at their weakest determined ( abs(r(x>y)) + abs(r(y>x)) ) link.
 
    When BrokenCocs=False we proceed like follows:
 
    In case of chordless circuits, if supporting arcs are more credible
    than the reversed negating arcs, we collapse the circuits into hyper nodes.
    Inversely,  if supporting arcs are not more credible than the reversed negating arcs,
    we brake the circuits on their weakest arc.
 
Usage example:
 
>>> from outrankingDigraphs import *
>>> t = Random3ObjectivesPerformanceTableau(seed=5)
>>> g = BipolarOutrankingDigraph(t)
>>> g.showBestChoiceRecommendation()
***********************
RuBis Best Choice Recommendation (BCR)
(in decreasing order of determinateness)   
Credibility domain:  [-100.0, 100.0]
=== >> potential first choices
* choice              : ['a04', 'a14', 'a19', 'a20']
   independence        : 1.19
   dominance           : 4.76
   absorbency          : -59.52
   covering (%)        : 75.00
   determinateness (%) : 57.86
   - most credible action(s) = { 'a14': 23.81, 'a19': 11.90, 'a04': 2.38, 'a20': 1.19, }  
=== >> potential last choices 
* choice              : ['a03', 'a12', 'a17']
  independence        : 4.76
  dominance           : -76.19
  absorbency          : 4.76
  covering (%)        : 0.00
  determinateness (%) : 65.39
  - most credible action(s) = { 'a03': 38.10, 'a12': 13.10, 'a17': 4.76, }
Execution time: 0.024 seconds
*****************************
showChoiceVector(self, ch, choiceType='good', ChoiceVector=True)
Show procedure for annotated bipolar choices.
showChordlessCircuits(self, Recompute=False)
Show method for chordless circuits observed in a Digraph instance.
 
If previous computation is required, stores the detected circuits in self.circuitsList attribute.
showCorrelation(self, corr=None, ndigits=3)
Renders the valued ordinal correlation index, the crisp Kendall tau index and their epistemic determination degree.
showFirstChoiceRecommendation(self, Verbose=False, Comments=True, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True)
Shows the RuBis first choice recommendation.
 
.. note::
 
    Computes by default the Rubis first choice recommendation on the corresponding strict (codual) outranking digraph.
 
    By default, with BrokenCocs=True, we brake all chordless circuits at their weakest determined ( abs(r(x>y)) + abs(r(y>x)) ) link.
 
    When BrokenCocs=False we proceed like follows:
 
    In case of chordless circuits, if supporting arcs are more credible
    than the reversed negating arcs, we collapse the circuits into hyper nodes.
    Inversely,  if supporting arcs are not more credible than the reversed negating arcs,
    we brake the circuits on their weakest arc.
 
Usage example:
 
>>> from outrankingDigraphs import *
>>> t = Random3ObjectivesPerformanceTableau(seed=5)
>>> g = BipolarOutrankingDigraph(t)
>>> g.showFirstChoiceRecommendation()
***********************
RuBis First Choice Recommendation (BCR)
(in decreasing order of determinateness)   
Credibility domain:  [-100.0, 100.0]
=== >> potential first choices
* choice              : ['a04', 'a14', 'a19', 'a20']
   independence        : 1.19
   dominance           : 4.76
   absorbency          : -59.52
   covering (%)        : 75.00
   determinateness (%) : 57.86
   - most credible action(s) = { 'a14': 23.81, 'a19': 11.90, 'a04': 2.38, 'a20': 1.19, }  
=== >> potential last choices 
* choice              : ['a03', 'a12', 'a17']
  independence        : 4.76
  dominance           : -76.19
  absorbency          : 4.76
  covering (%)        : 0.00
  determinateness (%) : 65.39
  - most credible action(s) = { 'a03': 38.10, 'a12': 13.10, 'a17': 4.76, }
Execution time: 0.024 seconds
*****************************
showGoodChoices(self, Recompute=True)
Characteristic values for potentially good choices.
showHTMLBestChoiceRecommendation(self, pageTitle=None, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True, htmlFileName=None)
showHTMLRelationHeatmap(self, actionsList=None, rankingRule='NetFlows', colorLevels=7, tableTitle='Relation Heatmap', relationName='r(x S y)', ndigits=2, fromIndex=None, toIndex=None, htmlFileName=None)
Launches a browser window with the colored relation map of self.
 
See corresponding :py:class:`~digraphs.Digraph.showHTMLRelationMap` method.
 
The *colorLevels* parameter may be set to 3, 5, 7 (default) or 9.
 
When the *actionsList* parameter is *None* (default), the digraphs actions list may be ranked with the *rankingRule* parameter set to the 'Copeland' (default) or to the 'Netlows' ranking rule.
 
When the *htmlFileName* parameter is set to a string value 'xxx', a html file named 'xxx.html' will be generated in the current working directory. Otherwise, a temporary file named 'tmp*.html' will be generated there.
 
Example::
 
    >>> from outrankingDigraphs import *
    >>> t = RandomCBPerformanceTableau(numberOfActions=25,seed=1)
    >>> g = BipolarOutrankingDigraph(t,ndigits=2)
    >>> gcd = ~(-g)  # strict outranking relation
    >>> gcd.showHTMLRelationHeatmap(colorLevels=7,ndigits=2)
    
.. image:: relationHeatmap.png
   :alt: Browser view of a relation map
   :width: 600 px
   :align: center
showHTMLRelationMap(self, actionsList=None, rankingRule='Copeland', Colored=True, tableTitle='Relation Map', relationName='r(x S y)', symbols=['+', '&middot;', '&nbsp;', '&#150;', '&#151'], fromIndex=None, toIndex=None, htmlFileName=None)
Launches a browser window with the colored relation map of self.
See corresponding Digraph.showRelationMap() method.
 
When *htmlFileName* parameter is set to a string value, a html file
with that name will be stored in the current working directory.
 
By default, a temporary file named: tmp*.html will be generated
instead in the current working directory.
 
Example::
 
    >>> from outrankingDigraphs import *
    >>> t = RandomCBPerformanceTableau(numberOfActions=25,seed=1)
    >>> g = BipolarOutrankingDigraph(t,Normalized=True)
    >>> gcd = ~(-g)  # strict outranking relation
    >>> gcd.showHTMLRelationMap(rankingRule="NetFlows")
    
.. image:: relationMap.png
   :alt: Browser view of a relation map
   :width: 600 px
   :align: center
showHTMLRelationTable(self, actionsList=None, relation=None, IntegerValues=False, ndigits=2, Colored=True, tableTitle='Valued Adjacency Matrix', relationName='r(x S y)', ReflexiveTerms=False, htmlFileName=None, fromIndex=None, toIndex=None)
Launches a browser window with the colored relation table of self.
showMIS(self, withListing=True)
Prints all maximal independent choices:
    Result in self.misset.
showMIS_AH(self, withListing=True)
Prints all MIS using the Hertz method.
 
Result saved in self.hertzmisset.
showMIS_HB2(self, withListing=True)
Prints all MIS using the Hertz-Bisdorff method.
 
Result saved in self.newmisset.
showMIS_RB(self, withListing=True)
Prints all MIS using the Bisdorff method.
 
Result saved in self.newmisset.
showMIS_UD(self, withListing=True)
Prints all MIS using the Hertz-Bisdorff method.
 
Result saved in self.newmisset.
showMaxAbsIrred(self, withListing=True)
Computing maximal -irredundant choices:
    Result in self.absirset.
showMaxDomIrred(self, withListing=True)
Computing maximal +irredundant choices:
   Result in self.domirset.
showMinAbs(self, withListing=True)
Prints minimal absorbent choices:
    Result in self.absset.
showMinDom(self, withListing=True)
Prints all minimal dominant choices:
    Result in self.domset.
showNeighborhoods(self)
Lists the gamma and the notGamma function of self.
showOrbits(self, InChoices, withListing=True)
Prints the orbits of Choices along the automorphisms of
the Digraph instance.
 
Example Python session for computing the non isomorphic MISs from the 12-cycle graph:
 
>>> from digraphs import *
>>> c12 = CirculantDigraph(order=12,circulants=[1,-1])
>>> c12.automorphismGenerators()
...
  Permutations
  {'1': '1', '2': '12', '3': '11', '4': '10', '5': 
   '9', '6': '8', '7': '7', '8': '6', '9': '5', '10': 
   '4', '11': '3', '12': '2'}
  {'1': '2', '2': '1', '3': '12', '4': '11', '5': '10', 
   '6': '9', '7': '8', '8': '7', '9': '6', '10': '5', 
   '11': '4', '12': '3'}
  Reflections {}
>>> print('grpsize = ', c12.automorphismGroupSize)
  grpsize = 24
>>> c12.showMIS(withListing=False)
  *---  Maximal independent choices ---*
  number of solutions:  29
  cardinality distribution
  card.:  [0, 1, 2, 3, 4,  5,  6, 7, 8, 9, 10, 11, 12]
  freq.:  [0, 0, 0, 0, 3, 24,  2, 0, 0, 0,  0,  0,  0]
  Results in c12.misset
>>> c12.showOrbits(c12.misset,withListing=False)
...
  *---- Global result ----
  Number of MIS:  29
  Number of orbits :  4
  Labelled representatives:
  1: ['2','4','6','8','10','12']
  2: ['2','5','8','11']
  3: ['2','4','6','9','11']
  4: ['1','4','7','9','11']
  Symmetry vector
  stabilizer size: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, ...]
  frequency      : [0, 2, 0, 0, 0, 0, 0, 1, 0,  0,  0,  1, ...]
 
*Figure*: The symmetry axes of the non isomorphic MISs of the 12-cycle:
 
.. image:: c12.png
   :width: 400 px
   :align: center
   :alt: The 4 non isomorphic MIS of the 12-cycle graph
 
*Reference*: R. Bisdorff and J.L. Marichal (2008). Counting non-isomorphic maximal independent sets of the n-cycle graph. *Journal of Integer Sequences*, Vol. 11 Article 08.5.7 (`openly accessible here <https://www.cs.uwaterloo.ca/journals/JIS/VOL11/Marichal/marichal.html>`_)
showOrbitsFromFile(self, InFile, withListing=True)
Prints the orbits of Choices along the automorphisms of
the digraph self by reading in the 0-1 misset file format.
See the :py:func:`digraphs.Digraph.readPerrinMisset` method.
showPreKernels(self, withListing=True)
Printing dominant and absorbent preKernels:
    Result in self.dompreKernels and self.abspreKernels
showRankingByBestChoosing(self, rankingByBestChoosing=None)
A show method for self.rankinByBestChoosing result.
 
.. warning::
 
     The self.computeRankingByBestChoosing(CoDual=False/True) method instantiating the self.rankingByBestChoosing slot is pre-required !
showRankingByChoosing(self, rankingByChoosing=None, WithCoverCredibility=False)
A show method for self.rankinByChoosing result.
 
When parameter *WithCoverCredibility* is set to True, the credibility of outranking, respectively being outranked is indicated at each selection step. 
 
.. warning::
 
     The self.computeRankingByChoosing(CoDual=False/True) method instantiating the self.rankingByChoosing slot is pre-required !
showRankingByLastChoosing(self, rankingByLastChoosing=None, Debug=None)
A show method for self.rankinByChoosing result.
 
.. warning::
 
     The self.computeRankingByLastChoosing(CoDual=False/True) method instantiating the self.rankingByChoosing slot is pre-required !
showRelation(self)
prints the relation valuation in ##.## format.
showRelationMap(self, symbols=None, rankingRule='Copeland', fromIndex=None, toIndex=None, actionsList=None)
Prints on the console, in text map format, the location of
certainly validated and certainly invalidated outranking situations.
 
By default, symbols = {'max':'┬','positive': '+', 'median': ' ',
                       'negative': '-', 'min': '┴'}
 
The default ordering of the output is following the Copeland ranking rule
from best to worst actions. Further available ranking rule is the 'NetFlows' net flows rule.
 
 
Example::
 
    >>> from outrankingDigraphs import *
    >>> t = RandomCBPerformanceTableau(numberOfActions=25,seed=1)
    >>> g = BipolarOutrankingDigraph(t,Normalized=True)
    >>> gcd = ~(-g)  # strict outranking relation
    >>> gcd.showRelationMap(rankingRule="NetFlows")
     -   ++++++++  +++++┬+┬┬+
    - -   + +++++ ++┬+┬+++┬++
    ┴+  ┴ + ++  ++++┬+┬┬++┬++
    -   ++ - ++++-++++++┬++┬+
       - - - ++- ┬- + -+┬+-┬┬
    -----  -      -┬┬┬-+  -┬┬
    ----    --+-+++++++++++++
    -- --+- --++ ++ +++-┬+-┬┬
    ----  -  -+-- ++--+++++ +
    ----- ++- --- +---++++┬ +
    -- -- ---+ -++-+++-+ +-++
    -- --┴---+  + +-++-+ -  +
    ---- ┴---+-- ++--++++ - +
      --┴┴--  --- -  --+ --┬┬
     ---------+--+ ----- +-┬┬
    -┴---┴- ---+- + ---+++┬ +
    -┴┴--┴---+--- ++ -++--+++
    -----┴--- ---+-+- ++---+ 
    -┴┴--------------- --++┬ 
    --┴---------------- --+┬ 
    ┴--┴┴ -┴--┴┴-┴ --++  ++-+
    ----┴┴--------------- -  
    ┴┴┴----+-┴+┴---┴-+---+ ┴+
    ┴┴-┴┴┴-┴- - -┴┴---┴┴+ ┬ -
    ----┴┴-┴-----┴┴---  - -- 
    Ranking rule: NetFlows
    >>>
showRelationTable(self, Sorted=True, rankingRule=None, IntegerValues=False, actionsSubset=None, relation=None, ndigits=2, ReflexiveTerms=True, fromIndex=None, toIndex=None)
Prints the relation valuation in actions X actions table format.
Copeland and NetFlows rankings my be used.
showRubisBestChoiceRecommendation(self, **kwargs)
Dummy for backward portable showBestChoiceRecommendation().
showRubyChoice(self, Verbose=False, Comments=True, _OldCoca=True)
Dummy for showBestChoiceRecommendation()
needed for older versions compatibility.
showShort(self)
concise presentation method for genuine digraphs.
showSingletonRanking(self, Comments=True, Debug=False)
Calls self.computeSingletonRanking(comments=True,Debug = False).
Renders and prints the sorted bipolar net determinatation of outrankingness
minus outrankedness credibilities of all singleton choices.
 
res = ((netdet,sigleton,dom,absorb)+)
showStatistics(self)
Computes digraph statistics like order, size and arc-density.
showdre(self)
Shows relation in nauty format.
singletons(self)
list of singletons and neighborhoods
[(singx1, +nx1, -nx1, not(+nx1 or -nx1)),.... ]
sizeSubGraph(self, choice)
Output: (size, undeterm,arcDensity).
Renders the arc density of the induced subgraph.
strongComponents(self, setPotential=False)
Renders the set of strong components of self.
symDegreesDistribution(self)
Renders the distribution of symmetric degrees.
topologicalSort(self, Debug=False)
If self is acyclic, adds topological sort number to each node of self
and renders ordered list of nodes. Otherwise renders None.
Source: M. Golumbic Algorithmic Graph heory and Perfect Graphs,
Annals Of Discrete Mathematics 57 2nd Ed. , Elsevier 2004, Algorithm 2.4 p.44.
weakAneighbors(self, node)
Renders the set of absorbed in-neighbors of a node.
weakCondorcetLosers(self)
Renders the set of decision actions x such that
self.relation[x][y] <= self.valuationdomain['med']
for all y != x.
weakCondorcetWinners(self)
Renders the set of decision actions x such that
self.relation[x][y] >= self.valuationdomain['med']
for all y != x.
weakDneighbors(self, node)
Renders the set of dominated out-neighbors of a node.
weakGammaSets(self)
Renders the dictionary of neighborhoods {node: (dx,ax)}
zoomValuation(self, zoomFactor=1.0)
Zooms in or out, depending on the value of the zoomFactor provided,
the bipolar valuation of a digraph.

Data descriptors inherited from Digraph:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class CompleteDigraph(Digraph)
    CompleteDigraph(order=5, valuationdomain=(-1.0, 1.0))
 
Specialization of the general Digraph class for generating
temporary complete graphs of order 5 in {-1,0,1} by default.
 
Parameters:
    order > 0; valuationdomain=(Min,Max).
 
 
Method resolution order:
CompleteDigraph
Digraph
builtins.object

Methods defined here:
__init__(self, order=5, valuationdomain=(-1.0, 1.0))
Initialize self.  See help(type(self)) for accurate signature.

Methods inherited from Digraph:
MISgen(self, S, I)
generator of maximal independent choices (voir Byskov 2004):
    * S ::= remaining nodes;
    * I ::= current independent choice
 
.. note::
 
        Inititalize: self.MISgen(self.actions.copy(),set())
__invert__(self)
Make the inverting operator ~self available for Digraph instances. 
 
Returns a ConverseDigraph instance of self.
__neg__(self)
Make the negation operator -self available for Digraph instances. 
 
Returns a DualDigraph instance of self.
__repr__(self)
Default presentation method for Digraph instances.
absirred(self, choice)
Renders the crips -irredundance degree of a choice.
absirredundant(self, U)
Generates all -irredundant choices of a digraph.
absirredval(self, choice, relation)
Renders the valued -irredundance degree of a choice.
absirredx(self, choice, x)
Computes the crips -irredundance degree of node x in a choice.
abskernelrestrict(self, prekernel)
Parameter: prekernel
Renders absorbent prekernel restricted relation.
absorb(self, choice)
Renders the absorbency degree of a choice.
absorbentChoices(self, S)
Generates all minimal absorbent choices of a bipolar valued digraph.
addValuationAttribute(self)
Adds the numpy valuation attribute
agglomerationDistribution(self)
Output: aggloCoeffDistribution, meanCoeff
Renders the distribution of agglomeration coefficients.
aneighbors(self, node)
Renders the set of absorbed in-neighbors of a node.
automorphismGenerators(self)
Adds automorphism group generators to the digraph instance.
 
.. note::
 
    Dependency: Uses the dreadnaut command from the nauty software package. See https://www3.cs.stonybrook.edu/~algorith/implement/nauty/implement.shtml
 
    On Ubuntu Linux:
      ...$ sudo apt-get install nauty
averageCoveringIndex(self, choice, direction='out')
Renders the average covering index of a given choice in a set of objects,
ie the average number of choice members that cover each
non selected object.
bipolarKCorrelation(self, digraph, Debug=False)
Renders the bipolar Kendall correlation between two bipolar valued
digraphs computed from the average valuation of the
XORDigraph(self,digraph) instance.
 
.. warning::
 
     Obsolete! Is replaced by the self.computeBipolarCorrelation(other) Digraph method
bipolarKDistance(self, digraph, Debug=False)
Renders the bipolar crisp Kendall distance between two bipolar valued
digraphs.
 
.. warning::
 
     Obsolete! Is replaced by the self.computeBipolarCorrelation(other, MedianCut=True) Digraph method
chordlessPaths(self, Pk, n2, Odd=False, Comments=False, Debug=False)
New procedure from Agrum study April 2009
recursive chordless path extraction starting from path
Pk = [n2, ...., n1] and ending in node n2.
Optimized with marking of visited chordless P1s.
circuitAverageCredibility(self, circ)
Renders the average linking credibility of a Chordless Circuit.
circuitCredibilities(self, circuit, Debug=False)
Renders the average linking credibilities and the minimal link of a Chordless Circuit.
circuitMaxCredibility(self, circ)
Renders the maximal linking credibility of a Chordless Circuit.
circuitMinCredibility(self, circ)
Renders the minimal linking credibility of a Chordless Circuit.
closeSymmetric(self, InSite=True)
Produces the symmetric closure of self.relation.
closeTransitive(self, Reverse=False, InSite=True, Comments=False)
Produces the transitive closure of self.relation
 
*Parameters*:
 
    - If *Reverse* == True (False default) all transitive links are dropped, otherwise all transitive links are closed with min[r(x,y),r(y,z)];
    - If *Insite* == False (True by default) the methods return a modified copy of self.relation without altering the original self.relation, otherwise self.relation is modified.
components(self)
Renders the list of connected components.
computeAllDensities(self, choice=None)
parameter: choice in self
renders six densitiy parameters:
arc density, double arc density,
single arc density, strict single arc density,
absence arc density, strict absence arc densitiy.
computeArrowRaynaudOrder(self)
Renders a linear ordering from worst to best of the actions following Arrow&Raynaud's rule.
computeArrowRaynaudRanking(self)
renders a linear ranking from best to worst of the actions following Arrow&Raynaud's rule.
computeAverageValuation(self)
Computes the bipolar average correlation between
self and the crisp complete digraph of same order
of the irreflexive and determined arcs of the digraph
computeBadChoices(self, Comments=False)
Computes characteristic values for potentially bad choices.
 
.. note::
 
     Returns a tuple with following content:
 
     [(0)-determ,(1)degirred,(2)degi,(3)degd,(4)dega,(5)str(choice),(6)absvec]
computeBadPirlotChoices(self, Comments=False)
Characteristic values for potentially bad choices
using the Pirlot's fixpoint algorithm.
computeBestChoiceRecommendation(self, Verbose=False, Comments=False, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True)
Sets self.bestChoice, self.bestChoiceData, self.worstChoice and self.worstChoiceData
with the showBestChoiceRecommendation method.
 
First and last choices data is the following:
[(0)-determ,(1)degirred,(2)degi,(3)degd,(4)dega,(5)str(choice),(6)domvec,(7)cover]
 
self.bestChoice = self.bestChoiceData[5]
self.worstChoice = self.worstChoiceData[5]
computeBipolarCorrelation(self, other, MedianCut=False, filterRelation=None, Debug=False)
obsolete: dummy replacement for Digraph.computeOrdinalCorrelation method
computeChordlessCircuits(self, Odd=False, Comments=False, Debug=False)
Renders the set of all chordless circuits detected in a digraph.
Result is stored in <self.circuitsList>
holding a possibly empty list of tuples with at position 0 the
list of adjacent actions of the circuit and at position 1
the set of actions in the stored circuit.
 
When *Odd* is True, only chordless circuits with an odd length
are collected.
computeChordlessCircuitsMP(self, Odd=False, Threading=False, nbrOfCPUs=None, startMethod=None, Comments=False, Debug=False)
Multiprocessing version of computeChordlessCircuits().
 
Renders the set of all chordless odd circuits detected in a digraph.
Result (possible empty list) stored in <self.circuitsList>
holding a possibly empty list tuples with at position 0 the
list of adjacent actions of the circuit and at position 1
the set of actions in the stored circuit.
Inspired by Dias, Castonguay, Longo, Jradi, Algorithmica (2015).
 
Returns a possibly empty list of tuples (circuit,frozenset(circuit)).
 
If Odd == True, only circuits of odd length are retained in the result.
computeCoSize(self)
Renders the number of non validated non reflexive arcs
computeConcentrationIndex(self, X, N)
Renders the Gini concentration index of the X serie.
N contains the partial frequencies.
Based on the triangle summation formula.
computeConcentrationIndexTrapez(self, X, N)
Renders the Gini concentration index of the X serie.
N contains the partial frequencies.
Based on the triangles summation formula.
computeCondorcetLosers(self)
Wrapper for condorcetLosers().
computeCondorcetWinners(self)
Wrapper for condorcetWinners().
computeCopelandOrder(self)
renders a linear ordering from worst to best of the actions following Arrow&Raynaud's rule.
computeCopelandRanking(self)
renders a linear ranking from best to worst of the actions following Arrow&Raynaud's rule.
computeCutLevelDensities(self, choice, level)
parameter: choice in self, robustness level
renders three robust densitiy parameters:
robust double arc density,
robust single arc density,
robust absence arc densitiy.
computeDensities(self, choice)
parameter: choice in self
renders the four densitiy parameters:
arc density, double arc density, single arc density, absence arc density.
computeDeterminateness(self, InPercents=False)
Computes the Kendalll distance of self
with the all median-valued indeterminate digraph of order n.
 
Return the average determination of the irreflexive part of the digraph.
 
*determination* = sum_(x,y) { abs[ r(xRy) - Med ] } / n(n-1)
 
If *InPercents* is True, returns the average determination in percentage of
(Max - Med) difference.
 
>>> from outrankingDigraphs import BipolarOutrankingDigraph
>>> from randomPerfTabs import Random3ObjectivesPerformanceTableau
>>> t = Random3ObjectivesPerformanceTableau(numberOfActions=7,numberOfCriteria=7,seed=101)
>>> g = BipolarOutrankingDigraph(t,Normalized=True)
>>> g
*------- Object instance description ------*
Instance class      : BipolarOutrankingDigraph
Instance name       : rel_random3ObjectivesPerfTab
Actions             : 7
Criteria            : 7
Size                : 27
Determinateness (%) : 65.67
Valuation domain    : [-1.00;1.00]
>>> print(g.computeDeterminateness())
0.3134920634920634920634920638
>>> print(g.computeDeterminateness(InPercents=True))
65.67460317460317460317460320
>>> g.recodeValuation(0,1)
>>> g
*------- Object instance description ------*
Instance class      : BipolarOutrankingDigraph
Instance name       : rel_random3ObjectivesPerfTab
Actions             : 7
Criteria            : 7
Size                : 27
Determinateness (%) : 65.67
Valuation domain    : [0.00;1.00]
>>> print(g.computeDeterminateness())
0.1567460317460317460317460318
>>> print(g.computeDeterminateness(InPercents=True))
65.67460317460317460317460320
computeDiameter(self, Oriented=True)
Renders the (by default oriented) diameter of the digraph instance
computeDigraphCentres(self, WeakDistances=False, Comments=False)
The centers of a digraph are the nodes with finite minimal shortes path lengths.
 
The maximal neighborhood distances are stored in *self.maximalNeighborhoodDistances*.
 
The corresponding digraph radius and diameter are stored respectively  in *self.radius* and *self.diameter*.
 
With *Comments* = True, all these results are printed out.
 
*Source*: Claude Berge, *The Theory of Graphs*, Dover (2001) pp. 119, original in French Dunod (1958)
computeDynamicProgrammingStages(self, source, sink, Debug=False)
Renders the discrete stages of the optimal substructure for
dynamic pogramming digrahs from a given source node 
to a given sink sink node.
 
Returns a list of list of action identifyers.
computeGoodChoiceVector(self, ker, Comments=False)
| Computing Characteristic values for dominant pre-kernels
| using the von Neumann dual fixoint equation
computeGoodChoices(self, Comments=False)
Computes characteristic values for potentially good choices.
 
..note::
 
     Return a tuple with following content:
 
     [(0)-determ,(1)degirred,(2)degi,(3)degd,(4)dega,(5)str(choice),(6)domvec,(7)cover]
computeGoodPirlotChoices(self, Comments=False)
Characteristic values for potentially good choices
using the Pirlot fixpoint algorithm.
computeIncomparabilityDegree(self, InPercents=False, Comments=False)
Renders the incomparability degree (Decimal), i.e. the relative number of symmetric indeterminate relations of the irreflexive part of a digraph.
computeKemenyIndex(self, otherRelation)
renders the Kemeny index of the self.relation
compared with a given crisp valued relation of a compatible
other digraph (same nodes or actions).
computeKemenyOrder(self, orderLimit=7, Debug=False)
Renders a ordering from worst to best of the actions with maximal Kemeny index.
Return a tuple: kemenyOrder (from worst to best), kemenyIndex
computeKemenyRanking(self, orderLimit=7, seed=None, sampleSize=1000, Debug=False)
Renders a ranking from best to worst of the actions with maximal Kemeny index.
 
.. note::
 
     Returns a tuple: kemenyRanking (from best to worst), kemenyIndex.
computeKernelVector(self, kernel, Initial=True, Comments=False)
| Computing Characteristic values for dominant pre-kernels
| using the von Neumann dual fixpoint equation
computeKohlerOrder(self)
Renders an ordering (worst to best) of the actions following Kohler's rule.
computeKohlerRanking(self)
Renders a ranking (best to worst) of the actions following Kohler's rule.
computeMaxHoleSize(self, Comments=False)
Renders the length of the largest chordless cycle
in the corresponding disjunctive undirected graph.
computeMeanInDegree(self)
Renders the mean indegree of self.
!!! self.size must be set previously !!!
computeMeanOutDegree(self)
Renders the mean degree of self.
!!! self.size must be set previously !!!
computeMeanSymDegree(self)
Renders the mean degree of self.
!!! self.size must be set previously !!!
computeMedianOutDegree(self)
Renders the median outdegree of self.
!!! self.size must be set previously !!!
computeMedianSymDegree(self)
Renders the median symmetric degree of self.
!!! self.size must be set previously !!!
computeMoreOrLessUnrelatedPairs(self)
Renders a list of more or less unrelated pairs.
computeNetFlowsOrder(self)
Renders an ordered list (from best to worst) of the actions
following the net flows ranking rule.
computeNetFlowsOrderDict(self)
Renders an ordered list (from worst to best) of the actions
following the net flows ranking rule.
computeNetFlowsRanking(self)
Renders an ordered list (from best to worst) of the actions
following the net flows ranking rule.
computeNetFlowsRankingDict(self)
Renders an ordered list (from best to worst) of the actions
following the net flows ranking rule.
computeODistance(self, op2, comments=False)
renders the squared normalized distance of
two digraph valuations.
 
.. note::
 
     op2 = digraphs of same order as self.
computeOrbit(self, choice, withListing=False)
renders the set of isomorph copies of a choice following
the automorphism of the digraph self
computeOrderCorrelation(self, order, Debug=False)
Renders the ordinal correlation K of a digraph instance
when compared with a given linear order (from worst to best) of its actions
 
K = sum_{x != y} [ min( max(-self.relation(x,y)),other.relation(x,y), max(self.relation(x,y),-other.relation(x,y)) ]
 
K /= sum_{x!=y} [ min(abs(self.relation(x,y),abs(other.relation(x,y)) ]
 
.. note::
 
     Renders a dictionary with the key 'correlation' containing the actual bipolar correlation index and the key 'determination' containing the minimal determination level D of self and the other relation.
 
     D = sum_{x != y} min(abs(self.relation(x,y)),abs(other.relation(x,y)) / n(n-1)
 
     where n is the number of actions considered.
 
     The correlation index with a completely indeterminate relation
     is by convention 0.0 at determination level 0.0 .
 
.. warning::
 
     self must be a normalized outranking digraph instance !
computeOrdinalCorrelation(self, other, MedianCut=False, filterRelation=None, Debug=False)
Renders the bipolar correlation K of a
self.relation when compared
with a given compatible (same actions set)) digraph or
a [-1,1] valued compatible relation (same actions set).
 
If MedianCut=True, the correlation is computed on the median polarized relations.
 
If filterRelation is not None, the correlation is computed on the partial domain corresponding to the determined part of the filter relation.
 
.. warning::
 
     Notice that the 'other' relation and/or the 'filterRelation',
     the case given, must both be normalized, ie [-1,1]-valued !
 
K = sum_{x != y} [ min( max(-self.relation[x][y]),other.relation[x][y]), max(self.relation[x][y],-other.relation[x][y]) ]
 
K /= sum_{x!=y} [ min(abs(self.relation[x][y]),abs(other.relation[x][y])) ]
 
.. note::
 
     Renders a tuple with at position 0 the actual bipolar correlation index
     and in position 1 the minimal determination level D of self and
     the other relation.
 
     D = sum_{x != y} min(abs(self.relation[x][y]),abs(other.relation[x][y])) / n(n-1)
 
     where n is the number of actions considered.
 
     The correlation index with a completely indeterminate relation
     is by convention 0.0 at determination level 0.0 .
computeOrdinalCorrelationMP(self, other, MedianCut=False, Threading=False, nbrOfCPUs=None, startMethod=None, Comments=False, Debug=False)
Multi processing version of the digraphs.computeOrdinalCorrelation() method.
 
.. note::
     The relation filtering and the MedinaCut option are not implemented in the MP version.
computePairwiseClusterComparison(self, K1, K2, Debug=False)
Computes the pairwise cluster comparison credibility vector
from bipolar-valued digraph g. with K1 and K2 disjoint
lists of action keys from g actions disctionary.
Returns the dictionary
{'I': Decimal(),'P+':Decimal(),'P-':Decimal(),'R' :Decimal()}
where one and only one item is strictly positive.
computePreKernels(self)
computing dominant and absorbent preKernels:
    Result in self.dompreKernels and self.abspreKernels
computePreRankingRelation(self, preRanking, Normalized=True, Debug=False)
Renders the bipolar-valued relation obtained from
a given preRanking in decreasing levels (list of lists) result.
computePreorderRelation(self, preorder, Normalized=True, Debug=False)
Renders the bipolar-valued relation obtained from
a given preordering in increasing levels (list of lists) result.
computePrincipalOrder(self, Colwise=False, Comments=False)
Rendesr an ordering from wrost to best of the decision actions.
computePrincipalRanking(self, Colwise=False, Comments=False)
Rendesr a ranking from best to worst of the decision actions.
computePrincipalScores(self, plotFileName=None, Colwise=False, imageType=None, tempDir=None, bgcolor='cornsilk', Comments=False, Debug=False)
Renders a ordered list of the first principal eigenvector of the covariance of the valued outdegrees of self.
 
.. note::
 
   The method, relying on writing and reading temporary files by default in a temporary directory is threading and multiprocessing safe !
   (see Digraph.exportPrincipalImage method)
computePrudentBetaLevel(self, Debug=False)
computes alpha, ie the lowest valuation level, for which the
bipolarly polarised digraph doesn't contain a chordless circuit.
computeRankingByBestChoosing(self, CoDual=False, Debug=False)
Computes a weak preordering of the self.actions by recursive
best choice elagations.
 
Stores in self.rankingByBestChoosing['result'] a list of (P+,bestChoice) tuples
where P+ gives the best choice complement outranking
average valuation via the computePairwiseClusterComparison
method.
 
If self.rankingByBestChoosing['CoDual'] is True, 
the ranking-by-choosing was computed on the codual of self.
computeRankingByBestChoosingRelation(self, rankingByBestChoosing=None, Debug=False)
Renders the bipolar-valued relation obtained from
the self.rankingByBestChoosing result.
computeRankingByChoosing(self, actionsSubset=None, Debug=False, CoDual=False)
Computes a weak preordring of the self.actions by iterating
jointly first and last choice elagations.
 
Stores in self.rankingByChoosing['result'] a list of ((P+,bestChoice),(P-,worstChoice)) pairs
where P+ (resp. P-) gives the best (resp. worst) choice complement outranking
(resp. outranked) average valuation via the computePairwiseClusterComparison
method.
 
If self.rankingByChoosing['CoDual'] is True, the ranking-by-choosing was computed on the codual of self.
computeRankingByChoosingRelation(self, rankingByChoosing=None, actionsSubset=None, Debug=False)
Renders the bipolar-valued relation obtained from
the self.rankingByChoosing result.
computeRankingByLastChoosing(self, CoDual=False, Debug=False)
Computes a weak preordring of the self.actions by iterating
worst choice elagations.
 
Stores in self.rankingByLastChoosing['result'] a list of (P-,worstChoice) pairs
where P- gives the worst choice complement outranked
average valuation via the computePairwiseClusterComparison
method.
 
If self.rankingByChoosing['CoDual'] is True, the ranking-by-last-chossing 
was computed on the codual of self.
computeRankingByLastChoosingRelation(self, rankingByLastChoosing=None, Debug=False)
Renders the bipolar-valued relation obtained from
the self.rankingByLastChoosing result.
computeRankingCorrelation(self, ranking, Debug=False)
Renders the ordinal correlation K of a digraph instance
when compared with a given linear ranking of its actions
 
K = sum_{x != y} [ min( max(-self.relation(x,y)),other.relation(x,y), max(self.relation(x,y),-other.relation(x,y)) ]
 
K /= sum_{x!=y} [ min(abs(self.relation(x,y),abs(other.relation(x,y)) ]
 
.. note::
 
     Renders a tuple with at position 0 the actual bipolar correlation index
     and in position 1 the minimal determination level D of self and
     the other relation.
 
     D = sum_{x != y} min(abs(self.relation(x,y)),abs(other.relation(x,y)) / n(n-1)
 
     where n is the number of actions considered.
 
     The correlation index with a completely indeterminate relation
     is by convention 0.0 at determination level 0.0 .
computeRelationalStructure(self, Debug=False)
Renders the counted decomposition of the valued relations into
the following type of links:
gt '>', eq '=', lt '<', incomp '<>',
leq '<=', geq '>=', indeterm '?'
computeRubisChoice(self, Comments=False, _OldCoca=False, BrokenCocs=True, Threading=False, nbrOfCPUs=1)
Renders self.strictGoodChoices, self.nullChoices
self.strictBadChoices, self.nonRobustChoices.
 
.. warning::
    Changes in site the outranking digraph by
    adding or braking chordless odd outranking circuits.
computeRubyChoice(self, Comments=False, _OldCoca=False)
dummy for computeRubisChoice()
old versions compatibility.
computeShortestPathLengths(self, WeakPaths=False, Comments=False, Debug=False)
Renders a double dictionary with the directed distances, i.e. the shortest path lengths between all self.actions
 
Equals *None* if there does not exist a directed path between two actions.
 
*Source*: Claude Berge, *The Theory of Graphs*, Dover (2001) pp. 119, original in French Dunod (1958)
computeSingletonRanking(self, Comments=False, Debug=False)
Renders the sorted bipolar net determinatation of outrankingness
minus outrankedness credibilities of all singleton choices.
 
res = ((netdet,singleton,dom,absorb)+)
computeSize(self)
Renders the number of validated non reflexive arcs
computeSizeTransitiveClosure(self)
Renders the size of the transitive closure of a digraph.
computeSlaterOrder(self, isProbabilistic=False, seed=None, sampleSize=1000, Debug=False)
Reversed return from computeSlaterRanking method.
computeSlaterRanking(self, isProbabilistic=False, seed=None, sampleSize=1000, Debug=False)
Renders a ranking of the actions with minimal Slater index.
Return a tuple: slaterOrder, slaterIndex
computeSymmetryDegree(self, InPercents=False, Comments=False)
Renders the symmetry degree (Decimal) of the irreflexive part of a digraph.
 
.. note::
 
   Empty and indeterminate digraphs are considered to be symmetric.
computeTopologicalRanking(self, Debug=False)
Mimetic Wrapper of the topologicalSort() method.
computeTransitivityDegree(self, InPercents=False, Comments=False)
Renders the transitivity degree (Decimal) of a digraph.
 
.. note:: 
 
   An empty or indeterminate digraph is considered to be transitive.
computeUnrelatedPairs(self)
Renders a list of more or less unrelated pairs.
computeValuationLevels(self, choice=None, Debug=False)
renders the symmetric closure of the
apparent valuations levels of self
in an increasingly ordered list.
If parameter choice is given, the
computation is limited to the actions
of the choice.
computeValuationPercentages(self, choice, percentiles, withValues=False)
Parameters: choice and list of percentiles.
renders a series of percentages of the characteristics valuation of
the arcs in the digraph.
computeValuationPercentiles(self, choice, percentages, withValues=False)
Parameters: choice and list of percentages.
renders a series of quantiles of the characteristics valuation of
the arcs in the digraph.
computeValuationStatistics(self, Sampling=False, Comments=False)
Renders the mean and variance of the valuation
of the non reflexive pairs.
computeValuedRankingRelation(self, ranking)
Renders the valued relation characteristics compatible 
with the given linar ranking. Discordant charcateristics 
are set to the indeterminate value.
computeWeakCondorcetLosers(self)
Wrapper for weakCondorcetLosers().
computeWeakCondorcetWinners(self)
Wrapper for weakCondorcetWinners().
computeupdown1(self, s, S)
Help method for show_MIS_HB2 method.
fills self.newmisset, self.upmis, self.downmis.
computeupdown2(self, s, S)
Help method for show_MIS_HB1 method.
Fills self.newmisset, self.upmis, self.downmis.
computeupdown2irred(self, s, S)
Help method for show_MIS_HB1 method.
Fills self.newmisset, self.upmis, self.downmis.
condorcetLosers(self)
Renders the set of decision actions x such that
self.relation[x][y] < self.valuationdomain['med']
for all y != x.
condorcetWinners(self)
Renders the set of decision actions x such that
self.relation[x][y] > self.valuationdomain['med']
for all y != x.
contra(self, v)
Parameter: choice.
Renders the negation of a choice v characteristic's vector.
convertRelationToDecimal(self)
Converts the float valued self.relation in a decimal valued one.
convertValuation2Integer(self, InSite=True, Comments=False)
Converts the self.relation valuation to integer values by converting the Decimals to Fractions and multiply by the least commun multiple of the fraction denominators.
 
*Parameters*:
 
    - If *Insite* == False (True by default) the method returns a modified copy of self.relation without altering the original self.relation, otherwise self.relation and self.valuationdomain is modified.
convertValuationToDecimal(self)
Convert the float valuation limits to Decimals.
coveringIndex(self, choice, direction='out')
Renders the covering index of a given choice in a set of objects,
ie the minimum number of choice members that cover each
non selected object.
crispKDistance(self, digraph, Debug=False)
Renders the crisp Kendall distance between two bipolar valued
digraphs.
 
.. warning::
 
     Obsolete! Is replaced by the self.computeBipolarCorrelation(other, MedianCut=True) Digraph method
detectChordlessCircuits(self, Comments=False, Debug=False)
Detects a chordless circuit in a digraph.
Returns a Boolean
detectChordlessPath(self, Pk, n2, Comments=False, Debug=False)
New procedure from Agrum study April 2009
recursive chordless path extraction starting from path
Pk = [n2, ...., n1] and ending in node n2.
Optimized with marking of visited chordless P1s.
determinateness(self, vec, inPercent=True)
Renders the determinateness of a characteristic vector *vec* = 
[(r(x),x),(r(y),y), ...] of length *n* in valuationdomain [Min,Med,Max]:
 
*result* =  sum_x( abs(r(x)-Med) ) / ( n*(Max-Med) )
 
If inPercent, *result* shifted (+1) and reduced (/2) to [0,1] range.
digraph2Graph(self, valuationDomain={'min': -1, 'med': 0, 'max': 1}, Debug=False, ConjunctiveConversion=True)
Convert a Digraph instance to a Graph instance.
dneighbors(self, node)
Renders the set of dominated out-neighbors of a node.
domin(self, choice)
Renders the dominance degree of a choice.
dominantChoices(self, S)
Generates all minimal dominant choices of a bipolar valued digraph.
 
.. note::
 
     Initiate with S = self.actions.copy().
domirred(self, choice)
Renders the crips +irredundance degree of a choice.
domirredval(self, choice, relation)
Renders the valued +irredundance degree of a choice.
domirredx(self, choice, x)
Renders the crips +irredundance degree of node x in a choice.
domkernelrestrict(self, prekernel)
Parameter: dominant prekernel
Renders dominant prekernel restricted relation.
exportGraphViz(self, fileName=None, actionsSubset=None, bestChoice=set(), worstChoice=set(), firstChoice=set(), lastChoice=set(), Comments=True, graphType='png', pictureFormat=None, graphSize='7,7', relation=None, bgcolor='cornsilk')
export GraphViz dot file  for graph drawing filtering.
exportPrincipalImage(self, plotFileName=None, pictureFormat='pdf', bgcolor='cornsilk', fontcolor='red3', fontsize='0.75', Reduced=False, Colwise=False, tempDir='.', Comments=False)
Export as PDF (default) the principal projection of
the valued relation using the three principal eigen vectors.
 
Implemeted picture formats are: 
'pdf' (default), 'png', 'jpeg' and 'xfig'.
 
The background color is set by default to 'cornsilk'. 
 
Font size and color are set by default to 'red3', resp. '0.75'. 
 
When *Reduced==True*, the valued relation characeteristics are centered and reduced.
 
When *Colwise==True*, the column vectors of the adjacency table are used for the principal projection, otherwise the rows (default) are used. Has no incidence when the *Digraph* instance *self*  is symmetric. 
 
.. warning::
 
    The method, writing and reading temporary files: 
    tempCol.r and rotationCol.csv, resp. tempRow.r and rotationRow.csv,
    by default in the working directory (./),
    is hence not safe for multiprocessing programs, unless a
    temporary directory *tempDir* is provided.
flatChoice(self, ch, Debug=False)
Converts set or list ch recursively to a flat list of items.
forcedBestSingleChoice(self)
Renders the set of most determined outranking singletons in self.
gammaSets(self)
Renders the dictionary of neighborhoods {node: (dx,ax)}
with set *dx* gathering the dominated, and set *ax* gathering
the absorbed neighborhood.
generateAbsPreKernels(self)
Generate all absorbent prekernels from independent choices generator.
generateDomPreKernels(self)
Generate all dominant prekernels from independent choices generator.
htmlChoiceVector(self, ch, ChoiceVector=True, choiceType='good')
Show procedure for annotated bipolar choices.
inDegrees(self)
renders the median cut indegrees
inDegreesDistribution(self)
Renders the distribution of indegrees.
independentChoices(self, U)
Generator for all independent choices with neighborhoods of a bipolar valued digraph:
 
.. note::
 
       * Initiate with U = self.singletons().
       * Yields [(independent choice, domnb, absnb, indnb)].
inner_prod(self, v1, v2)
Parameters: two choice characteristic vectors
Renders the inner product of two characteristic vetors.
intstab(self, choice)
Computes the independence degree of a choice.
irreflex(self, mat)
Puts diagonal entries of mat to valuationdomain['min']
isAsymmetricIndeterminate(self, Debug=False)
Checks the self.relation for assymmetric indeterminateness!!
 
.. warning::
 
    The reflexive links are ignored !!
isComplete(self, Debug=False)
checks the completeness property of self.relation by checking
for the absence of a link between two actions!!
 
.. warning::
 
    The reflexive links are ignored !!
isCyclic(self, Debug=False)
checks the cyclicity of self.relation by checking
for a reflexive loop in its transitive closure-
 
.. warning::
 
     self.relation is supposed to be irreflexive !
isIntegerValued(self, Debug=False)
Checks whether the decimal valuation of self is integer-valued
be using the as_integer_ratio() method of a Decimal 
giving a tuple (numerator,denominator). If denominator == 1, the
number is an integer.
isOutrankingDigraph(self, Comments=True, Debug=False)
Checks the outranking digraph characteristic condition (3.3).
 
relation[x][y] + relation[y][x)[y] >= 0.0
 
.. warning::
 
    The reflexive links are ignored and the valuation must be bipolar !!
isStrictOutrankingDigraph(self, Comments=True, Debug=False)
Checks the strict outranking digraph characteristic condition (3.1).
 
-(relation[x][y] + relation[y][x]) <= 0.0 , x != y
 
.. warning::
 
    The reflexive links are ignored and the valuation must be bipolar !!
isSymmetric(self, Comments=False)
True if symmetry degree == 1.0.
isTransitive(self, Comments=False)
True if transitivity degree == 1.0.
isWeaklyComplete(self, Debug=False)
checks the weakly completeness property of self.relation by checking
for the absence of a link between two actions!!
 
.. warning::
 
    The reflexive links are ignored !!
iterateRankingByChoosing(self, Odd=False, CoDual=False, Comments=True, Debug=False, Limited=None)
Renders a ranking by choosing result when progressively eliminating
all chordless (odd only) circuits with rising valuation cut levels.
 
Parameters
    CoDual = False (default)/True
    Limited = proportion (in [0,1]) * (max - med) valuationdomain
kChoices(self, A, k)
Renders all choices of length k from set A
matmult2(self, m, v)
Parameters: digraph relation and choice characteristic vector
matrix multiply vector by inner production
meanDegree(self)
Renders the mean degree of self.
!!! self.size must be set previously !!!
meanLength(self, Oriented=False)
Renders the (by default non-oriented) mean neighbourhoor depth of self.
!!! self.order must be set previously !!!
minimalChoices(self, S)
Generates all dominant or absorbent choices of a bipolar
valued digraph.
 
.. note:
 
   * Initiate with S = (actions, dict of dominant or absorbent closed neighborhoods)
   * See showMinDom and showMinAbs methods.
minimalValuationLevelForCircuitsElimination(self, Odd=True, Debug=False, Comments=False)
renders the minimal valuation level <lambda> that eliminates all
self.circuitsList stored odd chordless circuits from self.
 
.. warning::
 
    The <lambda> level polarised may still contain newly appearing chordless odd circuits !
neighbourhoodCollection(self, Oriented=False, Potential=False)
Renders the neighbourhood.
neighbourhoodDepthDistribution(self, Oriented=False)
Renders the distribtion of neighbourhood depths.
notGammaSets(self)
Renders the dictionary of neighborhoods {node: (dx,ax)}
with set *dx* gathering the not dominated, and set *ax* gathering
the not absorbed neighborhood.
notaneighbors(self, node)
Renders the set of absorbed not in-neighbors of a node.
notdneighbors(self, node)
Renders the set of not dominated out-neighbors of a node.
outDegrees(self)
renders the median cut outdegrees
outDegreesDistribution(self)
Renders the distribution of outdegrees.
plusirredundant(self, U)
Generates all +irredundant choices of a digraph.
powerset(self, U)
Generates all subsets of a set.
readPerrinMisset(self, file='curd.dat')
read method for 0-1-char-coded MISs by default from the perrinMIS.c curd.dat result file.
readabsvector(self, x, relation)
Parameter: action x
absorbent in vector.
readdomvector(self, x, relation)
Parameter: action x
dominant out vector.
recodeValuation(self, newMin=-1.0, newMax=1.0, ndigits=4, Debug=False)
Recodes the characteristic valuation domain according
to the parameters given. 
 
*ndigits* indicates the number of decimal digits of the valuation.
relationFct(self, x, y)
wrapper for self.relation dictionary access to ensure interoperability
with the sparse and big outranking digraph implementation model.
save(self, fileName='tempdigraph', option=None, DecimalValuation=True, decDigits=2)
Persistent storage of a Digraph class instance in the form of
a python source code file
saveCSV(self, fileName='tempdigraph', Normalized=False, Dual=False, Converse=False, Diagonal=False, Debug=False)
Persistent storage of a Digraph class instance in the form of
a csv file.
saveXMCDA2(self, fileName='temp', fileExt='xmcda2', Comments=True, relationName='R', relationType='binary', category='random', subcategory='valued', author='digraphs Module (RB)', reference='saved from Python', valuationType='standard', digits=2, servingD3=False)
save digraph in XMCDA 2.0 format. Deprecated now.
savedre(self, fileName='temp')
save digraph in nauty format.
sharp(self, x, y)
Paramaters: choice characteristic values.
Renders the sharpest of two characteristic values x and y.
sharpvec(self, v, w)
Paramaters: choice characteristic vectors.
Renders the sharpest of two characteristic vectors v and w.
showActions(self)
presentation methods for digraphs actions
showAll(self)
Detailed show method for genuine digraphs.
showAttributes(self)
Prints out the attributes of self.
showAutomorphismGenerators(self)
Renders the generators of the automorphism group.
showBadChoices(self, Recompute=True)
Characteristic values for potentially bad choices.
showBestChoiceRecommendation(self, Verbose=False, Comments=True, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True)
Shows the RuBis best choice recommendation.
 
.. note::
 
    Computes by default the Rubis best choice recommendation on the corresponding strict (codual) outranking digraph.
 
    By default, with BrokenCocs=True, we brake all chordless circuits at their weakest determined ( abs(r(x>y)) + abs(r(y>x)) ) link.
 
    When BrokenCocs=False we proceed like follows:
 
    In case of chordless circuits, if supporting arcs are more credible
    than the reversed negating arcs, we collapse the circuits into hyper nodes.
    Inversely,  if supporting arcs are not more credible than the reversed negating arcs,
    we brake the circuits on their weakest arc.
 
Usage example:
 
>>> from outrankingDigraphs import *
>>> t = Random3ObjectivesPerformanceTableau(seed=5)
>>> g = BipolarOutrankingDigraph(t)
>>> g.showBestChoiceRecommendation()
***********************
RuBis Best Choice Recommendation (BCR)
(in decreasing order of determinateness)   
Credibility domain:  [-100.0, 100.0]
=== >> potential first choices
* choice              : ['a04', 'a14', 'a19', 'a20']
   independence        : 1.19
   dominance           : 4.76
   absorbency          : -59.52
   covering (%)        : 75.00
   determinateness (%) : 57.86
   - most credible action(s) = { 'a14': 23.81, 'a19': 11.90, 'a04': 2.38, 'a20': 1.19, }  
=== >> potential last choices 
* choice              : ['a03', 'a12', 'a17']
  independence        : 4.76
  dominance           : -76.19
  absorbency          : 4.76
  covering (%)        : 0.00
  determinateness (%) : 65.39
  - most credible action(s) = { 'a03': 38.10, 'a12': 13.10, 'a17': 4.76, }
Execution time: 0.024 seconds
*****************************
showChoiceVector(self, ch, choiceType='good', ChoiceVector=True)
Show procedure for annotated bipolar choices.
showChordlessCircuits(self, Recompute=False)
Show method for chordless circuits observed in a Digraph instance.
 
If previous computation is required, stores the detected circuits in self.circuitsList attribute.
showComponents(self)
Shows the list of connected components of the digraph instance.
showCorrelation(self, corr=None, ndigits=3)
Renders the valued ordinal correlation index, the crisp Kendall tau index and their epistemic determination degree.
showFirstChoiceRecommendation(self, Verbose=False, Comments=True, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True)
Shows the RuBis first choice recommendation.
 
.. note::
 
    Computes by default the Rubis first choice recommendation on the corresponding strict (codual) outranking digraph.
 
    By default, with BrokenCocs=True, we brake all chordless circuits at their weakest determined ( abs(r(x>y)) + abs(r(y>x)) ) link.
 
    When BrokenCocs=False we proceed like follows:
 
    In case of chordless circuits, if supporting arcs are more credible
    than the reversed negating arcs, we collapse the circuits into hyper nodes.
    Inversely,  if supporting arcs are not more credible than the reversed negating arcs,
    we brake the circuits on their weakest arc.
 
Usage example:
 
>>> from outrankingDigraphs import *
>>> t = Random3ObjectivesPerformanceTableau(seed=5)
>>> g = BipolarOutrankingDigraph(t)
>>> g.showFirstChoiceRecommendation()
***********************
RuBis First Choice Recommendation (BCR)
(in decreasing order of determinateness)   
Credibility domain:  [-100.0, 100.0]
=== >> potential first choices
* choice              : ['a04', 'a14', 'a19', 'a20']
   independence        : 1.19
   dominance           : 4.76
   absorbency          : -59.52
   covering (%)        : 75.00
   determinateness (%) : 57.86
   - most credible action(s) = { 'a14': 23.81, 'a19': 11.90, 'a04': 2.38, 'a20': 1.19, }  
=== >> potential last choices 
* choice              : ['a03', 'a12', 'a17']
  independence        : 4.76
  dominance           : -76.19
  absorbency          : 4.76
  covering (%)        : 0.00
  determinateness (%) : 65.39
  - most credible action(s) = { 'a03': 38.10, 'a12': 13.10, 'a17': 4.76, }
Execution time: 0.024 seconds
*****************************
showGoodChoices(self, Recompute=True)
Characteristic values for potentially good choices.
showHTMLBestChoiceRecommendation(self, pageTitle=None, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True, htmlFileName=None)
showHTMLRelationHeatmap(self, actionsList=None, rankingRule='NetFlows', colorLevels=7, tableTitle='Relation Heatmap', relationName='r(x S y)', ndigits=2, fromIndex=None, toIndex=None, htmlFileName=None)
Launches a browser window with the colored relation map of self.
 
See corresponding :py:class:`~digraphs.Digraph.showHTMLRelationMap` method.
 
The *colorLevels* parameter may be set to 3, 5, 7 (default) or 9.
 
When the *actionsList* parameter is *None* (default), the digraphs actions list may be ranked with the *rankingRule* parameter set to the 'Copeland' (default) or to the 'Netlows' ranking rule.
 
When the *htmlFileName* parameter is set to a string value 'xxx', a html file named 'xxx.html' will be generated in the current working directory. Otherwise, a temporary file named 'tmp*.html' will be generated there.
 
Example::
 
    >>> from outrankingDigraphs import *
    >>> t = RandomCBPerformanceTableau(numberOfActions=25,seed=1)
    >>> g = BipolarOutrankingDigraph(t,ndigits=2)
    >>> gcd = ~(-g)  # strict outranking relation
    >>> gcd.showHTMLRelationHeatmap(colorLevels=7,ndigits=2)
    
.. image:: relationHeatmap.png
   :alt: Browser view of a relation map
   :width: 600 px
   :align: center
showHTMLRelationMap(self, actionsList=None, rankingRule='Copeland', Colored=True, tableTitle='Relation Map', relationName='r(x S y)', symbols=['+', '&middot;', '&nbsp;', '&#150;', '&#151'], fromIndex=None, toIndex=None, htmlFileName=None)
Launches a browser window with the colored relation map of self.
See corresponding Digraph.showRelationMap() method.
 
When *htmlFileName* parameter is set to a string value, a html file
with that name will be stored in the current working directory.
 
By default, a temporary file named: tmp*.html will be generated
instead in the current working directory.
 
Example::
 
    >>> from outrankingDigraphs import *
    >>> t = RandomCBPerformanceTableau(numberOfActions=25,seed=1)
    >>> g = BipolarOutrankingDigraph(t,Normalized=True)
    >>> gcd = ~(-g)  # strict outranking relation
    >>> gcd.showHTMLRelationMap(rankingRule="NetFlows")
    
.. image:: relationMap.png
   :alt: Browser view of a relation map
   :width: 600 px
   :align: center
showHTMLRelationTable(self, actionsList=None, relation=None, IntegerValues=False, ndigits=2, Colored=True, tableTitle='Valued Adjacency Matrix', relationName='r(x S y)', ReflexiveTerms=False, htmlFileName=None, fromIndex=None, toIndex=None)
Launches a browser window with the colored relation table of self.
showMIS(self, withListing=True)
Prints all maximal independent choices:
    Result in self.misset.
showMIS_AH(self, withListing=True)
Prints all MIS using the Hertz method.
 
Result saved in self.hertzmisset.
showMIS_HB2(self, withListing=True)
Prints all MIS using the Hertz-Bisdorff method.
 
Result saved in self.newmisset.
showMIS_RB(self, withListing=True)
Prints all MIS using the Bisdorff method.
 
Result saved in self.newmisset.
showMIS_UD(self, withListing=True)
Prints all MIS using the Hertz-Bisdorff method.
 
Result saved in self.newmisset.
showMaxAbsIrred(self, withListing=True)
Computing maximal -irredundant choices:
    Result in self.absirset.
showMaxDomIrred(self, withListing=True)
Computing maximal +irredundant choices:
   Result in self.domirset.
showMinAbs(self, withListing=True)
Prints minimal absorbent choices:
    Result in self.absset.
showMinDom(self, withListing=True)
Prints all minimal dominant choices:
    Result in self.domset.
showNeighborhoods(self)
Lists the gamma and the notGamma function of self.
showOrbits(self, InChoices, withListing=True)
Prints the orbits of Choices along the automorphisms of
the Digraph instance.
 
Example Python session for computing the non isomorphic MISs from the 12-cycle graph:
 
>>> from digraphs import *
>>> c12 = CirculantDigraph(order=12,circulants=[1,-1])
>>> c12.automorphismGenerators()
...
  Permutations
  {'1': '1', '2': '12', '3': '11', '4': '10', '5': 
   '9', '6': '8', '7': '7', '8': '6', '9': '5', '10': 
   '4', '11': '3', '12': '2'}
  {'1': '2', '2': '1', '3': '12', '4': '11', '5': '10', 
   '6': '9', '7': '8', '8': '7', '9': '6', '10': '5', 
   '11': '4', '12': '3'}
  Reflections {}
>>> print('grpsize = ', c12.automorphismGroupSize)
  grpsize = 24
>>> c12.showMIS(withListing=False)
  *---  Maximal independent choices ---*
  number of solutions:  29
  cardinality distribution
  card.:  [0, 1, 2, 3, 4,  5,  6, 7, 8, 9, 10, 11, 12]
  freq.:  [0, 0, 0, 0, 3, 24,  2, 0, 0, 0,  0,  0,  0]
  Results in c12.misset
>>> c12.showOrbits(c12.misset,withListing=False)
...
  *---- Global result ----
  Number of MIS:  29
  Number of orbits :  4
  Labelled representatives:
  1: ['2','4','6','8','10','12']
  2: ['2','5','8','11']
  3: ['2','4','6','9','11']
  4: ['1','4','7','9','11']
  Symmetry vector
  stabilizer size: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, ...]
  frequency      : [0, 2, 0, 0, 0, 0, 0, 1, 0,  0,  0,  1, ...]
 
*Figure*: The symmetry axes of the non isomorphic MISs of the 12-cycle:
 
.. image:: c12.png
   :width: 400 px
   :align: center
   :alt: The 4 non isomorphic MIS of the 12-cycle graph
 
*Reference*: R. Bisdorff and J.L. Marichal (2008). Counting non-isomorphic maximal independent sets of the n-cycle graph. *Journal of Integer Sequences*, Vol. 11 Article 08.5.7 (`openly accessible here <https://www.cs.uwaterloo.ca/journals/JIS/VOL11/Marichal/marichal.html>`_)
showOrbitsFromFile(self, InFile, withListing=True)
Prints the orbits of Choices along the automorphisms of
the digraph self by reading in the 0-1 misset file format.
See the :py:func:`digraphs.Digraph.readPerrinMisset` method.
showPreKernels(self, withListing=True)
Printing dominant and absorbent preKernels:
    Result in self.dompreKernels and self.abspreKernels
showRankingByBestChoosing(self, rankingByBestChoosing=None)
A show method for self.rankinByBestChoosing result.
 
.. warning::
 
     The self.computeRankingByBestChoosing(CoDual=False/True) method instantiating the self.rankingByBestChoosing slot is pre-required !
showRankingByChoosing(self, rankingByChoosing=None, WithCoverCredibility=False)
A show method for self.rankinByChoosing result.
 
When parameter *WithCoverCredibility* is set to True, the credibility of outranking, respectively being outranked is indicated at each selection step. 
 
.. warning::
 
     The self.computeRankingByChoosing(CoDual=False/True) method instantiating the self.rankingByChoosing slot is pre-required !
showRankingByLastChoosing(self, rankingByLastChoosing=None, Debug=None)
A show method for self.rankinByChoosing result.
 
.. warning::
 
     The self.computeRankingByLastChoosing(CoDual=False/True) method instantiating the self.rankingByChoosing slot is pre-required !
showRelation(self)
prints the relation valuation in ##.## format.
showRelationMap(self, symbols=None, rankingRule='Copeland', fromIndex=None, toIndex=None, actionsList=None)
Prints on the console, in text map format, the location of
certainly validated and certainly invalidated outranking situations.
 
By default, symbols = {'max':'┬','positive': '+', 'median': ' ',
                       'negative': '-', 'min': '┴'}
 
The default ordering of the output is following the Copeland ranking rule
from best to worst actions. Further available ranking rule is the 'NetFlows' net flows rule.
 
 
Example::
 
    >>> from outrankingDigraphs import *
    >>> t = RandomCBPerformanceTableau(numberOfActions=25,seed=1)
    >>> g = BipolarOutrankingDigraph(t,Normalized=True)
    >>> gcd = ~(-g)  # strict outranking relation
    >>> gcd.showRelationMap(rankingRule="NetFlows")
     -   ++++++++  +++++┬+┬┬+
    - -   + +++++ ++┬+┬+++┬++
    ┴+  ┴ + ++  ++++┬+┬┬++┬++
    -   ++ - ++++-++++++┬++┬+
       - - - ++- ┬- + -+┬+-┬┬
    -----  -      -┬┬┬-+  -┬┬
    ----    --+-+++++++++++++
    -- --+- --++ ++ +++-┬+-┬┬
    ----  -  -+-- ++--+++++ +
    ----- ++- --- +---++++┬ +
    -- -- ---+ -++-+++-+ +-++
    -- --┴---+  + +-++-+ -  +
    ---- ┴---+-- ++--++++ - +
      --┴┴--  --- -  --+ --┬┬
     ---------+--+ ----- +-┬┬
    -┴---┴- ---+- + ---+++┬ +
    -┴┴--┴---+--- ++ -++--+++
    -----┴--- ---+-+- ++---+ 
    -┴┴--------------- --++┬ 
    --┴---------------- --+┬ 
    ┴--┴┴ -┴--┴┴-┴ --++  ++-+
    ----┴┴--------------- -  
    ┴┴┴----+-┴+┴---┴-+---+ ┴+
    ┴┴-┴┴┴-┴- - -┴┴---┴┴+ ┬ -
    ----┴┴-┴-----┴┴---  - -- 
    Ranking rule: NetFlows
    >>>
showRelationTable(self, Sorted=True, rankingRule=None, IntegerValues=False, actionsSubset=None, relation=None, ndigits=2, ReflexiveTerms=True, fromIndex=None, toIndex=None)
Prints the relation valuation in actions X actions table format.
Copeland and NetFlows rankings my be used.
showRubisBestChoiceRecommendation(self, **kwargs)
Dummy for backward portable showBestChoiceRecommendation().
showRubyChoice(self, Verbose=False, Comments=True, _OldCoca=True)
Dummy for showBestChoiceRecommendation()
needed for older versions compatibility.
showShort(self)
concise presentation method for genuine digraphs.
showSingletonRanking(self, Comments=True, Debug=False)
Calls self.computeSingletonRanking(comments=True,Debug = False).
Renders and prints the sorted bipolar net determinatation of outrankingness
minus outrankedness credibilities of all singleton choices.
 
res = ((netdet,sigleton,dom,absorb)+)
showStatistics(self)
Computes digraph statistics like order, size and arc-density.
showdre(self)
Shows relation in nauty format.
singletons(self)
list of singletons and neighborhoods
[(singx1, +nx1, -nx1, not(+nx1 or -nx1)),.... ]
sizeSubGraph(self, choice)
Output: (size, undeterm,arcDensity).
Renders the arc density of the induced subgraph.
strongComponents(self, setPotential=False)
Renders the set of strong components of self.
symDegreesDistribution(self)
Renders the distribution of symmetric degrees.
topologicalSort(self, Debug=False)
If self is acyclic, adds topological sort number to each node of self
and renders ordered list of nodes. Otherwise renders None.
Source: M. Golumbic Algorithmic Graph heory and Perfect Graphs,
Annals Of Discrete Mathematics 57 2nd Ed. , Elsevier 2004, Algorithm 2.4 p.44.
weakAneighbors(self, node)
Renders the set of absorbed in-neighbors of a node.
weakCondorcetLosers(self)
Renders the set of decision actions x such that
self.relation[x][y] <= self.valuationdomain['med']
for all y != x.
weakCondorcetWinners(self)
Renders the set of decision actions x such that
self.relation[x][y] >= self.valuationdomain['med']
for all y != x.
weakDneighbors(self, node)
Renders the set of dominated out-neighbors of a node.
weakGammaSets(self)
Renders the dictionary of neighborhoods {node: (dx,ax)}
zoomValuation(self, zoomFactor=1.0)
Zooms in or out, depending on the value of the zoomFactor provided,
the bipolar valuation of a digraph.

Data descriptors inherited from Digraph:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class ConverseDigraph(Digraph)
    ConverseDigraph(other)
 
Instantiates the associated converse or reciprocal version from
a deep copy of a given Digraph called other.
 
Instantiates as other.__class__ !
 
Deep copies, the case given, the description, the criteria
and the evaluation dictionaries into self.
 
 
Method resolution order:
ConverseDigraph
Digraph
builtins.object

Methods defined here:
__init__(self, other)
Initialize self.  See help(type(self)) for accurate signature.

Methods inherited from Digraph:
MISgen(self, S, I)
generator of maximal independent choices (voir Byskov 2004):
    * S ::= remaining nodes;
    * I ::= current independent choice
 
.. note::
 
        Inititalize: self.MISgen(self.actions.copy(),set())
__invert__(self)
Make the inverting operator ~self available for Digraph instances. 
 
Returns a ConverseDigraph instance of self.
__neg__(self)
Make the negation operator -self available for Digraph instances. 
 
Returns a DualDigraph instance of self.
__repr__(self)
Default presentation method for Digraph instances.
absirred(self, choice)
Renders the crips -irredundance degree of a choice.
absirredundant(self, U)
Generates all -irredundant choices of a digraph.
absirredval(self, choice, relation)
Renders the valued -irredundance degree of a choice.
absirredx(self, choice, x)
Computes the crips -irredundance degree of node x in a choice.
abskernelrestrict(self, prekernel)
Parameter: prekernel
Renders absorbent prekernel restricted relation.
absorb(self, choice)
Renders the absorbency degree of a choice.
absorbentChoices(self, S)
Generates all minimal absorbent choices of a bipolar valued digraph.
addValuationAttribute(self)
Adds the numpy valuation attribute
agglomerationDistribution(self)
Output: aggloCoeffDistribution, meanCoeff
Renders the distribution of agglomeration coefficients.
aneighbors(self, node)
Renders the set of absorbed in-neighbors of a node.
automorphismGenerators(self)
Adds automorphism group generators to the digraph instance.
 
.. note::
 
    Dependency: Uses the dreadnaut command from the nauty software package. See https://www3.cs.stonybrook.edu/~algorith/implement/nauty/implement.shtml
 
    On Ubuntu Linux:
      ...$ sudo apt-get install nauty
averageCoveringIndex(self, choice, direction='out')
Renders the average covering index of a given choice in a set of objects,
ie the average number of choice members that cover each
non selected object.
bipolarKCorrelation(self, digraph, Debug=False)
Renders the bipolar Kendall correlation between two bipolar valued
digraphs computed from the average valuation of the
XORDigraph(self,digraph) instance.
 
.. warning::
 
     Obsolete! Is replaced by the self.computeBipolarCorrelation(other) Digraph method
bipolarKDistance(self, digraph, Debug=False)
Renders the bipolar crisp Kendall distance between two bipolar valued
digraphs.
 
.. warning::
 
     Obsolete! Is replaced by the self.computeBipolarCorrelation(other, MedianCut=True) Digraph method
chordlessPaths(self, Pk, n2, Odd=False, Comments=False, Debug=False)
New procedure from Agrum study April 2009
recursive chordless path extraction starting from path
Pk = [n2, ...., n1] and ending in node n2.
Optimized with marking of visited chordless P1s.
circuitAverageCredibility(self, circ)
Renders the average linking credibility of a Chordless Circuit.
circuitCredibilities(self, circuit, Debug=False)
Renders the average linking credibilities and the minimal link of a Chordless Circuit.
circuitMaxCredibility(self, circ)
Renders the maximal linking credibility of a Chordless Circuit.
circuitMinCredibility(self, circ)
Renders the minimal linking credibility of a Chordless Circuit.
closeSymmetric(self, InSite=True)
Produces the symmetric closure of self.relation.
closeTransitive(self, Reverse=False, InSite=True, Comments=False)
Produces the transitive closure of self.relation
 
*Parameters*:
 
    - If *Reverse* == True (False default) all transitive links are dropped, otherwise all transitive links are closed with min[r(x,y),r(y,z)];
    - If *Insite* == False (True by default) the methods return a modified copy of self.relation without altering the original self.relation, otherwise self.relation is modified.
components(self)
Renders the list of connected components.
computeAllDensities(self, choice=None)
parameter: choice in self
renders six densitiy parameters:
arc density, double arc density,
single arc density, strict single arc density,
absence arc density, strict absence arc densitiy.
computeArrowRaynaudOrder(self)
Renders a linear ordering from worst to best of the actions following Arrow&Raynaud's rule.
computeArrowRaynaudRanking(self)
renders a linear ranking from best to worst of the actions following Arrow&Raynaud's rule.
computeAverageValuation(self)
Computes the bipolar average correlation between
self and the crisp complete digraph of same order
of the irreflexive and determined arcs of the digraph
computeBadChoices(self, Comments=False)
Computes characteristic values for potentially bad choices.
 
.. note::
 
     Returns a tuple with following content:
 
     [(0)-determ,(1)degirred,(2)degi,(3)degd,(4)dega,(5)str(choice),(6)absvec]
computeBadPirlotChoices(self, Comments=False)
Characteristic values for potentially bad choices
using the Pirlot's fixpoint algorithm.
computeBestChoiceRecommendation(self, Verbose=False, Comments=False, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True)
Sets self.bestChoice, self.bestChoiceData, self.worstChoice and self.worstChoiceData
with the showBestChoiceRecommendation method.
 
First and last choices data is the following:
[(0)-determ,(1)degirred,(2)degi,(3)degd,(4)dega,(5)str(choice),(6)domvec,(7)cover]
 
self.bestChoice = self.bestChoiceData[5]
self.worstChoice = self.worstChoiceData[5]
computeBipolarCorrelation(self, other, MedianCut=False, filterRelation=None, Debug=False)
obsolete: dummy replacement for Digraph.computeOrdinalCorrelation method
computeChordlessCircuits(self, Odd=False, Comments=False, Debug=False)
Renders the set of all chordless circuits detected in a digraph.
Result is stored in <self.circuitsList>
holding a possibly empty list of tuples with at position 0 the
list of adjacent actions of the circuit and at position 1
the set of actions in the stored circuit.
 
When *Odd* is True, only chordless circuits with an odd length
are collected.
computeChordlessCircuitsMP(self, Odd=False, Threading=False, nbrOfCPUs=None, startMethod=None, Comments=False, Debug=False)
Multiprocessing version of computeChordlessCircuits().
 
Renders the set of all chordless odd circuits detected in a digraph.
Result (possible empty list) stored in <self.circuitsList>
holding a possibly empty list tuples with at position 0 the
list of adjacent actions of the circuit and at position 1
the set of actions in the stored circuit.
Inspired by Dias, Castonguay, Longo, Jradi, Algorithmica (2015).
 
Returns a possibly empty list of tuples (circuit,frozenset(circuit)).
 
If Odd == True, only circuits of odd length are retained in the result.
computeCoSize(self)
Renders the number of non validated non reflexive arcs
computeConcentrationIndex(self, X, N)
Renders the Gini concentration index of the X serie.
N contains the partial frequencies.
Based on the triangle summation formula.
computeConcentrationIndexTrapez(self, X, N)
Renders the Gini concentration index of the X serie.
N contains the partial frequencies.
Based on the triangles summation formula.
computeCondorcetLosers(self)
Wrapper for condorcetLosers().
computeCondorcetWinners(self)
Wrapper for condorcetWinners().
computeCopelandOrder(self)
renders a linear ordering from worst to best of the actions following Arrow&Raynaud's rule.
computeCopelandRanking(self)
renders a linear ranking from best to worst of the actions following Arrow&Raynaud's rule.
computeCutLevelDensities(self, choice, level)
parameter: choice in self, robustness level
renders three robust densitiy parameters:
robust double arc density,
robust single arc density,
robust absence arc densitiy.
computeDensities(self, choice)
parameter: choice in self
renders the four densitiy parameters:
arc density, double arc density, single arc density, absence arc density.
computeDeterminateness(self, InPercents=False)
Computes the Kendalll distance of self
with the all median-valued indeterminate digraph of order n.
 
Return the average determination of the irreflexive part of the digraph.
 
*determination* = sum_(x,y) { abs[ r(xRy) - Med ] } / n(n-1)
 
If *InPercents* is True, returns the average determination in percentage of
(Max - Med) difference.
 
>>> from outrankingDigraphs import BipolarOutrankingDigraph
>>> from randomPerfTabs import Random3ObjectivesPerformanceTableau
>>> t = Random3ObjectivesPerformanceTableau(numberOfActions=7,numberOfCriteria=7,seed=101)
>>> g = BipolarOutrankingDigraph(t,Normalized=True)
>>> g
*------- Object instance description ------*
Instance class      : BipolarOutrankingDigraph
Instance name       : rel_random3ObjectivesPerfTab
Actions             : 7
Criteria            : 7
Size                : 27
Determinateness (%) : 65.67
Valuation domain    : [-1.00;1.00]
>>> print(g.computeDeterminateness())
0.3134920634920634920634920638
>>> print(g.computeDeterminateness(InPercents=True))
65.67460317460317460317460320
>>> g.recodeValuation(0,1)
>>> g
*------- Object instance description ------*
Instance class      : BipolarOutrankingDigraph
Instance name       : rel_random3ObjectivesPerfTab
Actions             : 7
Criteria            : 7
Size                : 27
Determinateness (%) : 65.67
Valuation domain    : [0.00;1.00]
>>> print(g.computeDeterminateness())
0.1567460317460317460317460318
>>> print(g.computeDeterminateness(InPercents=True))
65.67460317460317460317460320
computeDiameter(self, Oriented=True)
Renders the (by default oriented) diameter of the digraph instance
computeDigraphCentres(self, WeakDistances=False, Comments=False)
The centers of a digraph are the nodes with finite minimal shortes path lengths.
 
The maximal neighborhood distances are stored in *self.maximalNeighborhoodDistances*.
 
The corresponding digraph radius and diameter are stored respectively  in *self.radius* and *self.diameter*.
 
With *Comments* = True, all these results are printed out.
 
*Source*: Claude Berge, *The Theory of Graphs*, Dover (2001) pp. 119, original in French Dunod (1958)
computeDynamicProgrammingStages(self, source, sink, Debug=False)
Renders the discrete stages of the optimal substructure for
dynamic pogramming digrahs from a given source node 
to a given sink sink node.
 
Returns a list of list of action identifyers.
computeGoodChoiceVector(self, ker, Comments=False)
| Computing Characteristic values for dominant pre-kernels
| using the von Neumann dual fixoint equation
computeGoodChoices(self, Comments=False)
Computes characteristic values for potentially good choices.
 
..note::
 
     Return a tuple with following content:
 
     [(0)-determ,(1)degirred,(2)degi,(3)degd,(4)dega,(5)str(choice),(6)domvec,(7)cover]
computeGoodPirlotChoices(self, Comments=False)
Characteristic values for potentially good choices
using the Pirlot fixpoint algorithm.
computeIncomparabilityDegree(self, InPercents=False, Comments=False)
Renders the incomparability degree (Decimal), i.e. the relative number of symmetric indeterminate relations of the irreflexive part of a digraph.
computeKemenyIndex(self, otherRelation)
renders the Kemeny index of the self.relation
compared with a given crisp valued relation of a compatible
other digraph (same nodes or actions).
computeKemenyOrder(self, orderLimit=7, Debug=False)
Renders a ordering from worst to best of the actions with maximal Kemeny index.
Return a tuple: kemenyOrder (from worst to best), kemenyIndex
computeKemenyRanking(self, orderLimit=7, seed=None, sampleSize=1000, Debug=False)
Renders a ranking from best to worst of the actions with maximal Kemeny index.
 
.. note::
 
     Returns a tuple: kemenyRanking (from best to worst), kemenyIndex.
computeKernelVector(self, kernel, Initial=True, Comments=False)
| Computing Characteristic values for dominant pre-kernels
| using the von Neumann dual fixpoint equation
computeKohlerOrder(self)
Renders an ordering (worst to best) of the actions following Kohler's rule.
computeKohlerRanking(self)
Renders a ranking (best to worst) of the actions following Kohler's rule.
computeMaxHoleSize(self, Comments=False)
Renders the length of the largest chordless cycle
in the corresponding disjunctive undirected graph.
computeMeanInDegree(self)
Renders the mean indegree of self.
!!! self.size must be set previously !!!
computeMeanOutDegree(self)
Renders the mean degree of self.
!!! self.size must be set previously !!!
computeMeanSymDegree(self)
Renders the mean degree of self.
!!! self.size must be set previously !!!
computeMedianOutDegree(self)
Renders the median outdegree of self.
!!! self.size must be set previously !!!
computeMedianSymDegree(self)
Renders the median symmetric degree of self.
!!! self.size must be set previously !!!
computeMoreOrLessUnrelatedPairs(self)
Renders a list of more or less unrelated pairs.
computeNetFlowsOrder(self)
Renders an ordered list (from best to worst) of the actions
following the net flows ranking rule.
computeNetFlowsOrderDict(self)
Renders an ordered list (from worst to best) of the actions
following the net flows ranking rule.
computeNetFlowsRanking(self)
Renders an ordered list (from best to worst) of the actions
following the net flows ranking rule.
computeNetFlowsRankingDict(self)
Renders an ordered list (from best to worst) of the actions
following the net flows ranking rule.
computeODistance(self, op2, comments=False)
renders the squared normalized distance of
two digraph valuations.
 
.. note::
 
     op2 = digraphs of same order as self.
computeOrbit(self, choice, withListing=False)
renders the set of isomorph copies of a choice following
the automorphism of the digraph self
computeOrderCorrelation(self, order, Debug=False)
Renders the ordinal correlation K of a digraph instance
when compared with a given linear order (from worst to best) of its actions
 
K = sum_{x != y} [ min( max(-self.relation(x,y)),other.relation(x,y), max(self.relation(x,y),-other.relation(x,y)) ]
 
K /= sum_{x!=y} [ min(abs(self.relation(x,y),abs(other.relation(x,y)) ]
 
.. note::
 
     Renders a dictionary with the key 'correlation' containing the actual bipolar correlation index and the key 'determination' containing the minimal determination level D of self and the other relation.
 
     D = sum_{x != y} min(abs(self.relation(x,y)),abs(other.relation(x,y)) / n(n-1)
 
     where n is the number of actions considered.
 
     The correlation index with a completely indeterminate relation
     is by convention 0.0 at determination level 0.0 .
 
.. warning::
 
     self must be a normalized outranking digraph instance !
computeOrdinalCorrelation(self, other, MedianCut=False, filterRelation=None, Debug=False)
Renders the bipolar correlation K of a
self.relation when compared
with a given compatible (same actions set)) digraph or
a [-1,1] valued compatible relation (same actions set).
 
If MedianCut=True, the correlation is computed on the median polarized relations.
 
If filterRelation is not None, the correlation is computed on the partial domain corresponding to the determined part of the filter relation.
 
.. warning::
 
     Notice that the 'other' relation and/or the 'filterRelation',
     the case given, must both be normalized, ie [-1,1]-valued !
 
K = sum_{x != y} [ min( max(-self.relation[x][y]),other.relation[x][y]), max(self.relation[x][y],-other.relation[x][y]) ]
 
K /= sum_{x!=y} [ min(abs(self.relation[x][y]),abs(other.relation[x][y])) ]
 
.. note::
 
     Renders a tuple with at position 0 the actual bipolar correlation index
     and in position 1 the minimal determination level D of self and
     the other relation.
 
     D = sum_{x != y} min(abs(self.relation[x][y]),abs(other.relation[x][y])) / n(n-1)
 
     where n is the number of actions considered.
 
     The correlation index with a completely indeterminate relation
     is by convention 0.0 at determination level 0.0 .
computeOrdinalCorrelationMP(self, other, MedianCut=False, Threading=False, nbrOfCPUs=None, startMethod=None, Comments=False, Debug=False)
Multi processing version of the digraphs.computeOrdinalCorrelation() method.
 
.. note::
     The relation filtering and the MedinaCut option are not implemented in the MP version.
computePairwiseClusterComparison(self, K1, K2, Debug=False)
Computes the pairwise cluster comparison credibility vector
from bipolar-valued digraph g. with K1 and K2 disjoint
lists of action keys from g actions disctionary.
Returns the dictionary
{'I': Decimal(),'P+':Decimal(),'P-':Decimal(),'R' :Decimal()}
where one and only one item is strictly positive.
computePreKernels(self)
computing dominant and absorbent preKernels:
    Result in self.dompreKernels and self.abspreKernels
computePreRankingRelation(self, preRanking, Normalized=True, Debug=False)
Renders the bipolar-valued relation obtained from
a given preRanking in decreasing levels (list of lists) result.
computePreorderRelation(self, preorder, Normalized=True, Debug=False)
Renders the bipolar-valued relation obtained from
a given preordering in increasing levels (list of lists) result.
computePrincipalOrder(self, Colwise=False, Comments=False)
Rendesr an ordering from wrost to best of the decision actions.
computePrincipalRanking(self, Colwise=False, Comments=False)
Rendesr a ranking from best to worst of the decision actions.
computePrincipalScores(self, plotFileName=None, Colwise=False, imageType=None, tempDir=None, bgcolor='cornsilk', Comments=False, Debug=False)
Renders a ordered list of the first principal eigenvector of the covariance of the valued outdegrees of self.
 
.. note::
 
   The method, relying on writing and reading temporary files by default in a temporary directory is threading and multiprocessing safe !
   (see Digraph.exportPrincipalImage method)
computePrudentBetaLevel(self, Debug=False)
computes alpha, ie the lowest valuation level, for which the
bipolarly polarised digraph doesn't contain a chordless circuit.
computeRankingByBestChoosing(self, CoDual=False, Debug=False)
Computes a weak preordering of the self.actions by recursive
best choice elagations.
 
Stores in self.rankingByBestChoosing['result'] a list of (P+,bestChoice) tuples
where P+ gives the best choice complement outranking
average valuation via the computePairwiseClusterComparison
method.
 
If self.rankingByBestChoosing['CoDual'] is True, 
the ranking-by-choosing was computed on the codual of self.
computeRankingByBestChoosingRelation(self, rankingByBestChoosing=None, Debug=False)
Renders the bipolar-valued relation obtained from
the self.rankingByBestChoosing result.
computeRankingByChoosing(self, actionsSubset=None, Debug=False, CoDual=False)
Computes a weak preordring of the self.actions by iterating
jointly first and last choice elagations.
 
Stores in self.rankingByChoosing['result'] a list of ((P+,bestChoice),(P-,worstChoice)) pairs
where P+ (resp. P-) gives the best (resp. worst) choice complement outranking
(resp. outranked) average valuation via the computePairwiseClusterComparison
method.
 
If self.rankingByChoosing['CoDual'] is True, the ranking-by-choosing was computed on the codual of self.
computeRankingByChoosingRelation(self, rankingByChoosing=None, actionsSubset=None, Debug=False)
Renders the bipolar-valued relation obtained from
the self.rankingByChoosing result.
computeRankingByLastChoosing(self, CoDual=False, Debug=False)
Computes a weak preordring of the self.actions by iterating
worst choice elagations.
 
Stores in self.rankingByLastChoosing['result'] a list of (P-,worstChoice) pairs
where P- gives the worst choice complement outranked
average valuation via the computePairwiseClusterComparison
method.
 
If self.rankingByChoosing['CoDual'] is True, the ranking-by-last-chossing 
was computed on the codual of self.
computeRankingByLastChoosingRelation(self, rankingByLastChoosing=None, Debug=False)
Renders the bipolar-valued relation obtained from
the self.rankingByLastChoosing result.
computeRankingCorrelation(self, ranking, Debug=False)
Renders the ordinal correlation K of a digraph instance
when compared with a given linear ranking of its actions
 
K = sum_{x != y} [ min( max(-self.relation(x,y)),other.relation(x,y), max(self.relation(x,y),-other.relation(x,y)) ]
 
K /= sum_{x!=y} [ min(abs(self.relation(x,y),abs(other.relation(x,y)) ]
 
.. note::
 
     Renders a tuple with at position 0 the actual bipolar correlation index
     and in position 1 the minimal determination level D of self and
     the other relation.
 
     D = sum_{x != y} min(abs(self.relation(x,y)),abs(other.relation(x,y)) / n(n-1)
 
     where n is the number of actions considered.
 
     The correlation index with a completely indeterminate relation
     is by convention 0.0 at determination level 0.0 .
computeRelationalStructure(self, Debug=False)
Renders the counted decomposition of the valued relations into
the following type of links:
gt '>', eq '=', lt '<', incomp '<>',
leq '<=', geq '>=', indeterm '?'
computeRubisChoice(self, Comments=False, _OldCoca=False, BrokenCocs=True, Threading=False, nbrOfCPUs=1)
Renders self.strictGoodChoices, self.nullChoices
self.strictBadChoices, self.nonRobustChoices.
 
.. warning::
    Changes in site the outranking digraph by
    adding or braking chordless odd outranking circuits.
computeRubyChoice(self, Comments=False, _OldCoca=False)
dummy for computeRubisChoice()
old versions compatibility.
computeShortestPathLengths(self, WeakPaths=False, Comments=False, Debug=False)
Renders a double dictionary with the directed distances, i.e. the shortest path lengths between all self.actions
 
Equals *None* if there does not exist a directed path between two actions.
 
*Source*: Claude Berge, *The Theory of Graphs*, Dover (2001) pp. 119, original in French Dunod (1958)
computeSingletonRanking(self, Comments=False, Debug=False)
Renders the sorted bipolar net determinatation of outrankingness
minus outrankedness credibilities of all singleton choices.
 
res = ((netdet,singleton,dom,absorb)+)
computeSize(self)
Renders the number of validated non reflexive arcs
computeSizeTransitiveClosure(self)
Renders the size of the transitive closure of a digraph.
computeSlaterOrder(self, isProbabilistic=False, seed=None, sampleSize=1000, Debug=False)
Reversed return from computeSlaterRanking method.
computeSlaterRanking(self, isProbabilistic=False, seed=None, sampleSize=1000, Debug=False)
Renders a ranking of the actions with minimal Slater index.
Return a tuple: slaterOrder, slaterIndex
computeSymmetryDegree(self, InPercents=False, Comments=False)
Renders the symmetry degree (Decimal) of the irreflexive part of a digraph.
 
.. note::
 
   Empty and indeterminate digraphs are considered to be symmetric.
computeTopologicalRanking(self, Debug=False)
Mimetic Wrapper of the topologicalSort() method.
computeTransitivityDegree(self, InPercents=False, Comments=False)
Renders the transitivity degree (Decimal) of a digraph.
 
.. note:: 
 
   An empty or indeterminate digraph is considered to be transitive.
computeUnrelatedPairs(self)
Renders a list of more or less unrelated pairs.
computeValuationLevels(self, choice=None, Debug=False)
renders the symmetric closure of the
apparent valuations levels of self
in an increasingly ordered list.
If parameter choice is given, the
computation is limited to the actions
of the choice.
computeValuationPercentages(self, choice, percentiles, withValues=False)
Parameters: choice and list of percentiles.
renders a series of percentages of the characteristics valuation of
the arcs in the digraph.
computeValuationPercentiles(self, choice, percentages, withValues=False)
Parameters: choice and list of percentages.
renders a series of quantiles of the characteristics valuation of
the arcs in the digraph.
computeValuationStatistics(self, Sampling=False, Comments=False)
Renders the mean and variance of the valuation
of the non reflexive pairs.
computeValuedRankingRelation(self, ranking)
Renders the valued relation characteristics compatible 
with the given linar ranking. Discordant charcateristics 
are set to the indeterminate value.
computeWeakCondorcetLosers(self)
Wrapper for weakCondorcetLosers().
computeWeakCondorcetWinners(self)
Wrapper for weakCondorcetWinners().
computeupdown1(self, s, S)
Help method for show_MIS_HB2 method.
fills self.newmisset, self.upmis, self.downmis.
computeupdown2(self, s, S)
Help method for show_MIS_HB1 method.
Fills self.newmisset, self.upmis, self.downmis.
computeupdown2irred(self, s, S)
Help method for show_MIS_HB1 method.
Fills self.newmisset, self.upmis, self.downmis.
condorcetLosers(self)
Renders the set of decision actions x such that
self.relation[x][y] < self.valuationdomain['med']
for all y != x.
condorcetWinners(self)
Renders the set of decision actions x such that
self.relation[x][y] > self.valuationdomain['med']
for all y != x.
contra(self, v)
Parameter: choice.
Renders the negation of a choice v characteristic's vector.
convertRelationToDecimal(self)
Converts the float valued self.relation in a decimal valued one.
convertValuation2Integer(self, InSite=True, Comments=False)
Converts the self.relation valuation to integer values by converting the Decimals to Fractions and multiply by the least commun multiple of the fraction denominators.
 
*Parameters*:
 
    - If *Insite* == False (True by default) the method returns a modified copy of self.relation without altering the original self.relation, otherwise self.relation and self.valuationdomain is modified.
convertValuationToDecimal(self)
Convert the float valuation limits to Decimals.
coveringIndex(self, choice, direction='out')
Renders the covering index of a given choice in a set of objects,
ie the minimum number of choice members that cover each
non selected object.
crispKDistance(self, digraph, Debug=False)
Renders the crisp Kendall distance between two bipolar valued
digraphs.
 
.. warning::
 
     Obsolete! Is replaced by the self.computeBipolarCorrelation(other, MedianCut=True) Digraph method
detectChordlessCircuits(self, Comments=False, Debug=False)
Detects a chordless circuit in a digraph.
Returns a Boolean
detectChordlessPath(self, Pk, n2, Comments=False, Debug=False)
New procedure from Agrum study April 2009
recursive chordless path extraction starting from path
Pk = [n2, ...., n1] and ending in node n2.
Optimized with marking of visited chordless P1s.
determinateness(self, vec, inPercent=True)
Renders the determinateness of a characteristic vector *vec* = 
[(r(x),x),(r(y),y), ...] of length *n* in valuationdomain [Min,Med,Max]:
 
*result* =  sum_x( abs(r(x)-Med) ) / ( n*(Max-Med) )
 
If inPercent, *result* shifted (+1) and reduced (/2) to [0,1] range.
digraph2Graph(self, valuationDomain={'min': -1, 'med': 0, 'max': 1}, Debug=False, ConjunctiveConversion=True)
Convert a Digraph instance to a Graph instance.
dneighbors(self, node)
Renders the set of dominated out-neighbors of a node.
domin(self, choice)
Renders the dominance degree of a choice.
dominantChoices(self, S)
Generates all minimal dominant choices of a bipolar valued digraph.
 
.. note::
 
     Initiate with S = self.actions.copy().
domirred(self, choice)
Renders the crips +irredundance degree of a choice.
domirredval(self, choice, relation)
Renders the valued +irredundance degree of a choice.
domirredx(self, choice, x)
Renders the crips +irredundance degree of node x in a choice.
domkernelrestrict(self, prekernel)
Parameter: dominant prekernel
Renders dominant prekernel restricted relation.
exportGraphViz(self, fileName=None, actionsSubset=None, bestChoice=set(), worstChoice=set(), firstChoice=set(), lastChoice=set(), Comments=True, graphType='png', pictureFormat=None, graphSize='7,7', relation=None, bgcolor='cornsilk')
export GraphViz dot file  for graph drawing filtering.
exportPrincipalImage(self, plotFileName=None, pictureFormat='pdf', bgcolor='cornsilk', fontcolor='red3', fontsize='0.75', Reduced=False, Colwise=False, tempDir='.', Comments=False)
Export as PDF (default) the principal projection of
the valued relation using the three principal eigen vectors.
 
Implemeted picture formats are: 
'pdf' (default), 'png', 'jpeg' and 'xfig'.
 
The background color is set by default to 'cornsilk'. 
 
Font size and color are set by default to 'red3', resp. '0.75'. 
 
When *Reduced==True*, the valued relation characeteristics are centered and reduced.
 
When *Colwise==True*, the column vectors of the adjacency table are used for the principal projection, otherwise the rows (default) are used. Has no incidence when the *Digraph* instance *self*  is symmetric. 
 
.. warning::
 
    The method, writing and reading temporary files: 
    tempCol.r and rotationCol.csv, resp. tempRow.r and rotationRow.csv,
    by default in the working directory (./),
    is hence not safe for multiprocessing programs, unless a
    temporary directory *tempDir* is provided.
flatChoice(self, ch, Debug=False)
Converts set or list ch recursively to a flat list of items.
forcedBestSingleChoice(self)
Renders the set of most determined outranking singletons in self.
gammaSets(self)
Renders the dictionary of neighborhoods {node: (dx,ax)}
with set *dx* gathering the dominated, and set *ax* gathering
the absorbed neighborhood.
generateAbsPreKernels(self)
Generate all absorbent prekernels from independent choices generator.
generateDomPreKernels(self)
Generate all dominant prekernels from independent choices generator.
htmlChoiceVector(self, ch, ChoiceVector=True, choiceType='good')
Show procedure for annotated bipolar choices.
inDegrees(self)
renders the median cut indegrees
inDegreesDistribution(self)
Renders the distribution of indegrees.
independentChoices(self, U)
Generator for all independent choices with neighborhoods of a bipolar valued digraph:
 
.. note::
 
       * Initiate with U = self.singletons().
       * Yields [(independent choice, domnb, absnb, indnb)].
inner_prod(self, v1, v2)
Parameters: two choice characteristic vectors
Renders the inner product of two characteristic vetors.
intstab(self, choice)
Computes the independence degree of a choice.
irreflex(self, mat)
Puts diagonal entries of mat to valuationdomain['min']
isAsymmetricIndeterminate(self, Debug=False)
Checks the self.relation for assymmetric indeterminateness!!
 
.. warning::
 
    The reflexive links are ignored !!
isComplete(self, Debug=False)
checks the completeness property of self.relation by checking
for the absence of a link between two actions!!
 
.. warning::
 
    The reflexive links are ignored !!
isCyclic(self, Debug=False)
checks the cyclicity of self.relation by checking
for a reflexive loop in its transitive closure-
 
.. warning::
 
     self.relation is supposed to be irreflexive !
isIntegerValued(self, Debug=False)
Checks whether the decimal valuation of self is integer-valued
be using the as_integer_ratio() method of a Decimal 
giving a tuple (numerator,denominator). If denominator == 1, the
number is an integer.
isOutrankingDigraph(self, Comments=True, Debug=False)
Checks the outranking digraph characteristic condition (3.3).
 
relation[x][y] + relation[y][x)[y] >= 0.0
 
.. warning::
 
    The reflexive links are ignored and the valuation must be bipolar !!
isStrictOutrankingDigraph(self, Comments=True, Debug=False)
Checks the strict outranking digraph characteristic condition (3.1).
 
-(relation[x][y] + relation[y][x]) <= 0.0 , x != y
 
.. warning::
 
    The reflexive links are ignored and the valuation must be bipolar !!
isSymmetric(self, Comments=False)
True if symmetry degree == 1.0.
isTransitive(self, Comments=False)
True if transitivity degree == 1.0.
isWeaklyComplete(self, Debug=False)
checks the weakly completeness property of self.relation by checking
for the absence of a link between two actions!!
 
.. warning::
 
    The reflexive links are ignored !!
iterateRankingByChoosing(self, Odd=False, CoDual=False, Comments=True, Debug=False, Limited=None)
Renders a ranking by choosing result when progressively eliminating
all chordless (odd only) circuits with rising valuation cut levels.
 
Parameters
    CoDual = False (default)/True
    Limited = proportion (in [0,1]) * (max - med) valuationdomain
kChoices(self, A, k)
Renders all choices of length k from set A
matmult2(self, m, v)
Parameters: digraph relation and choice characteristic vector
matrix multiply vector by inner production
meanDegree(self)
Renders the mean degree of self.
!!! self.size must be set previously !!!
meanLength(self, Oriented=False)
Renders the (by default non-oriented) mean neighbourhoor depth of self.
!!! self.order must be set previously !!!
minimalChoices(self, S)
Generates all dominant or absorbent choices of a bipolar
valued digraph.
 
.. note:
 
   * Initiate with S = (actions, dict of dominant or absorbent closed neighborhoods)
   * See showMinDom and showMinAbs methods.
minimalValuationLevelForCircuitsElimination(self, Odd=True, Debug=False, Comments=False)
renders the minimal valuation level <lambda> that eliminates all
self.circuitsList stored odd chordless circuits from self.
 
.. warning::
 
    The <lambda> level polarised may still contain newly appearing chordless odd circuits !
neighbourhoodCollection(self, Oriented=False, Potential=False)
Renders the neighbourhood.
neighbourhoodDepthDistribution(self, Oriented=False)
Renders the distribtion of neighbourhood depths.
notGammaSets(self)
Renders the dictionary of neighborhoods {node: (dx,ax)}
with set *dx* gathering the not dominated, and set *ax* gathering
the not absorbed neighborhood.
notaneighbors(self, node)
Renders the set of absorbed not in-neighbors of a node.
notdneighbors(self, node)
Renders the set of not dominated out-neighbors of a node.
outDegrees(self)
renders the median cut outdegrees
outDegreesDistribution(self)
Renders the distribution of outdegrees.
plusirredundant(self, U)
Generates all +irredundant choices of a digraph.
powerset(self, U)
Generates all subsets of a set.
readPerrinMisset(self, file='curd.dat')
read method for 0-1-char-coded MISs by default from the perrinMIS.c curd.dat result file.
readabsvector(self, x, relation)
Parameter: action x
absorbent in vector.
readdomvector(self, x, relation)
Parameter: action x
dominant out vector.
recodeValuation(self, newMin=-1.0, newMax=1.0, ndigits=4, Debug=False)
Recodes the characteristic valuation domain according
to the parameters given. 
 
*ndigits* indicates the number of decimal digits of the valuation.
relationFct(self, x, y)
wrapper for self.relation dictionary access to ensure interoperability
with the sparse and big outranking digraph implementation model.
save(self, fileName='tempdigraph', option=None, DecimalValuation=True, decDigits=2)
Persistent storage of a Digraph class instance in the form of
a python source code file
saveCSV(self, fileName='tempdigraph', Normalized=False, Dual=False, Converse=False, Diagonal=False, Debug=False)
Persistent storage of a Digraph class instance in the form of
a csv file.
saveXMCDA2(self, fileName='temp', fileExt='xmcda2', Comments=True, relationName='R', relationType='binary', category='random', subcategory='valued', author='digraphs Module (RB)', reference='saved from Python', valuationType='standard', digits=2, servingD3=False)
save digraph in XMCDA 2.0 format. Deprecated now.
savedre(self, fileName='temp')
save digraph in nauty format.
sharp(self, x, y)
Paramaters: choice characteristic values.
Renders the sharpest of two characteristic values x and y.
sharpvec(self, v, w)
Paramaters: choice characteristic vectors.
Renders the sharpest of two characteristic vectors v and w.
showActions(self)
presentation methods for digraphs actions
showAll(self)
Detailed show method for genuine digraphs.
showAttributes(self)
Prints out the attributes of self.
showAutomorphismGenerators(self)
Renders the generators of the automorphism group.
showBadChoices(self, Recompute=True)
Characteristic values for potentially bad choices.
showBestChoiceRecommendation(self, Verbose=False, Comments=True, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True)
Shows the RuBis best choice recommendation.
 
.. note::
 
    Computes by default the Rubis best choice recommendation on the corresponding strict (codual) outranking digraph.
 
    By default, with BrokenCocs=True, we brake all chordless circuits at their weakest determined ( abs(r(x>y)) + abs(r(y>x)) ) link.
 
    When BrokenCocs=False we proceed like follows:
 
    In case of chordless circuits, if supporting arcs are more credible
    than the reversed negating arcs, we collapse the circuits into hyper nodes.
    Inversely,  if supporting arcs are not more credible than the reversed negating arcs,
    we brake the circuits on their weakest arc.
 
Usage example:
 
>>> from outrankingDigraphs import *
>>> t = Random3ObjectivesPerformanceTableau(seed=5)
>>> g = BipolarOutrankingDigraph(t)
>>> g.showBestChoiceRecommendation()
***********************
RuBis Best Choice Recommendation (BCR)
(in decreasing order of determinateness)   
Credibility domain:  [-100.0, 100.0]
=== >> potential first choices
* choice              : ['a04', 'a14', 'a19', 'a20']
   independence        : 1.19
   dominance           : 4.76
   absorbency          : -59.52
   covering (%)        : 75.00
   determinateness (%) : 57.86
   - most credible action(s) = { 'a14': 23.81, 'a19': 11.90, 'a04': 2.38, 'a20': 1.19, }  
=== >> potential last choices 
* choice              : ['a03', 'a12', 'a17']
  independence        : 4.76
  dominance           : -76.19
  absorbency          : 4.76
  covering (%)        : 0.00
  determinateness (%) : 65.39
  - most credible action(s) = { 'a03': 38.10, 'a12': 13.10, 'a17': 4.76, }
Execution time: 0.024 seconds
*****************************
showChoiceVector(self, ch, choiceType='good', ChoiceVector=True)
Show procedure for annotated bipolar choices.
showChordlessCircuits(self, Recompute=False)
Show method for chordless circuits observed in a Digraph instance.
 
If previous computation is required, stores the detected circuits in self.circuitsList attribute.
showComponents(self)
Shows the list of connected components of the digraph instance.
showCorrelation(self, corr=None, ndigits=3)
Renders the valued ordinal correlation index, the crisp Kendall tau index and their epistemic determination degree.
showFirstChoiceRecommendation(self, Verbose=False, Comments=True, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True)
Shows the RuBis first choice recommendation.
 
.. note::
 
    Computes by default the Rubis first choice recommendation on the corresponding strict (codual) outranking digraph.
 
    By default, with BrokenCocs=True, we brake all chordless circuits at their weakest determined ( abs(r(x>y)) + abs(r(y>x)) ) link.
 
    When BrokenCocs=False we proceed like follows:
 
    In case of chordless circuits, if supporting arcs are more credible
    than the reversed negating arcs, we collapse the circuits into hyper nodes.
    Inversely,  if supporting arcs are not more credible than the reversed negating arcs,
    we brake the circuits on their weakest arc.
 
Usage example:
 
>>> from outrankingDigraphs import *
>>> t = Random3ObjectivesPerformanceTableau(seed=5)
>>> g = BipolarOutrankingDigraph(t)
>>> g.showFirstChoiceRecommendation()
***********************
RuBis First Choice Recommendation (BCR)
(in decreasing order of determinateness)   
Credibility domain:  [-100.0, 100.0]
=== >> potential first choices
* choice              : ['a04', 'a14', 'a19', 'a20']
   independence        : 1.19
   dominance           : 4.76
   absorbency          : -59.52
   covering (%)        : 75.00
   determinateness (%) : 57.86
   - most credible action(s) = { 'a14': 23.81, 'a19': 11.90, 'a04': 2.38, 'a20': 1.19, }  
=== >> potential last choices 
* choice              : ['a03', 'a12', 'a17']
  independence        : 4.76
  dominance           : -76.19
  absorbency          : 4.76
  covering (%)        : 0.00
  determinateness (%) : 65.39
  - most credible action(s) = { 'a03': 38.10, 'a12': 13.10, 'a17': 4.76, }
Execution time: 0.024 seconds
*****************************
showGoodChoices(self, Recompute=True)
Characteristic values for potentially good choices.
showHTMLBestChoiceRecommendation(self, pageTitle=None, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True, htmlFileName=None)
showHTMLRelationHeatmap(self, actionsList=None, rankingRule='NetFlows', colorLevels=7, tableTitle='Relation Heatmap', relationName='r(x S y)', ndigits=2, fromIndex=None, toIndex=None, htmlFileName=None)
Launches a browser window with the colored relation map of self.
 
See corresponding :py:class:`~digraphs.Digraph.showHTMLRelationMap` method.
 
The *colorLevels* parameter may be set to 3, 5, 7 (default) or 9.
 
When the *actionsList* parameter is *None* (default), the digraphs actions list may be ranked with the *rankingRule* parameter set to the 'Copeland' (default) or to the 'Netlows' ranking rule.
 
When the *htmlFileName* parameter is set to a string value 'xxx', a html file named 'xxx.html' will be generated in the current working directory. Otherwise, a temporary file named 'tmp*.html' will be generated there.
 
Example::
 
    >>> from outrankingDigraphs import *
    >>> t = RandomCBPerformanceTableau(numberOfActions=25,seed=1)
    >>> g = BipolarOutrankingDigraph(t,ndigits=2)
    >>> gcd = ~(-g)  # strict outranking relation
    >>> gcd.showHTMLRelationHeatmap(colorLevels=7,ndigits=2)
    
.. image:: relationHeatmap.png
   :alt: Browser view of a relation map
   :width: 600 px
   :align: center
showHTMLRelationMap(self, actionsList=None, rankingRule='Copeland', Colored=True, tableTitle='Relation Map', relationName='r(x S y)', symbols=['+', '&middot;', '&nbsp;', '&#150;', '&#151'], fromIndex=None, toIndex=None, htmlFileName=None)
Launches a browser window with the colored relation map of self.
See corresponding Digraph.showRelationMap() method.
 
When *htmlFileName* parameter is set to a string value, a html file
with that name will be stored in the current working directory.
 
By default, a temporary file named: tmp*.html will be generated
instead in the current working directory.
 
Example::
 
    >>> from outrankingDigraphs import *
    >>> t = RandomCBPerformanceTableau(numberOfActions=25,seed=1)
    >>> g = BipolarOutrankingDigraph(t,Normalized=True)
    >>> gcd = ~(-g)  # strict outranking relation
    >>> gcd.showHTMLRelationMap(rankingRule="NetFlows")
    
.. image:: relationMap.png
   :alt: Browser view of a relation map
   :width: 600 px
   :align: center
showHTMLRelationTable(self, actionsList=None, relation=None, IntegerValues=False, ndigits=2, Colored=True, tableTitle='Valued Adjacency Matrix', relationName='r(x S y)', ReflexiveTerms=False, htmlFileName=None, fromIndex=None, toIndex=None)
Launches a browser window with the colored relation table of self.
showMIS(self, withListing=True)
Prints all maximal independent choices:
    Result in self.misset.
showMIS_AH(self, withListing=True)
Prints all MIS using the Hertz method.
 
Result saved in self.hertzmisset.
showMIS_HB2(self, withListing=True)
Prints all MIS using the Hertz-Bisdorff method.
 
Result saved in self.newmisset.
showMIS_RB(self, withListing=True)
Prints all MIS using the Bisdorff method.
 
Result saved in self.newmisset.
showMIS_UD(self, withListing=True)
Prints all MIS using the Hertz-Bisdorff method.
 
Result saved in self.newmisset.
showMaxAbsIrred(self, withListing=True)
Computing maximal -irredundant choices:
    Result in self.absirset.
showMaxDomIrred(self, withListing=True)
Computing maximal +irredundant choices:
   Result in self.domirset.
showMinAbs(self, withListing=True)
Prints minimal absorbent choices:
    Result in self.absset.
showMinDom(self, withListing=True)
Prints all minimal dominant choices:
    Result in self.domset.
showNeighborhoods(self)
Lists the gamma and the notGamma function of self.
showOrbits(self, InChoices, withListing=True)
Prints the orbits of Choices along the automorphisms of
the Digraph instance.
 
Example Python session for computing the non isomorphic MISs from the 12-cycle graph:
 
>>> from digraphs import *
>>> c12 = CirculantDigraph(order=12,circulants=[1,-1])
>>> c12.automorphismGenerators()
...
  Permutations
  {'1': '1', '2': '12', '3': '11', '4': '10', '5': 
   '9', '6': '8', '7': '7', '8': '6', '9': '5', '10': 
   '4', '11': '3', '12': '2'}
  {'1': '2', '2': '1', '3': '12', '4': '11', '5': '10', 
   '6': '9', '7': '8', '8': '7', '9': '6', '10': '5', 
   '11': '4', '12': '3'}
  Reflections {}
>>> print('grpsize = ', c12.automorphismGroupSize)
  grpsize = 24
>>> c12.showMIS(withListing=False)
  *---  Maximal independent choices ---*
  number of solutions:  29
  cardinality distribution
  card.:  [0, 1, 2, 3, 4,  5,  6, 7, 8, 9, 10, 11, 12]
  freq.:  [0, 0, 0, 0, 3, 24,  2, 0, 0, 0,  0,  0,  0]
  Results in c12.misset
>>> c12.showOrbits(c12.misset,withListing=False)
...
  *---- Global result ----
  Number of MIS:  29
  Number of orbits :  4
  Labelled representatives:
  1: ['2','4','6','8','10','12']
  2: ['2','5','8','11']
  3: ['2','4','6','9','11']
  4: ['1','4','7','9','11']
  Symmetry vector
  stabilizer size: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, ...]
  frequency      : [0, 2, 0, 0, 0, 0, 0, 1, 0,  0,  0,  1, ...]
 
*Figure*: The symmetry axes of the non isomorphic MISs of the 12-cycle:
 
.. image:: c12.png
   :width: 400 px
   :align: center
   :alt: The 4 non isomorphic MIS of the 12-cycle graph
 
*Reference*: R. Bisdorff and J.L. Marichal (2008). Counting non-isomorphic maximal independent sets of the n-cycle graph. *Journal of Integer Sequences*, Vol. 11 Article 08.5.7 (`openly accessible here <https://www.cs.uwaterloo.ca/journals/JIS/VOL11/Marichal/marichal.html>`_)
showOrbitsFromFile(self, InFile, withListing=True)
Prints the orbits of Choices along the automorphisms of
the digraph self by reading in the 0-1 misset file format.
See the :py:func:`digraphs.Digraph.readPerrinMisset` method.
showPreKernels(self, withListing=True)
Printing dominant and absorbent preKernels:
    Result in self.dompreKernels and self.abspreKernels
showRankingByBestChoosing(self, rankingByBestChoosing=None)
A show method for self.rankinByBestChoosing result.
 
.. warning::
 
     The self.computeRankingByBestChoosing(CoDual=False/True) method instantiating the self.rankingByBestChoosing slot is pre-required !
showRankingByChoosing(self, rankingByChoosing=None, WithCoverCredibility=False)
A show method for self.rankinByChoosing result.
 
When parameter *WithCoverCredibility* is set to True, the credibility of outranking, respectively being outranked is indicated at each selection step. 
 
.. warning::
 
     The self.computeRankingByChoosing(CoDual=False/True) method instantiating the self.rankingByChoosing slot is pre-required !
showRankingByLastChoosing(self, rankingByLastChoosing=None, Debug=None)
A show method for self.rankinByChoosing result.
 
.. warning::
 
     The self.computeRankingByLastChoosing(CoDual=False/True) method instantiating the self.rankingByChoosing slot is pre-required !
showRelation(self)
prints the relation valuation in ##.## format.
showRelationMap(self, symbols=None, rankingRule='Copeland', fromIndex=None, toIndex=None, actionsList=None)
Prints on the console, in text map format, the location of
certainly validated and certainly invalidated outranking situations.
 
By default, symbols = {'max':'┬','positive': '+', 'median': ' ',
                       'negative': '-', 'min': '┴'}
 
The default ordering of the output is following the Copeland ranking rule
from best to worst actions. Further available ranking rule is the 'NetFlows' net flows rule.
 
 
Example::
 
    >>> from outrankingDigraphs import *
    >>> t = RandomCBPerformanceTableau(numberOfActions=25,seed=1)
    >>> g = BipolarOutrankingDigraph(t,Normalized=True)
    >>> gcd = ~(-g)  # strict outranking relation
    >>> gcd.showRelationMap(rankingRule="NetFlows")
     -   ++++++++  +++++┬+┬┬+
    - -   + +++++ ++┬+┬+++┬++
    ┴+  ┴ + ++  ++++┬+┬┬++┬++
    -   ++ - ++++-++++++┬++┬+
       - - - ++- ┬- + -+┬+-┬┬
    -----  -      -┬┬┬-+  -┬┬
    ----    --+-+++++++++++++
    -- --+- --++ ++ +++-┬+-┬┬
    ----  -  -+-- ++--+++++ +
    ----- ++- --- +---++++┬ +
    -- -- ---+ -++-+++-+ +-++
    -- --┴---+  + +-++-+ -  +
    ---- ┴---+-- ++--++++ - +
      --┴┴--  --- -  --+ --┬┬
     ---------+--+ ----- +-┬┬
    -┴---┴- ---+- + ---+++┬ +
    -┴┴--┴---+--- ++ -++--+++
    -----┴--- ---+-+- ++---+ 
    -┴┴--------------- --++┬ 
    --┴---------------- --+┬ 
    ┴--┴┴ -┴--┴┴-┴ --++  ++-+
    ----┴┴--------------- -  
    ┴┴┴----+-┴+┴---┴-+---+ ┴+
    ┴┴-┴┴┴-┴- - -┴┴---┴┴+ ┬ -
    ----┴┴-┴-----┴┴---  - -- 
    Ranking rule: NetFlows
    >>>
showRelationTable(self, Sorted=True, rankingRule=None, IntegerValues=False, actionsSubset=None, relation=None, ndigits=2, ReflexiveTerms=True, fromIndex=None, toIndex=None)
Prints the relation valuation in actions X actions table format.
Copeland and NetFlows rankings my be used.
showRubisBestChoiceRecommendation(self, **kwargs)
Dummy for backward portable showBestChoiceRecommendation().
showRubyChoice(self, Verbose=False, Comments=True, _OldCoca=True)
Dummy for showBestChoiceRecommendation()
needed for older versions compatibility.
showShort(self)
concise presentation method for genuine digraphs.
showSingletonRanking(self, Comments=True, Debug=False)
Calls self.computeSingletonRanking(comments=True,Debug = False).
Renders and prints the sorted bipolar net determinatation of outrankingness
minus outrankedness credibilities of all singleton choices.
 
res = ((netdet,sigleton,dom,absorb)+)
showStatistics(self)
Computes digraph statistics like order, size and arc-density.
showdre(self)
Shows relation in nauty format.
singletons(self)
list of singletons and neighborhoods
[(singx1, +nx1, -nx1, not(+nx1 or -nx1)),.... ]
sizeSubGraph(self, choice)
Output: (size, undeterm,arcDensity).
Renders the arc density of the induced subgraph.
strongComponents(self, setPotential=False)
Renders the set of strong components of self.
symDegreesDistribution(self)
Renders the distribution of symmetric degrees.
topologicalSort(self, Debug=False)
If self is acyclic, adds topological sort number to each node of self
and renders ordered list of nodes. Otherwise renders None.
Source: M. Golumbic Algorithmic Graph heory and Perfect Graphs,
Annals Of Discrete Mathematics 57 2nd Ed. , Elsevier 2004, Algorithm 2.4 p.44.
weakAneighbors(self, node)
Renders the set of absorbed in-neighbors of a node.
weakCondorcetLosers(self)
Renders the set of decision actions x such that
self.relation[x][y] <= self.valuationdomain['med']
for all y != x.
weakCondorcetWinners(self)
Renders the set of decision actions x such that
self.relation[x][y] >= self.valuationdomain['med']
for all y != x.
weakDneighbors(self, node)
Renders the set of dominated out-neighbors of a node.
weakGammaSets(self)
Renders the dictionary of neighborhoods {node: (dx,ax)}
zoomValuation(self, zoomFactor=1.0)
Zooms in or out, depending on the value of the zoomFactor provided,
the bipolar valuation of a digraph.

Data descriptors inherited from Digraph:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class CoverDigraph(Digraph)
    CoverDigraph(other, Debug=False)
 
Instantiates the associated cover relation -immediate neighbours- from
a deep copy of a given Digraph called *other*. The Hasse diagram for instance is the cover
relation of a transitive digraph.
 
.. note::
 
    Instantiates as other.__class__ !
    Copies the case given the other.description, the other.criteria
    and the other.evaluation dictionaries into self.
 
 
Method resolution order:
CoverDigraph
Digraph
builtins.object

Methods defined here:
__init__(self, other, Debug=False)
Initialize self.  See help(type(self)) for accurate signature.

Methods inherited from Digraph:
MISgen(self, S, I)
generator of maximal independent choices (voir Byskov 2004):
    * S ::= remaining nodes;
    * I ::= current independent choice
 
.. note::
 
        Inititalize: self.MISgen(self.actions.copy(),set())
__invert__(self)
Make the inverting operator ~self available for Digraph instances. 
 
Returns a ConverseDigraph instance of self.
__neg__(self)
Make the negation operator -self available for Digraph instances. 
 
Returns a DualDigraph instance of self.
__repr__(self)
Default presentation method for Digraph instances.
absirred(self, choice)
Renders the crips -irredundance degree of a choice.
absirredundant(self, U)
Generates all -irredundant choices of a digraph.
absirredval(self, choice, relation)
Renders the valued -irredundance degree of a choice.
absirredx(self, choice, x)
Computes the crips -irredundance degree of node x in a choice.
abskernelrestrict(self, prekernel)
Parameter: prekernel
Renders absorbent prekernel restricted relation.
absorb(self, choice)
Renders the absorbency degree of a choice.
absorbentChoices(self, S)
Generates all minimal absorbent choices of a bipolar valued digraph.
addValuationAttribute(self)
Adds the numpy valuation attribute
agglomerationDistribution(self)
Output: aggloCoeffDistribution, meanCoeff
Renders the distribution of agglomeration coefficients.
aneighbors(self, node)
Renders the set of absorbed in-neighbors of a node.
automorphismGenerators(self)
Adds automorphism group generators to the digraph instance.
 
.. note::
 
    Dependency: Uses the dreadnaut command from the nauty software package. See https://www3.cs.stonybrook.edu/~algorith/implement/nauty/implement.shtml
 
    On Ubuntu Linux:
      ...$ sudo apt-get install nauty
averageCoveringIndex(self, choice, direction='out')
Renders the average covering index of a given choice in a set of objects,
ie the average number of choice members that cover each
non selected object.
bipolarKCorrelation(self, digraph, Debug=False)
Renders the bipolar Kendall correlation between two bipolar valued
digraphs computed from the average valuation of the
XORDigraph(self,digraph) instance.
 
.. warning::
 
     Obsolete! Is replaced by the self.computeBipolarCorrelation(other) Digraph method
bipolarKDistance(self, digraph, Debug=False)
Renders the bipolar crisp Kendall distance between two bipolar valued
digraphs.
 
.. warning::
 
     Obsolete! Is replaced by the self.computeBipolarCorrelation(other, MedianCut=True) Digraph method
chordlessPaths(self, Pk, n2, Odd=False, Comments=False, Debug=False)
New procedure from Agrum study April 2009
recursive chordless path extraction starting from path
Pk = [n2, ...., n1] and ending in node n2.
Optimized with marking of visited chordless P1s.
circuitAverageCredibility(self, circ)
Renders the average linking credibility of a Chordless Circuit.
circuitCredibilities(self, circuit, Debug=False)
Renders the average linking credibilities and the minimal link of a Chordless Circuit.
circuitMaxCredibility(self, circ)
Renders the maximal linking credibility of a Chordless Circuit.
circuitMinCredibility(self, circ)
Renders the minimal linking credibility of a Chordless Circuit.
closeSymmetric(self, InSite=True)
Produces the symmetric closure of self.relation.
closeTransitive(self, Reverse=False, InSite=True, Comments=False)
Produces the transitive closure of self.relation
 
*Parameters*:
 
    - If *Reverse* == True (False default) all transitive links are dropped, otherwise all transitive links are closed with min[r(x,y),r(y,z)];
    - If *Insite* == False (True by default) the methods return a modified copy of self.relation without altering the original self.relation, otherwise self.relation is modified.
components(self)
Renders the list of connected components.
computeAllDensities(self, choice=None)
parameter: choice in self
renders six densitiy parameters:
arc density, double arc density,
single arc density, strict single arc density,
absence arc density, strict absence arc densitiy.
computeArrowRaynaudOrder(self)
Renders a linear ordering from worst to best of the actions following Arrow&Raynaud's rule.
computeArrowRaynaudRanking(self)
renders a linear ranking from best to worst of the actions following Arrow&Raynaud's rule.
computeAverageValuation(self)
Computes the bipolar average correlation between
self and the crisp complete digraph of same order
of the irreflexive and determined arcs of the digraph
computeBadChoices(self, Comments=False)
Computes characteristic values for potentially bad choices.
 
.. note::
 
     Returns a tuple with following content:
 
     [(0)-determ,(1)degirred,(2)degi,(3)degd,(4)dega,(5)str(choice),(6)absvec]
computeBadPirlotChoices(self, Comments=False)
Characteristic values for potentially bad choices
using the Pirlot's fixpoint algorithm.
computeBestChoiceRecommendation(self, Verbose=False, Comments=False, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True)
Sets self.bestChoice, self.bestChoiceData, self.worstChoice and self.worstChoiceData
with the showBestChoiceRecommendation method.
 
First and last choices data is the following:
[(0)-determ,(1)degirred,(2)degi,(3)degd,(4)dega,(5)str(choice),(6)domvec,(7)cover]
 
self.bestChoice = self.bestChoiceData[5]
self.worstChoice = self.worstChoiceData[5]
computeBipolarCorrelation(self, other, MedianCut=False, filterRelation=None, Debug=False)
obsolete: dummy replacement for Digraph.computeOrdinalCorrelation method
computeChordlessCircuits(self, Odd=False, Comments=False, Debug=False)
Renders the set of all chordless circuits detected in a digraph.
Result is stored in <self.circuitsList>
holding a possibly empty list of tuples with at position 0 the
list of adjacent actions of the circuit and at position 1
the set of actions in the stored circuit.
 
When *Odd* is True, only chordless circuits with an odd length
are collected.
computeChordlessCircuitsMP(self, Odd=False, Threading=False, nbrOfCPUs=None, startMethod=None, Comments=False, Debug=False)
Multiprocessing version of computeChordlessCircuits().
 
Renders the set of all chordless odd circuits detected in a digraph.
Result (possible empty list) stored in <self.circuitsList>
holding a possibly empty list tuples with at position 0 the
list of adjacent actions of the circuit and at position 1
the set of actions in the stored circuit.
Inspired by Dias, Castonguay, Longo, Jradi, Algorithmica (2015).
 
Returns a possibly empty list of tuples (circuit,frozenset(circuit)).
 
If Odd == True, only circuits of odd length are retained in the result.
computeCoSize(self)
Renders the number of non validated non reflexive arcs
computeConcentrationIndex(self, X, N)
Renders the Gini concentration index of the X serie.
N contains the partial frequencies.
Based on the triangle summation formula.
computeConcentrationIndexTrapez(self, X, N)
Renders the Gini concentration index of the X serie.
N contains the partial frequencies.
Based on the triangles summation formula.
computeCondorcetLosers(self)
Wrapper for condorcetLosers().
computeCondorcetWinners(self)
Wrapper for condorcetWinners().
computeCopelandOrder(self)
renders a linear ordering from worst to best of the actions following Arrow&Raynaud's rule.
computeCopelandRanking(self)
renders a linear ranking from best to worst of the actions following Arrow&Raynaud's rule.
computeCutLevelDensities(self, choice, level)
parameter: choice in self, robustness level
renders three robust densitiy parameters:
robust double arc density,
robust single arc density,
robust absence arc densitiy.
computeDensities(self, choice)
parameter: choice in self
renders the four densitiy parameters:
arc density, double arc density, single arc density, absence arc density.
computeDeterminateness(self, InPercents=False)
Computes the Kendalll distance of self
with the all median-valued indeterminate digraph of order n.
 
Return the average determination of the irreflexive part of the digraph.
 
*determination* = sum_(x,y) { abs[ r(xRy) - Med ] } / n(n-1)
 
If *InPercents* is True, returns the average determination in percentage of
(Max - Med) difference.
 
>>> from outrankingDigraphs import BipolarOutrankingDigraph
>>> from randomPerfTabs import Random3ObjectivesPerformanceTableau
>>> t = Random3ObjectivesPerformanceTableau(numberOfActions=7,numberOfCriteria=7,seed=101)
>>> g = BipolarOutrankingDigraph(t,Normalized=True)
>>> g
*------- Object instance description ------*
Instance class      : BipolarOutrankingDigraph
Instance name       : rel_random3ObjectivesPerfTab
Actions             : 7
Criteria            : 7
Size                : 27
Determinateness (%) : 65.67
Valuation domain    : [-1.00;1.00]
>>> print(g.computeDeterminateness())
0.3134920634920634920634920638
>>> print(g.computeDeterminateness(InPercents=True))
65.67460317460317460317460320
>>> g.recodeValuation(0,1)
>>> g
*------- Object instance description ------*
Instance class      : BipolarOutrankingDigraph
Instance name       : rel_random3ObjectivesPerfTab
Actions             : 7
Criteria            : 7
Size                : 27
Determinateness (%) : 65.67
Valuation domain    : [0.00;1.00]
>>> print(g.computeDeterminateness())
0.1567460317460317460317460318
>>> print(g.computeDeterminateness(InPercents=True))
65.67460317460317460317460320
computeDiameter(self, Oriented=True)
Renders the (by default oriented) diameter of the digraph instance
computeDigraphCentres(self, WeakDistances=False, Comments=False)
The centers of a digraph are the nodes with finite minimal shortes path lengths.
 
The maximal neighborhood distances are stored in *self.maximalNeighborhoodDistances*.
 
The corresponding digraph radius and diameter are stored respectively  in *self.radius* and *self.diameter*.
 
With *Comments* = True, all these results are printed out.
 
*Source*: Claude Berge, *The Theory of Graphs*, Dover (2001) pp. 119, original in French Dunod (1958)
computeDynamicProgrammingStages(self, source, sink, Debug=False)
Renders the discrete stages of the optimal substructure for
dynamic pogramming digrahs from a given source node 
to a given sink sink node.
 
Returns a list of list of action identifyers.
computeGoodChoiceVector(self, ker, Comments=False)
| Computing Characteristic values for dominant pre-kernels
| using the von Neumann dual fixoint equation
computeGoodChoices(self, Comments=False)
Computes characteristic values for potentially good choices.
 
..note::
 
     Return a tuple with following content:
 
     [(0)-determ,(1)degirred,(2)degi,(3)degd,(4)dega,(5)str(choice),(6)domvec,(7)cover]
computeGoodPirlotChoices(self, Comments=False)
Characteristic values for potentially good choices
using the Pirlot fixpoint algorithm.
computeIncomparabilityDegree(self, InPercents=False, Comments=False)
Renders the incomparability degree (Decimal), i.e. the relative number of symmetric indeterminate relations of the irreflexive part of a digraph.
computeKemenyIndex(self, otherRelation)
renders the Kemeny index of the self.relation
compared with a given crisp valued relation of a compatible
other digraph (same nodes or actions).
computeKemenyOrder(self, orderLimit=7, Debug=False)
Renders a ordering from worst to best of the actions with maximal Kemeny index.
Return a tuple: kemenyOrder (from worst to best), kemenyIndex
computeKemenyRanking(self, orderLimit=7, seed=None, sampleSize=1000, Debug=False)
Renders a ranking from best to worst of the actions with maximal Kemeny index.
 
.. note::
 
     Returns a tuple: kemenyRanking (from best to worst), kemenyIndex.
computeKernelVector(self, kernel, Initial=True, Comments=False)
| Computing Characteristic values for dominant pre-kernels
| using the von Neumann dual fixpoint equation
computeKohlerOrder(self)
Renders an ordering (worst to best) of the actions following Kohler's rule.
computeKohlerRanking(self)
Renders a ranking (best to worst) of the actions following Kohler's rule.
computeMaxHoleSize(self, Comments=False)
Renders the length of the largest chordless cycle
in the corresponding disjunctive undirected graph.
computeMeanInDegree(self)
Renders the mean indegree of self.
!!! self.size must be set previously !!!
computeMeanOutDegree(self)
Renders the mean degree of self.
!!! self.size must be set previously !!!
computeMeanSymDegree(self)
Renders the mean degree of self.
!!! self.size must be set previously !!!
computeMedianOutDegree(self)
Renders the median outdegree of self.
!!! self.size must be set previously !!!
computeMedianSymDegree(self)
Renders the median symmetric degree of self.
!!! self.size must be set previously !!!
computeMoreOrLessUnrelatedPairs(self)
Renders a list of more or less unrelated pairs.
computeNetFlowsOrder(self)
Renders an ordered list (from best to worst) of the actions
following the net flows ranking rule.
computeNetFlowsOrderDict(self)
Renders an ordered list (from worst to best) of the actions
following the net flows ranking rule.
computeNetFlowsRanking(self)
Renders an ordered list (from best to worst) of the actions
following the net flows ranking rule.
computeNetFlowsRankingDict(self)
Renders an ordered list (from best to worst) of the actions
following the net flows ranking rule.
computeODistance(self, op2, comments=False)
renders the squared normalized distance of
two digraph valuations.
 
.. note::
 
     op2 = digraphs of same order as self.
computeOrbit(self, choice, withListing=False)
renders the set of isomorph copies of a choice following
the automorphism of the digraph self
computeOrderCorrelation(self, order, Debug=False)
Renders the ordinal correlation K of a digraph instance
when compared with a given linear order (from worst to best) of its actions
 
K = sum_{x != y} [ min( max(-self.relation(x,y)),other.relation(x,y), max(self.relation(x,y),-other.relation(x,y)) ]
 
K /= sum_{x!=y} [ min(abs(self.relation(x,y),abs(other.relation(x,y)) ]
 
.. note::
 
     Renders a dictionary with the key 'correlation' containing the actual bipolar correlation index and the key 'determination' containing the minimal determination level D of self and the other relation.
 
     D = sum_{x != y} min(abs(self.relation(x,y)),abs(other.relation(x,y)) / n(n-1)
 
     where n is the number of actions considered.
 
     The correlation index with a completely indeterminate relation
     is by convention 0.0 at determination level 0.0 .
 
.. warning::
 
     self must be a normalized outranking digraph instance !
computeOrdinalCorrelation(self, other, MedianCut=False, filterRelation=None, Debug=False)
Renders the bipolar correlation K of a
self.relation when compared
with a given compatible (same actions set)) digraph or
a [-1,1] valued compatible relation (same actions set).
 
If MedianCut=True, the correlation is computed on the median polarized relations.
 
If filterRelation is not None, the correlation is computed on the partial domain corresponding to the determined part of the filter relation.
 
.. warning::
 
     Notice that the 'other' relation and/or the 'filterRelation',
     the case given, must both be normalized, ie [-1,1]-valued !
 
K = sum_{x != y} [ min( max(-self.relation[x][y]),other.relation[x][y]), max(self.relation[x][y],-other.relation[x][y]) ]
 
K /= sum_{x!=y} [ min(abs(self.relation[x][y]),abs(other.relation[x][y])) ]
 
.. note::
 
     Renders a tuple with at position 0 the actual bipolar correlation index
     and in position 1 the minimal determination level D of self and
     the other relation.
 
     D = sum_{x != y} min(abs(self.relation[x][y]),abs(other.relation[x][y])) / n(n-1)
 
     where n is the number of actions considered.
 
     The correlation index with a completely indeterminate relation
     is by convention 0.0 at determination level 0.0 .
computeOrdinalCorrelationMP(self, other, MedianCut=False, Threading=False, nbrOfCPUs=None, startMethod=None, Comments=False, Debug=False)
Multi processing version of the digraphs.computeOrdinalCorrelation() method.
 
.. note::
     The relation filtering and the MedinaCut option are not implemented in the MP version.
computePairwiseClusterComparison(self, K1, K2, Debug=False)
Computes the pairwise cluster comparison credibility vector
from bipolar-valued digraph g. with K1 and K2 disjoint
lists of action keys from g actions disctionary.
Returns the dictionary
{'I': Decimal(),'P+':Decimal(),'P-':Decimal(),'R' :Decimal()}
where one and only one item is strictly positive.
computePreKernels(self)
computing dominant and absorbent preKernels:
    Result in self.dompreKernels and self.abspreKernels
computePreRankingRelation(self, preRanking, Normalized=True, Debug=False)
Renders the bipolar-valued relation obtained from
a given preRanking in decreasing levels (list of lists) result.
computePreorderRelation(self, preorder, Normalized=True, Debug=False)
Renders the bipolar-valued relation obtained from
a given preordering in increasing levels (list of lists) result.
computePrincipalOrder(self, Colwise=False, Comments=False)
Rendesr an ordering from wrost to best of the decision actions.
computePrincipalRanking(self, Colwise=False, Comments=False)
Rendesr a ranking from best to worst of the decision actions.
computePrincipalScores(self, plotFileName=None, Colwise=False, imageType=None, tempDir=None, bgcolor='cornsilk', Comments=False, Debug=False)
Renders a ordered list of the first principal eigenvector of the covariance of the valued outdegrees of self.
 
.. note::
 
   The method, relying on writing and reading temporary files by default in a temporary directory is threading and multiprocessing safe !
   (see Digraph.exportPrincipalImage method)
computePrudentBetaLevel(self, Debug=False)
computes alpha, ie the lowest valuation level, for which the
bipolarly polarised digraph doesn't contain a chordless circuit.
computeRankingByBestChoosing(self, CoDual=False, Debug=False)
Computes a weak preordering of the self.actions by recursive
best choice elagations.
 
Stores in self.rankingByBestChoosing['result'] a list of (P+,bestChoice) tuples
where P+ gives the best choice complement outranking
average valuation via the computePairwiseClusterComparison
method.
 
If self.rankingByBestChoosing['CoDual'] is True, 
the ranking-by-choosing was computed on the codual of self.
computeRankingByBestChoosingRelation(self, rankingByBestChoosing=None, Debug=False)
Renders the bipolar-valued relation obtained from
the self.rankingByBestChoosing result.
computeRankingByChoosing(self, actionsSubset=None, Debug=False, CoDual=False)
Computes a weak preordring of the self.actions by iterating
jointly first and last choice elagations.
 
Stores in self.rankingByChoosing['result'] a list of ((P+,bestChoice),(P-,worstChoice)) pairs
where P+ (resp. P-) gives the best (resp. worst) choice complement outranking
(resp. outranked) average valuation via the computePairwiseClusterComparison
method.
 
If self.rankingByChoosing['CoDual'] is True, the ranking-by-choosing was computed on the codual of self.
computeRankingByChoosingRelation(self, rankingByChoosing=None, actionsSubset=None, Debug=False)
Renders the bipolar-valued relation obtained from
the self.rankingByChoosing result.
computeRankingByLastChoosing(self, CoDual=False, Debug=False)
Computes a weak preordring of the self.actions by iterating
worst choice elagations.
 
Stores in self.rankingByLastChoosing['result'] a list of (P-,worstChoice) pairs
where P- gives the worst choice complement outranked
average valuation via the computePairwiseClusterComparison
method.
 
If self.rankingByChoosing['CoDual'] is True, the ranking-by-last-chossing 
was computed on the codual of self.
computeRankingByLastChoosingRelation(self, rankingByLastChoosing=None, Debug=False)
Renders the bipolar-valued relation obtained from
the self.rankingByLastChoosing result.
computeRankingCorrelation(self, ranking, Debug=False)
Renders the ordinal correlation K of a digraph instance
when compared with a given linear ranking of its actions
 
K = sum_{x != y} [ min( max(-self.relation(x,y)),other.relation(x,y), max(self.relation(x,y),-other.relation(x,y)) ]
 
K /= sum_{x!=y} [ min(abs(self.relation(x,y),abs(other.relation(x,y)) ]
 
.. note::
 
     Renders a tuple with at position 0 the actual bipolar correlation index
     and in position 1 the minimal determination level D of self and
     the other relation.
 
     D = sum_{x != y} min(abs(self.relation(x,y)),abs(other.relation(x,y)) / n(n-1)
 
     where n is the number of actions considered.
 
     The correlation index with a completely indeterminate relation
     is by convention 0.0 at determination level 0.0 .
computeRelationalStructure(self, Debug=False)
Renders the counted decomposition of the valued relations into
the following type of links:
gt '>', eq '=', lt '<', incomp '<>',
leq '<=', geq '>=', indeterm '?'
computeRubisChoice(self, Comments=False, _OldCoca=False, BrokenCocs=True, Threading=False, nbrOfCPUs=1)
Renders self.strictGoodChoices, self.nullChoices
self.strictBadChoices, self.nonRobustChoices.
 
.. warning::
    Changes in site the outranking digraph by
    adding or braking chordless odd outranking circuits.
computeRubyChoice(self, Comments=False, _OldCoca=False)
dummy for computeRubisChoice()
old versions compatibility.
computeShortestPathLengths(self, WeakPaths=False, Comments=False, Debug=False)
Renders a double dictionary with the directed distances, i.e. the shortest path lengths between all self.actions
 
Equals *None* if there does not exist a directed path between two actions.
 
*Source*: Claude Berge, *The Theory of Graphs*, Dover (2001) pp. 119, original in French Dunod (1958)
computeSingletonRanking(self, Comments=False, Debug=False)
Renders the sorted bipolar net determinatation of outrankingness
minus outrankedness credibilities of all singleton choices.
 
res = ((netdet,singleton,dom,absorb)+)
computeSize(self)
Renders the number of validated non reflexive arcs
computeSizeTransitiveClosure(self)
Renders the size of the transitive closure of a digraph.
computeSlaterOrder(self, isProbabilistic=False, seed=None, sampleSize=1000, Debug=False)
Reversed return from computeSlaterRanking method.
computeSlaterRanking(self, isProbabilistic=False, seed=None, sampleSize=1000, Debug=False)
Renders a ranking of the actions with minimal Slater index.
Return a tuple: slaterOrder, slaterIndex
computeSymmetryDegree(self, InPercents=False, Comments=False)
Renders the symmetry degree (Decimal) of the irreflexive part of a digraph.
 
.. note::
 
   Empty and indeterminate digraphs are considered to be symmetric.
computeTopologicalRanking(self, Debug=False)
Mimetic Wrapper of the topologicalSort() method.
computeTransitivityDegree(self, InPercents=False, Comments=False)
Renders the transitivity degree (Decimal) of a digraph.
 
.. note:: 
 
   An empty or indeterminate digraph is considered to be transitive.
computeUnrelatedPairs(self)
Renders a list of more or less unrelated pairs.
computeValuationLevels(self, choice=None, Debug=False)
renders the symmetric closure of the
apparent valuations levels of self
in an increasingly ordered list.
If parameter choice is given, the
computation is limited to the actions
of the choice.
computeValuationPercentages(self, choice, percentiles, withValues=False)
Parameters: choice and list of percentiles.
renders a series of percentages of the characteristics valuation of
the arcs in the digraph.
computeValuationPercentiles(self, choice, percentages, withValues=False)
Parameters: choice and list of percentages.
renders a series of quantiles of the characteristics valuation of
the arcs in the digraph.
computeValuationStatistics(self, Sampling=False, Comments=False)
Renders the mean and variance of the valuation
of the non reflexive pairs.
computeValuedRankingRelation(self, ranking)
Renders the valued relation characteristics compatible 
with the given linar ranking. Discordant charcateristics 
are set to the indeterminate value.
computeWeakCondorcetLosers(self)
Wrapper for weakCondorcetLosers().
computeWeakCondorcetWinners(self)
Wrapper for weakCondorcetWinners().
computeupdown1(self, s, S)
Help method for show_MIS_HB2 method.
fills self.newmisset, self.upmis, self.downmis.
computeupdown2(self, s, S)
Help method for show_MIS_HB1 method.
Fills self.newmisset, self.upmis, self.downmis.
computeupdown2irred(self, s, S)
Help method for show_MIS_HB1 method.
Fills self.newmisset, self.upmis, self.downmis.
condorcetLosers(self)
Renders the set of decision actions x such that
self.relation[x][y] < self.valuationdomain['med']
for all y != x.
condorcetWinners(self)
Renders the set of decision actions x such that
self.relation[x][y] > self.valuationdomain['med']
for all y != x.
contra(self, v)
Parameter: choice.
Renders the negation of a choice v characteristic's vector.
convertRelationToDecimal(self)
Converts the float valued self.relation in a decimal valued one.
convertValuation2Integer(self, InSite=True, Comments=False)
Converts the self.relation valuation to integer values by converting the Decimals to Fractions and multiply by the least commun multiple of the fraction denominators.
 
*Parameters*:
 
    - If *Insite* == False (True by default) the method returns a modified copy of self.relation without altering the original self.relation, otherwise self.relation and self.valuationdomain is modified.
convertValuationToDecimal(self)
Convert the float valuation limits to Decimals.
coveringIndex(self, choice, direction='out')
Renders the covering index of a given choice in a set of objects,
ie the minimum number of choice members that cover each
non selected object.
crispKDistance(self, digraph, Debug=False)
Renders the crisp Kendall distance between two bipolar valued
digraphs.
 
.. warning::
 
     Obsolete! Is replaced by the self.computeBipolarCorrelation(other, MedianCut=True) Digraph method
detectChordlessCircuits(self, Comments=False, Debug=False)
Detects a chordless circuit in a digraph.
Returns a Boolean
detectChordlessPath(self, Pk, n2, Comments=False, Debug=False)
New procedure from Agrum study April 2009
recursive chordless path extraction starting from path
Pk = [n2, ...., n1] and ending in node n2.
Optimized with marking of visited chordless P1s.
determinateness(self, vec, inPercent=True)
Renders the determinateness of a characteristic vector *vec* = 
[(r(x),x),(r(y),y), ...] of length *n* in valuationdomain [Min,Med,Max]:
 
*result* =  sum_x( abs(r(x)-Med) ) / ( n*(Max-Med) )
 
If inPercent, *result* shifted (+1) and reduced (/2) to [0,1] range.
digraph2Graph(self, valuationDomain={'min': -1, 'med': 0, 'max': 1}, Debug=False, ConjunctiveConversion=True)
Convert a Digraph instance to a Graph instance.
dneighbors(self, node)
Renders the set of dominated out-neighbors of a node.
domin(self, choice)
Renders the dominance degree of a choice.
dominantChoices(self, S)
Generates all minimal dominant choices of a bipolar valued digraph.
 
.. note::
 
     Initiate with S = self.actions.copy().
domirred(self, choice)
Renders the crips +irredundance degree of a choice.
domirredval(self, choice, relation)
Renders the valued +irredundance degree of a choice.
domirredx(self, choice, x)
Renders the crips +irredundance degree of node x in a choice.
domkernelrestrict(self, prekernel)
Parameter: dominant prekernel
Renders dominant prekernel restricted relation.
exportGraphViz(self, fileName=None, actionsSubset=None, bestChoice=set(), worstChoice=set(), firstChoice=set(), lastChoice=set(), Comments=True, graphType='png', pictureFormat=None, graphSize='7,7', relation=None, bgcolor='cornsilk')
export GraphViz dot file  for graph drawing filtering.
exportPrincipalImage(self, plotFileName=None, pictureFormat='pdf', bgcolor='cornsilk', fontcolor='red3', fontsize='0.75', Reduced=False, Colwise=False, tempDir='.', Comments=False)
Export as PDF (default) the principal projection of
the valued relation using the three principal eigen vectors.
 
Implemeted picture formats are: 
'pdf' (default), 'png', 'jpeg' and 'xfig'.
 
The background color is set by default to 'cornsilk'. 
 
Font size and color are set by default to 'red3', resp. '0.75'. 
 
When *Reduced==True*, the valued relation characeteristics are centered and reduced.
 
When *Colwise==True*, the column vectors of the adjacency table are used for the principal projection, otherwise the rows (default) are used. Has no incidence when the *Digraph* instance *self*  is symmetric. 
 
.. warning::
 
    The method, writing and reading temporary files: 
    tempCol.r and rotationCol.csv, resp. tempRow.r and rotationRow.csv,
    by default in the working directory (./),
    is hence not safe for multiprocessing programs, unless a
    temporary directory *tempDir* is provided.
flatChoice(self, ch, Debug=False)
Converts set or list ch recursively to a flat list of items.
forcedBestSingleChoice(self)
Renders the set of most determined outranking singletons in self.
gammaSets(self)
Renders the dictionary of neighborhoods {node: (dx,ax)}
with set *dx* gathering the dominated, and set *ax* gathering
the absorbed neighborhood.
generateAbsPreKernels(self)
Generate all absorbent prekernels from independent choices generator.
generateDomPreKernels(self)
Generate all dominant prekernels from independent choices generator.
htmlChoiceVector(self, ch, ChoiceVector=True, choiceType='good')
Show procedure for annotated bipolar choices.
inDegrees(self)
renders the median cut indegrees
inDegreesDistribution(self)
Renders the distribution of indegrees.
independentChoices(self, U)
Generator for all independent choices with neighborhoods of a bipolar valued digraph:
 
.. note::
 
       * Initiate with U = self.singletons().
       * Yields [(independent choice, domnb, absnb, indnb)].
inner_prod(self, v1, v2)
Parameters: two choice characteristic vectors
Renders the inner product of two characteristic vetors.
intstab(self, choice)
Computes the independence degree of a choice.
irreflex(self, mat)
Puts diagonal entries of mat to valuationdomain['min']
isAsymmetricIndeterminate(self, Debug=False)
Checks the self.relation for assymmetric indeterminateness!!
 
.. warning::
 
    The reflexive links are ignored !!
isComplete(self, Debug=False)
checks the completeness property of self.relation by checking
for the absence of a link between two actions!!
 
.. warning::
 
    The reflexive links are ignored !!
isCyclic(self, Debug=False)
checks the cyclicity of self.relation by checking
for a reflexive loop in its transitive closure-
 
.. warning::
 
     self.relation is supposed to be irreflexive !
isIntegerValued(self, Debug=False)
Checks whether the decimal valuation of self is integer-valued
be using the as_integer_ratio() method of a Decimal 
giving a tuple (numerator,denominator). If denominator == 1, the
number is an integer.
isOutrankingDigraph(self, Comments=True, Debug=False)
Checks the outranking digraph characteristic condition (3.3).
 
relation[x][y] + relation[y][x)[y] >= 0.0
 
.. warning::
 
    The reflexive links are ignored and the valuation must be bipolar !!
isStrictOutrankingDigraph(self, Comments=True, Debug=False)
Checks the strict outranking digraph characteristic condition (3.1).
 
-(relation[x][y] + relation[y][x]) <= 0.0 , x != y
 
.. warning::
 
    The reflexive links are ignored and the valuation must be bipolar !!
isSymmetric(self, Comments=False)
True if symmetry degree == 1.0.
isTransitive(self, Comments=False)
True if transitivity degree == 1.0.
isWeaklyComplete(self, Debug=False)
checks the weakly completeness property of self.relation by checking
for the absence of a link between two actions!!
 
.. warning::
 
    The reflexive links are ignored !!
iterateRankingByChoosing(self, Odd=False, CoDual=False, Comments=True, Debug=False, Limited=None)
Renders a ranking by choosing result when progressively eliminating
all chordless (odd only) circuits with rising valuation cut levels.
 
Parameters
    CoDual = False (default)/True
    Limited = proportion (in [0,1]) * (max - med) valuationdomain
kChoices(self, A, k)
Renders all choices of length k from set A
matmult2(self, m, v)
Parameters: digraph relation and choice characteristic vector
matrix multiply vector by inner production
meanDegree(self)
Renders the mean degree of self.
!!! self.size must be set previously !!!
meanLength(self, Oriented=False)
Renders the (by default non-oriented) mean neighbourhoor depth of self.
!!! self.order must be set previously !!!
minimalChoices(self, S)
Generates all dominant or absorbent choices of a bipolar
valued digraph.
 
.. note:
 
   * Initiate with S = (actions, dict of dominant or absorbent closed neighborhoods)
   * See showMinDom and showMinAbs methods.
minimalValuationLevelForCircuitsElimination(self, Odd=True, Debug=False, Comments=False)
renders the minimal valuation level <lambda> that eliminates all
self.circuitsList stored odd chordless circuits from self.
 
.. warning::
 
    The <lambda> level polarised may still contain newly appearing chordless odd circuits !
neighbourhoodCollection(self, Oriented=False, Potential=False)
Renders the neighbourhood.
neighbourhoodDepthDistribution(self, Oriented=False)
Renders the distribtion of neighbourhood depths.
notGammaSets(self)
Renders the dictionary of neighborhoods {node: (dx,ax)}
with set *dx* gathering the not dominated, and set *ax* gathering
the not absorbed neighborhood.
notaneighbors(self, node)
Renders the set of absorbed not in-neighbors of a node.
notdneighbors(self, node)
Renders the set of not dominated out-neighbors of a node.
outDegrees(self)
renders the median cut outdegrees
outDegreesDistribution(self)
Renders the distribution of outdegrees.
plusirredundant(self, U)
Generates all +irredundant choices of a digraph.
powerset(self, U)
Generates all subsets of a set.
readPerrinMisset(self, file='curd.dat')
read method for 0-1-char-coded MISs by default from the perrinMIS.c curd.dat result file.
readabsvector(self, x, relation)
Parameter: action x
absorbent in vector.
readdomvector(self, x, relation)
Parameter: action x
dominant out vector.
recodeValuation(self, newMin=-1.0, newMax=1.0, ndigits=4, Debug=False)
Recodes the characteristic valuation domain according
to the parameters given. 
 
*ndigits* indicates the number of decimal digits of the valuation.
relationFct(self, x, y)
wrapper for self.relation dictionary access to ensure interoperability
with the sparse and big outranking digraph implementation model.
save(self, fileName='tempdigraph', option=None, DecimalValuation=True, decDigits=2)
Persistent storage of a Digraph class instance in the form of
a python source code file
saveCSV(self, fileName='tempdigraph', Normalized=False, Dual=False, Converse=False, Diagonal=False, Debug=False)
Persistent storage of a Digraph class instance in the form of
a csv file.
saveXMCDA2(self, fileName='temp', fileExt='xmcda2', Comments=True, relationName='R', relationType='binary', category='random', subcategory='valued', author='digraphs Module (RB)', reference='saved from Python', valuationType='standard', digits=2, servingD3=False)
save digraph in XMCDA 2.0 format. Deprecated now.
savedre(self, fileName='temp')
save digraph in nauty format.
sharp(self, x, y)
Paramaters: choice characteristic values.
Renders the sharpest of two characteristic values x and y.
sharpvec(self, v, w)
Paramaters: choice characteristic vectors.
Renders the sharpest of two characteristic vectors v and w.
showActions(self)
presentation methods for digraphs actions
showAll(self)
Detailed show method for genuine digraphs.
showAttributes(self)
Prints out the attributes of self.
showAutomorphismGenerators(self)
Renders the generators of the automorphism group.
showBadChoices(self, Recompute=True)
Characteristic values for potentially bad choices.
showBestChoiceRecommendation(self, Verbose=False, Comments=True, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True)
Shows the RuBis best choice recommendation.
 
.. note::
 
    Computes by default the Rubis best choice recommendation on the corresponding strict (codual) outranking digraph.
 
    By default, with BrokenCocs=True, we brake all chordless circuits at their weakest determined ( abs(r(x>y)) + abs(r(y>x)) ) link.
 
    When BrokenCocs=False we proceed like follows:
 
    In case of chordless circuits, if supporting arcs are more credible
    than the reversed negating arcs, we collapse the circuits into hyper nodes.
    Inversely,  if supporting arcs are not more credible than the reversed negating arcs,
    we brake the circuits on their weakest arc.
 
Usage example:
 
>>> from outrankingDigraphs import *
>>> t = Random3ObjectivesPerformanceTableau(seed=5)
>>> g = BipolarOutrankingDigraph(t)
>>> g.showBestChoiceRecommendation()
***********************
RuBis Best Choice Recommendation (BCR)
(in decreasing order of determinateness)   
Credibility domain:  [-100.0, 100.0]
=== >> potential first choices
* choice              : ['a04', 'a14', 'a19', 'a20']
   independence        : 1.19
   dominance           : 4.76
   absorbency          : -59.52
   covering (%)        : 75.00
   determinateness (%) : 57.86
   - most credible action(s) = { 'a14': 23.81, 'a19': 11.90, 'a04': 2.38, 'a20': 1.19, }  
=== >> potential last choices 
* choice              : ['a03', 'a12', 'a17']
  independence        : 4.76
  dominance           : -76.19
  absorbency          : 4.76
  covering (%)        : 0.00
  determinateness (%) : 65.39
  - most credible action(s) = { 'a03': 38.10, 'a12': 13.10, 'a17': 4.76, }
Execution time: 0.024 seconds
*****************************
showChoiceVector(self, ch, choiceType='good', ChoiceVector=True)
Show procedure for annotated bipolar choices.
showChordlessCircuits(self, Recompute=False)
Show method for chordless circuits observed in a Digraph instance.
 
If previous computation is required, stores the detected circuits in self.circuitsList attribute.
showComponents(self)
Shows the list of connected components of the digraph instance.
showCorrelation(self, corr=None, ndigits=3)
Renders the valued ordinal correlation index, the crisp Kendall tau index and their epistemic determination degree.
showFirstChoiceRecommendation(self, Verbose=False, Comments=True, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True)
Shows the RuBis first choice recommendation.
 
.. note::
 
    Computes by default the Rubis first choice recommendation on the corresponding strict (codual) outranking digraph.
 
    By default, with BrokenCocs=True, we brake all chordless circuits at their weakest determined ( abs(r(x>y)) + abs(r(y>x)) ) link.
 
    When BrokenCocs=False we proceed like follows:
 
    In case of chordless circuits, if supporting arcs are more credible
    than the reversed negating arcs, we collapse the circuits into hyper nodes.
    Inversely,  if supporting arcs are not more credible than the reversed negating arcs,
    we brake the circuits on their weakest arc.
 
Usage example:
 
>>> from outrankingDigraphs import *
>>> t = Random3ObjectivesPerformanceTableau(seed=5)
>>> g = BipolarOutrankingDigraph(t)
>>> g.showFirstChoiceRecommendation()
***********************
RuBis First Choice Recommendation (BCR)
(in decreasing order of determinateness)   
Credibility domain:  [-100.0, 100.0]
=== >> potential first choices
* choice              : ['a04', 'a14', 'a19', 'a20']
   independence        : 1.19
   dominance           : 4.76
   absorbency          : -59.52
   covering (%)        : 75.00
   determinateness (%) : 57.86
   - most credible action(s) = { 'a14': 23.81, 'a19': 11.90, 'a04': 2.38, 'a20': 1.19, }  
=== >> potential last choices 
* choice              : ['a03', 'a12', 'a17']
  independence        : 4.76
  dominance           : -76.19
  absorbency          : 4.76
  covering (%)        : 0.00
  determinateness (%) : 65.39
  - most credible action(s) = { 'a03': 38.10, 'a12': 13.10, 'a17': 4.76, }
Execution time: 0.024 seconds
*****************************
showGoodChoices(self, Recompute=True)
Characteristic values for potentially good choices.
showHTMLBestChoiceRecommendation(self, pageTitle=None, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True, htmlFileName=None)
showHTMLRelationHeatmap(self, actionsList=None, rankingRule='NetFlows', colorLevels=7, tableTitle='Relation Heatmap', relationName='r(x S y)', ndigits=2, fromIndex=None, toIndex=None, htmlFileName=None)
Launches a browser window with the colored relation map of self.
 
See corresponding :py:class:`~digraphs.Digraph.showHTMLRelationMap` method.
 
The *colorLevels* parameter may be set to 3, 5, 7 (default) or 9.
 
When the *actionsList* parameter is *None* (default), the digraphs actions list may be ranked with the *rankingRule* parameter set to the 'Copeland' (default) or to the 'Netlows' ranking rule.
 
When the *htmlFileName* parameter is set to a string value 'xxx', a html file named 'xxx.html' will be generated in the current working directory. Otherwise, a temporary file named 'tmp*.html' will be generated there.
 
Example::
 
    >>> from outrankingDigraphs import *
    >>> t = RandomCBPerformanceTableau(numberOfActions=25,seed=1)
    >>> g = BipolarOutrankingDigraph(t,ndigits=2)
    >>> gcd = ~(-g)  # strict outranking relation
    >>> gcd.showHTMLRelationHeatmap(colorLevels=7,ndigits=2)
    
.. image:: relationHeatmap.png
   :alt: Browser view of a relation map
   :width: 600 px
   :align: center
showHTMLRelationMap(self, actionsList=None, rankingRule='Copeland', Colored=True, tableTitle='Relation Map', relationName='r(x S y)', symbols=['+', '&middot;', '&nbsp;', '&#150;', '&#151'], fromIndex=None, toIndex=None, htmlFileName=None)
Launches a browser window with the colored relation map of self.
See corresponding Digraph.showRelationMap() method.
 
When *htmlFileName* parameter is set to a string value, a html file
with that name will be stored in the current working directory.
 
By default, a temporary file named: tmp*.html will be generated
instead in the current working directory.
 
Example::
 
    >>> from outrankingDigraphs import *
    >>> t = RandomCBPerformanceTableau(numberOfActions=25,seed=1)
    >>> g = BipolarOutrankingDigraph(t,Normalized=True)
    >>> gcd = ~(-g)  # strict outranking relation
    >>> gcd.showHTMLRelationMap(rankingRule="NetFlows")
    
.. image:: relationMap.png
   :alt: Browser view of a relation map
   :width: 600 px
   :align: center
showHTMLRelationTable(self, actionsList=None, relation=None, IntegerValues=False, ndigits=2, Colored=True, tableTitle='Valued Adjacency Matrix', relationName='r(x S y)', ReflexiveTerms=False, htmlFileName=None, fromIndex=None, toIndex=None)
Launches a browser window with the colored relation table of self.
showMIS(self, withListing=True)
Prints all maximal independent choices:
    Result in self.misset.
showMIS_AH(self, withListing=True)
Prints all MIS using the Hertz method.
 
Result saved in self.hertzmisset.
showMIS_HB2(self, withListing=True)
Prints all MIS using the Hertz-Bisdorff method.
 
Result saved in self.newmisset.
showMIS_RB(self, withListing=True)
Prints all MIS using the Bisdorff method.
 
Result saved in self.newmisset.
showMIS_UD(self, withListing=True)
Prints all MIS using the Hertz-Bisdorff method.
 
Result saved in self.newmisset.
showMaxAbsIrred(self, withListing=True)
Computing maximal -irredundant choices:
    Result in self.absirset.
showMaxDomIrred(self, withListing=True)
Computing maximal +irredundant choices:
   Result in self.domirset.
showMinAbs(self, withListing=True)
Prints minimal absorbent choices:
    Result in self.absset.
showMinDom(self, withListing=True)
Prints all minimal dominant choices:
    Result in self.domset.
showNeighborhoods(self)
Lists the gamma and the notGamma function of self.
showOrbits(self, InChoices, withListing=True)
Prints the orbits of Choices along the automorphisms of
the Digraph instance.
 
Example Python session for computing the non isomorphic MISs from the 12-cycle graph:
 
>>> from digraphs import *
>>> c12 = CirculantDigraph(order=12,circulants=[1,-1])
>>> c12.automorphismGenerators()
...
  Permutations
  {'1': '1', '2': '12', '3': '11', '4': '10', '5': 
   '9', '6': '8', '7': '7', '8': '6', '9': '5', '10': 
   '4', '11': '3', '12': '2'}
  {'1': '2', '2': '1', '3': '12', '4': '11', '5': '10', 
   '6': '9', '7': '8', '8': '7', '9': '6', '10': '5', 
   '11': '4', '12': '3'}
  Reflections {}
>>> print('grpsize = ', c12.automorphismGroupSize)
  grpsize = 24
>>> c12.showMIS(withListing=False)
  *---  Maximal independent choices ---*
  number of solutions:  29
  cardinality distribution
  card.:  [0, 1, 2, 3, 4,  5,  6, 7, 8, 9, 10, 11, 12]
  freq.:  [0, 0, 0, 0, 3, 24,  2, 0, 0, 0,  0,  0,  0]
  Results in c12.misset
>>> c12.showOrbits(c12.misset,withListing=False)
...
  *---- Global result ----
  Number of MIS:  29
  Number of orbits :  4
  Labelled representatives:
  1: ['2','4','6','8','10','12']
  2: ['2','5','8','11']
  3: ['2','4','6','9','11']
  4: ['1','4','7','9','11']
  Symmetry vector
  stabilizer size: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, ...]
  frequency      : [0, 2, 0, 0, 0, 0, 0, 1, 0,  0,  0,  1, ...]
 
*Figure*: The symmetry axes of the non isomorphic MISs of the 12-cycle:
 
.. image:: c12.png
   :width: 400 px
   :align: center
   :alt: The 4 non isomorphic MIS of the 12-cycle graph
 
*Reference*: R. Bisdorff and J.L. Marichal (2008). Counting non-isomorphic maximal independent sets of the n-cycle graph. *Journal of Integer Sequences*, Vol. 11 Article 08.5.7 (`openly accessible here <https://www.cs.uwaterloo.ca/journals/JIS/VOL11/Marichal/marichal.html>`_)
showOrbitsFromFile(self, InFile, withListing=True)
Prints the orbits of Choices along the automorphisms of
the digraph self by reading in the 0-1 misset file format.
See the :py:func:`digraphs.Digraph.readPerrinMisset` method.
showPreKernels(self, withListing=True)
Printing dominant and absorbent preKernels:
    Result in self.dompreKernels and self.abspreKernels
showRankingByBestChoosing(self, rankingByBestChoosing=None)
A show method for self.rankinByBestChoosing result.
 
.. warning::
 
     The self.computeRankingByBestChoosing(CoDual=False/True) method instantiating the self.rankingByBestChoosing slot is pre-required !
showRankingByChoosing(self, rankingByChoosing=None, WithCoverCredibility=False)
A show method for self.rankinByChoosing result.
 
When parameter *WithCoverCredibility* is set to True, the credibility of outranking, respectively being outranked is indicated at each selection step. 
 
.. warning::
 
     The self.computeRankingByChoosing(CoDual=False/True) method instantiating the self.rankingByChoosing slot is pre-required !
showRankingByLastChoosing(self, rankingByLastChoosing=None, Debug=None)
A show method for self.rankinByChoosing result.
 
.. warning::
 
     The self.computeRankingByLastChoosing(CoDual=False/True) method instantiating the self.rankingByChoosing slot is pre-required !
showRelation(self)
prints the relation valuation in ##.## format.
showRelationMap(self, symbols=None, rankingRule='Copeland', fromIndex=None, toIndex=None, actionsList=None)
Prints on the console, in text map format, the location of
certainly validated and certainly invalidated outranking situations.
 
By default, symbols = {'max':'┬','positive': '+', 'median': ' ',
                       'negative': '-', 'min': '┴'}
 
The default ordering of the output is following the Copeland ranking rule
from best to worst actions. Further available ranking rule is the 'NetFlows' net flows rule.
 
 
Example::
 
    >>> from outrankingDigraphs import *
    >>> t = RandomCBPerformanceTableau(numberOfActions=25,seed=1)
    >>> g = BipolarOutrankingDigraph(t,Normalized=True)
    >>> gcd = ~(-g)  # strict outranking relation
    >>> gcd.showRelationMap(rankingRule="NetFlows")
     -   ++++++++  +++++┬+┬┬+
    - -   + +++++ ++┬+┬+++┬++
    ┴+  ┴ + ++  ++++┬+┬┬++┬++
    -   ++ - ++++-++++++┬++┬+
       - - - ++- ┬- + -+┬+-┬┬
    -----  -      -┬┬┬-+  -┬┬
    ----    --+-+++++++++++++
    -- --+- --++ ++ +++-┬+-┬┬
    ----  -  -+-- ++--+++++ +
    ----- ++- --- +---++++┬ +
    -- -- ---+ -++-+++-+ +-++
    -- --┴---+  + +-++-+ -  +
    ---- ┴---+-- ++--++++ - +
      --┴┴--  --- -  --+ --┬┬
     ---------+--+ ----- +-┬┬
    -┴---┴- ---+- + ---+++┬ +
    -┴┴--┴---+--- ++ -++--+++
    -----┴--- ---+-+- ++---+ 
    -┴┴--------------- --++┬ 
    --┴---------------- --+┬ 
    ┴--┴┴ -┴--┴┴-┴ --++  ++-+
    ----┴┴--------------- -  
    ┴┴┴----+-┴+┴---┴-+---+ ┴+
    ┴┴-┴┴┴-┴- - -┴┴---┴┴+ ┬ -
    ----┴┴-┴-----┴┴---  - -- 
    Ranking rule: NetFlows
    >>>
showRelationTable(self, Sorted=True, rankingRule=None, IntegerValues=False, actionsSubset=None, relation=None, ndigits=2, ReflexiveTerms=True, fromIndex=None, toIndex=None)
Prints the relation valuation in actions X actions table format.
Copeland and NetFlows rankings my be used.
showRubisBestChoiceRecommendation(self, **kwargs)
Dummy for backward portable showBestChoiceRecommendation().
showRubyChoice(self, Verbose=False, Comments=True, _OldCoca=True)
Dummy for showBestChoiceRecommendation()
needed for older versions compatibility.
showShort(self)
concise presentation method for genuine digraphs.
showSingletonRanking(self, Comments=True, Debug=False)
Calls self.computeSingletonRanking(comments=True,Debug = False).
Renders and prints the sorted bipolar net determinatation of outrankingness
minus outrankedness credibilities of all singleton choices.
 
res = ((netdet,sigleton,dom,absorb)+)
showStatistics(self)
Computes digraph statistics like order, size and arc-density.
showdre(self)
Shows relation in nauty format.
singletons(self)
list of singletons and neighborhoods
[(singx1, +nx1, -nx1, not(+nx1 or -nx1)),.... ]
sizeSubGraph(self, choice)
Output: (size, undeterm,arcDensity).
Renders the arc density of the induced subgraph.
strongComponents(self, setPotential=False)
Renders the set of strong components of self.
symDegreesDistribution(self)
Renders the distribution of symmetric degrees.
topologicalSort(self, Debug=False)
If self is acyclic, adds topological sort number to each node of self
and renders ordered list of nodes. Otherwise renders None.
Source: M. Golumbic Algorithmic Graph heory and Perfect Graphs,
Annals Of Discrete Mathematics 57 2nd Ed. , Elsevier 2004, Algorithm 2.4 p.44.
weakAneighbors(self, node)
Renders the set of absorbed in-neighbors of a node.
weakCondorcetLosers(self)
Renders the set of decision actions x such that
self.relation[x][y] <= self.valuationdomain['med']
for all y != x.
weakCondorcetWinners(self)
Renders the set of decision actions x such that
self.relation[x][y] >= self.valuationdomain['med']
for all y != x.
weakDneighbors(self, node)
Renders the set of dominated out-neighbors of a node.
weakGammaSets(self)
Renders the dictionary of neighborhoods {node: (dx,ax)}
zoomValuation(self, zoomFactor=1.0)
Zooms in or out, depending on the value of the zoomFactor provided,
the bipolar valuation of a digraph.

Data descriptors inherited from Digraph:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class CriteriaCorrelationDigraph(Digraph)
    CriteriaCorrelationDigraph(outrankingDigraph, ValuedCorrelation=True, WithMedian=False)
 
Renders the ordinal criteria correlation digraph from the given outranking digraph.
 
If ValuedCorrelation==True, the correlation indexes represent the bipolar-valued p
airwise relational equivalence between the marginal criteria outranking relation:
that is tau * determination
 
Otherwise, the valuation represents the ordinal correlation index tau
 
If WithMedian==True, the correlation of the marginal criteria outranking with
the global outranking relation, denoted 'm', is included.
 
 
Method resolution order:
CriteriaCorrelationDigraph
Digraph
builtins.object

Methods defined here:
__init__(self, outrankingDigraph, ValuedCorrelation=True, WithMedian=False)
Initialize self.  See help(type(self)) for accurate signature.
exportPrincipalImage(self, plotFileName=None, pictureFormat='pdf', bgcolor='cornsilk', fontcolor='red3', fontsize='0.85', tempDir='.', Comments=False)
Export the principal projection of
the absolute correlation distances
using the three principal eigen vectors.
 
Implemeted picture formats are: 
'pdf' (default), 'png', 'jpeg' and 'xfig'.
 
The background, resp. font color is set by default to 'cornsilk', resp. 'red3'.
 
_Colwise and _Reduced parameters are deprecated.
 
.. warning::
 
    The method, writing and reading temporary files: 
    tempCol.r and rotationCol.csv, resp. tempRow.r and rotationRow.csv,
    by default in the working directory (./),
    is hence not safe for multiprocessing programs, unless a
    temporary directory *tempDir* is provided.

Methods inherited from Digraph:
MISgen(self, S, I)
generator of maximal independent choices (voir Byskov 2004):
    * S ::= remaining nodes;
    * I ::= current independent choice
 
.. note::
 
        Inititalize: self.MISgen(self.actions.copy(),set())
__invert__(self)
Make the inverting operator ~self available for Digraph instances. 
 
Returns a ConverseDigraph instance of self.
__neg__(self)
Make the negation operator -self available for Digraph instances. 
 
Returns a DualDigraph instance of self.
__repr__(self)
Default presentation method for Digraph instances.
absirred(self, choice)
Renders the crips -irredundance degree of a choice.
absirredundant(self, U)
Generates all -irredundant choices of a digraph.
absirredval(self, choice, relation)
Renders the valued -irredundance degree of a choice.
absirredx(self, choice, x)
Computes the crips -irredundance degree of node x in a choice.
abskernelrestrict(self, prekernel)
Parameter: prekernel
Renders absorbent prekernel restricted relation.
absorb(self, choice)
Renders the absorbency degree of a choice.
absorbentChoices(self, S)
Generates all minimal absorbent choices of a bipolar valued digraph.
addValuationAttribute(self)
Adds the numpy valuation attribute
agglomerationDistribution(self)
Output: aggloCoeffDistribution, meanCoeff
Renders the distribution of agglomeration coefficients.
aneighbors(self, node)
Renders the set of absorbed in-neighbors of a node.
automorphismGenerators(self)
Adds automorphism group generators to the digraph instance.
 
.. note::
 
    Dependency: Uses the dreadnaut command from the nauty software package. See https://www3.cs.stonybrook.edu/~algorith/implement/nauty/implement.shtml
 
    On Ubuntu Linux:
      ...$ sudo apt-get install nauty
averageCoveringIndex(self, choice, direction='out')
Renders the average covering index of a given choice in a set of objects,
ie the average number of choice members that cover each
non selected object.
bipolarKCorrelation(self, digraph, Debug=False)
Renders the bipolar Kendall correlation between two bipolar valued
digraphs computed from the average valuation of the
XORDigraph(self,digraph) instance.
 
.. warning::
 
     Obsolete! Is replaced by the self.computeBipolarCorrelation(other) Digraph method
bipolarKDistance(self, digraph, Debug=False)
Renders the bipolar crisp Kendall distance between two bipolar valued
digraphs.
 
.. warning::
 
     Obsolete! Is replaced by the self.computeBipolarCorrelation(other, MedianCut=True) Digraph method
chordlessPaths(self, Pk, n2, Odd=False, Comments=False, Debug=False)
New procedure from Agrum study April 2009
recursive chordless path extraction starting from path
Pk = [n2, ...., n1] and ending in node n2.
Optimized with marking of visited chordless P1s.
circuitAverageCredibility(self, circ)
Renders the average linking credibility of a Chordless Circuit.
circuitCredibilities(self, circuit, Debug=False)
Renders the average linking credibilities and the minimal link of a Chordless Circuit.
circuitMaxCredibility(self, circ)
Renders the maximal linking credibility of a Chordless Circuit.
circuitMinCredibility(self, circ)
Renders the minimal linking credibility of a Chordless Circuit.
closeSymmetric(self, InSite=True)
Produces the symmetric closure of self.relation.
closeTransitive(self, Reverse=False, InSite=True, Comments=False)
Produces the transitive closure of self.relation
 
*Parameters*:
 
    - If *Reverse* == True (False default) all transitive links are dropped, otherwise all transitive links are closed with min[r(x,y),r(y,z)];
    - If *Insite* == False (True by default) the methods return a modified copy of self.relation without altering the original self.relation, otherwise self.relation is modified.
components(self)
Renders the list of connected components.
computeAllDensities(self, choice=None)
parameter: choice in self
renders six densitiy parameters:
arc density, double arc density,
single arc density, strict single arc density,
absence arc density, strict absence arc densitiy.
computeArrowRaynaudOrder(self)
Renders a linear ordering from worst to best of the actions following Arrow&Raynaud's rule.
computeArrowRaynaudRanking(self)
renders a linear ranking from best to worst of the actions following Arrow&Raynaud's rule.
computeAverageValuation(self)
Computes the bipolar average correlation between
self and the crisp complete digraph of same order
of the irreflexive and determined arcs of the digraph
computeBadChoices(self, Comments=False)
Computes characteristic values for potentially bad choices.
 
.. note::
 
     Returns a tuple with following content:
 
     [(0)-determ,(1)degirred,(2)degi,(3)degd,(4)dega,(5)str(choice),(6)absvec]
computeBadPirlotChoices(self, Comments=False)
Characteristic values for potentially bad choices
using the Pirlot's fixpoint algorithm.
computeBestChoiceRecommendation(self, Verbose=False, Comments=False, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True)
Sets self.bestChoice, self.bestChoiceData, self.worstChoice and self.worstChoiceData
with the showBestChoiceRecommendation method.
 
First and last choices data is the following:
[(0)-determ,(1)degirred,(2)degi,(3)degd,(4)dega,(5)str(choice),(6)domvec,(7)cover]
 
self.bestChoice = self.bestChoiceData[5]
self.worstChoice = self.worstChoiceData[5]
computeBipolarCorrelation(self, other, MedianCut=False, filterRelation=None, Debug=False)
obsolete: dummy replacement for Digraph.computeOrdinalCorrelation method
computeChordlessCircuits(self, Odd=False, Comments=False, Debug=False)
Renders the set of all chordless circuits detected in a digraph.
Result is stored in <self.circuitsList>
holding a possibly empty list of tuples with at position 0 the
list of adjacent actions of the circuit and at position 1
the set of actions in the stored circuit.
 
When *Odd* is True, only chordless circuits with an odd length
are collected.
computeChordlessCircuitsMP(self, Odd=False, Threading=False, nbrOfCPUs=None, startMethod=None, Comments=False, Debug=False)
Multiprocessing version of computeChordlessCircuits().
 
Renders the set of all chordless odd circuits detected in a digraph.
Result (possible empty list) stored in <self.circuitsList>
holding a possibly empty list tuples with at position 0 the
list of adjacent actions of the circuit and at position 1
the set of actions in the stored circuit.
Inspired by Dias, Castonguay, Longo, Jradi, Algorithmica (2015).
 
Returns a possibly empty list of tuples (circuit,frozenset(circuit)).
 
If Odd == True, only circuits of odd length are retained in the result.
computeCoSize(self)
Renders the number of non validated non reflexive arcs
computeConcentrationIndex(self, X, N)
Renders the Gini concentration index of the X serie.
N contains the partial frequencies.
Based on the triangle summation formula.
computeConcentrationIndexTrapez(self, X, N)
Renders the Gini concentration index of the X serie.
N contains the partial frequencies.
Based on the triangles summation formula.
computeCondorcetLosers(self)
Wrapper for condorcetLosers().
computeCondorcetWinners(self)
Wrapper for condorcetWinners().
computeCopelandOrder(self)
renders a linear ordering from worst to best of the actions following Arrow&Raynaud's rule.
computeCopelandRanking(self)
renders a linear ranking from best to worst of the actions following Arrow&Raynaud's rule.
computeCutLevelDensities(self, choice, level)
parameter: choice in self, robustness level
renders three robust densitiy parameters:
robust double arc density,
robust single arc density,
robust absence arc densitiy.
computeDensities(self, choice)
parameter: choice in self
renders the four densitiy parameters:
arc density, double arc density, single arc density, absence arc density.
computeDeterminateness(self, InPercents=False)
Computes the Kendalll distance of self
with the all median-valued indeterminate digraph of order n.
 
Return the average determination of the irreflexive part of the digraph.
 
*determination* = sum_(x,y) { abs[ r(xRy) - Med ] } / n(n-1)
 
If *InPercents* is True, returns the average determination in percentage of
(Max - Med) difference.
 
>>> from outrankingDigraphs import BipolarOutrankingDigraph
>>> from randomPerfTabs import Random3ObjectivesPerformanceTableau
>>> t = Random3ObjectivesPerformanceTableau(numberOfActions=7,numberOfCriteria=7,seed=101)
>>> g = BipolarOutrankingDigraph(t,Normalized=True)
>>> g
*------- Object instance description ------*
Instance class      : BipolarOutrankingDigraph
Instance name       : rel_random3ObjectivesPerfTab
Actions             : 7
Criteria            : 7
Size                : 27
Determinateness (%) : 65.67
Valuation domain    : [-1.00;1.00]
>>> print(g.computeDeterminateness())
0.3134920634920634920634920638
>>> print(g.computeDeterminateness(InPercents=True))
65.67460317460317460317460320
>>> g.recodeValuation(0,1)
>>> g
*------- Object instance description ------*
Instance class      : BipolarOutrankingDigraph
Instance name       : rel_random3ObjectivesPerfTab
Actions             : 7
Criteria            : 7
Size                : 27
Determinateness (%) : 65.67
Valuation domain    : [0.00;1.00]
>>> print(g.computeDeterminateness())
0.1567460317460317460317460318
>>> print(g.computeDeterminateness(InPercents=True))
65.67460317460317460317460320
computeDiameter(self, Oriented=True)
Renders the (by default oriented) diameter of the digraph instance
computeDigraphCentres(self, WeakDistances=False, Comments=False)
The centers of a digraph are the nodes with finite minimal shortes path lengths.
 
The maximal neighborhood distances are stored in *self.maximalNeighborhoodDistances*.
 
The corresponding digraph radius and diameter are stored respectively  in *self.radius* and *self.diameter*.
 
With *Comments* = True, all these results are printed out.
 
*Source*: Claude Berge, *The Theory of Graphs*, Dover (2001) pp. 119, original in French Dunod (1958)
computeDynamicProgrammingStages(self, source, sink, Debug=False)
Renders the discrete stages of the optimal substructure for
dynamic pogramming digrahs from a given source node 
to a given sink sink node.
 
Returns a list of list of action identifyers.
computeGoodChoiceVector(self, ker, Comments=False)
| Computing Characteristic values for dominant pre-kernels
| using the von Neumann dual fixoint equation
computeGoodChoices(self, Comments=False)
Computes characteristic values for potentially good choices.
 
..note::
 
     Return a tuple with following content:
 
     [(0)-determ,(1)degirred,(2)degi,(3)degd,(4)dega,(5)str(choice),(6)domvec,(7)cover]
computeGoodPirlotChoices(self, Comments=False)
Characteristic values for potentially good choices
using the Pirlot fixpoint algorithm.
computeIncomparabilityDegree(self, InPercents=False, Comments=False)
Renders the incomparability degree (Decimal), i.e. the relative number of symmetric indeterminate relations of the irreflexive part of a digraph.
computeKemenyIndex(self, otherRelation)
renders the Kemeny index of the self.relation
compared with a given crisp valued relation of a compatible
other digraph (same nodes or actions).
computeKemenyOrder(self, orderLimit=7, Debug=False)
Renders a ordering from worst to best of the actions with maximal Kemeny index.
Return a tuple: kemenyOrder (from worst to best), kemenyIndex
computeKemenyRanking(self, orderLimit=7, seed=None, sampleSize=1000, Debug=False)
Renders a ranking from best to worst of the actions with maximal Kemeny index.
 
.. note::
 
     Returns a tuple: kemenyRanking (from best to worst), kemenyIndex.
computeKernelVector(self, kernel, Initial=True, Comments=False)
| Computing Characteristic values for dominant pre-kernels
| using the von Neumann dual fixpoint equation
computeKohlerOrder(self)
Renders an ordering (worst to best) of the actions following Kohler's rule.
computeKohlerRanking(self)
Renders a ranking (best to worst) of the actions following Kohler's rule.
computeMaxHoleSize(self, Comments=False)
Renders the length of the largest chordless cycle
in the corresponding disjunctive undirected graph.
computeMeanInDegree(self)
Renders the mean indegree of self.
!!! self.size must be set previously !!!
computeMeanOutDegree(self)
Renders the mean degree of self.
!!! self.size must be set previously !!!
computeMeanSymDegree(self)
Renders the mean degree of self.
!!! self.size must be set previously !!!
computeMedianOutDegree(self)
Renders the median outdegree of self.
!!! self.size must be set previously !!!
computeMedianSymDegree(self)
Renders the median symmetric degree of self.
!!! self.size must be set previously !!!
computeMoreOrLessUnrelatedPairs(self)
Renders a list of more or less unrelated pairs.
computeNetFlowsOrder(self)
Renders an ordered list (from best to worst) of the actions
following the net flows ranking rule.
computeNetFlowsOrderDict(self)
Renders an ordered list (from worst to best) of the actions
following the net flows ranking rule.
computeNetFlowsRanking(self)
Renders an ordered list (from best to worst) of the actions
following the net flows ranking rule.
computeNetFlowsRankingDict(self)
Renders an ordered list (from best to worst) of the actions
following the net flows ranking rule.
computeODistance(self, op2, comments=False)
renders the squared normalized distance of
two digraph valuations.
 
.. note::
 
     op2 = digraphs of same order as self.
computeOrbit(self, choice, withListing=False)
renders the set of isomorph copies of a choice following
the automorphism of the digraph self
computeOrderCorrelation(self, order, Debug=False)
Renders the ordinal correlation K of a digraph instance
when compared with a given linear order (from worst to best) of its actions
 
K = sum_{x != y} [ min( max(-self.relation(x,y)),other.relation(x,y), max(self.relation(x,y),-other.relation(x,y)) ]
 
K /= sum_{x!=y} [ min(abs(self.relation(x,y),abs(other.relation(x,y)) ]
 
.. note::
 
     Renders a dictionary with the key 'correlation' containing the actual bipolar correlation index and the key 'determination' containing the minimal determination level D of self and the other relation.
 
     D = sum_{x != y} min(abs(self.relation(x,y)),abs(other.relation(x,y)) / n(n-1)
 
     where n is the number of actions considered.
 
     The correlation index with a completely indeterminate relation
     is by convention 0.0 at determination level 0.0 .
 
.. warning::
 
     self must be a normalized outranking digraph instance !
computeOrdinalCorrelation(self, other, MedianCut=False, filterRelation=None, Debug=False)
Renders the bipolar correlation K of a
self.relation when compared
with a given compatible (same actions set)) digraph or
a [-1,1] valued compatible relation (same actions set).
 
If MedianCut=True, the correlation is computed on the median polarized relations.
 
If filterRelation is not None, the correlation is computed on the partial domain corresponding to the determined part of the filter relation.
 
.. warning::
 
     Notice that the 'other' relation and/or the 'filterRelation',
     the case given, must both be normalized, ie [-1,1]-valued !
 
K = sum_{x != y} [ min( max(-self.relation[x][y]),other.relation[x][y]), max(self.relation[x][y],-other.relation[x][y]) ]
 
K /= sum_{x!=y} [ min(abs(self.relation[x][y]),abs(other.relation[x][y])) ]
 
.. note::
 
     Renders a tuple with at position 0 the actual bipolar correlation index
     and in position 1 the minimal determination level D of self and
     the other relation.
 
     D = sum_{x != y} min(abs(self.relation[x][y]),abs(other.relation[x][y])) / n(n-1)
 
     where n is the number of actions considered.
 
     The correlation index with a completely indeterminate relation
     is by convention 0.0 at determination level 0.0 .
computeOrdinalCorrelationMP(self, other, MedianCut=False, Threading=False, nbrOfCPUs=None, startMethod=None, Comments=False, Debug=False)
Multi processing version of the digraphs.computeOrdinalCorrelation() method.
 
.. note::
     The relation filtering and the MedinaCut option are not implemented in the MP version.
computePairwiseClusterComparison(self, K1, K2, Debug=False)
Computes the pairwise cluster comparison credibility vector
from bipolar-valued digraph g. with K1 and K2 disjoint
lists of action keys from g actions disctionary.
Returns the dictionary
{'I': Decimal(),'P+':Decimal(),'P-':Decimal(),'R' :Decimal()}
where one and only one item is strictly positive.
computePreKernels(self)
computing dominant and absorbent preKernels:
    Result in self.dompreKernels and self.abspreKernels
computePreRankingRelation(self, preRanking, Normalized=True, Debug=False)
Renders the bipolar-valued relation obtained from
a given preRanking in decreasing levels (list of lists) result.
computePreorderRelation(self, preorder, Normalized=True, Debug=False)
Renders the bipolar-valued relation obtained from
a given preordering in increasing levels (list of lists) result.
computePrincipalOrder(self, Colwise=False, Comments=False)
Rendesr an ordering from wrost to best of the decision actions.
computePrincipalRanking(self, Colwise=False, Comments=False)
Rendesr a ranking from best to worst of the decision actions.
computePrincipalScores(self, plotFileName=None, Colwise=False, imageType=None, tempDir=None, bgcolor='cornsilk', Comments=False, Debug=False)
Renders a ordered list of the first principal eigenvector of the covariance of the valued outdegrees of self.
 
.. note::
 
   The method, relying on writing and reading temporary files by default in a temporary directory is threading and multiprocessing safe !
   (see Digraph.exportPrincipalImage method)
computePrudentBetaLevel(self, Debug=False)
computes alpha, ie the lowest valuation level, for which the
bipolarly polarised digraph doesn't contain a chordless circuit.
computeRankingByBestChoosing(self, CoDual=False, Debug=False)
Computes a weak preordering of the self.actions by recursive
best choice elagations.
 
Stores in self.rankingByBestChoosing['result'] a list of (P+,bestChoice) tuples
where P+ gives the best choice complement outranking
average valuation via the computePairwiseClusterComparison
method.
 
If self.rankingByBestChoosing['CoDual'] is True, 
the ranking-by-choosing was computed on the codual of self.
computeRankingByBestChoosingRelation(self, rankingByBestChoosing=None, Debug=False)
Renders the bipolar-valued relation obtained from
the self.rankingByBestChoosing result.
computeRankingByChoosing(self, actionsSubset=None, Debug=False, CoDual=False)
Computes a weak preordring of the self.actions by iterating
jointly first and last choice elagations.
 
Stores in self.rankingByChoosing['result'] a list of ((P+,bestChoice),(P-,worstChoice)) pairs
where P+ (resp. P-) gives the best (resp. worst) choice complement outranking
(resp. outranked) average valuation via the computePairwiseClusterComparison
method.
 
If self.rankingByChoosing['CoDual'] is True, the ranking-by-choosing was computed on the codual of self.
computeRankingByChoosingRelation(self, rankingByChoosing=None, actionsSubset=None, Debug=False)
Renders the bipolar-valued relation obtained from
the self.rankingByChoosing result.
computeRankingByLastChoosing(self, CoDual=False, Debug=False)
Computes a weak preordring of the self.actions by iterating
worst choice elagations.
 
Stores in self.rankingByLastChoosing['result'] a list of (P-,worstChoice) pairs
where P- gives the worst choice complement outranked
average valuation via the computePairwiseClusterComparison
method.
 
If self.rankingByChoosing['CoDual'] is True, the ranking-by-last-chossing 
was computed on the codual of self.
computeRankingByLastChoosingRelation(self, rankingByLastChoosing=None, Debug=False)
Renders the bipolar-valued relation obtained from
the self.rankingByLastChoosing result.
computeRankingCorrelation(self, ranking, Debug=False)
Renders the ordinal correlation K of a digraph instance
when compared with a given linear ranking of its actions
 
K = sum_{x != y} [ min( max(-self.relation(x,y)),other.relation(x,y), max(self.relation(x,y),-other.relation(x,y)) ]
 
K /= sum_{x!=y} [ min(abs(self.relation(x,y),abs(other.relation(x,y)) ]
 
.. note::
 
     Renders a tuple with at position 0 the actual bipolar correlation index
     and in position 1 the minimal determination level D of self and
     the other relation.
 
     D = sum_{x != y} min(abs(self.relation(x,y)),abs(other.relation(x,y)) / n(n-1)
 
     where n is the number of actions considered.
 
     The correlation index with a completely indeterminate relation
     is by convention 0.0 at determination level 0.0 .
computeRelationalStructure(self, Debug=False)
Renders the counted decomposition of the valued relations into
the following type of links:
gt '>', eq '=', lt '<', incomp '<>',
leq '<=', geq '>=', indeterm '?'
computeRubisChoice(self, Comments=False, _OldCoca=False, BrokenCocs=True, Threading=False, nbrOfCPUs=1)
Renders self.strictGoodChoices, self.nullChoices
self.strictBadChoices, self.nonRobustChoices.
 
.. warning::
    Changes in site the outranking digraph by
    adding or braking chordless odd outranking circuits.
computeRubyChoice(self, Comments=False, _OldCoca=False)
dummy for computeRubisChoice()
old versions compatibility.
computeShortestPathLengths(self, WeakPaths=False, Comments=False, Debug=False)
Renders a double dictionary with the directed distances, i.e. the shortest path lengths between all self.actions
 
Equals *None* if there does not exist a directed path between two actions.
 
*Source*: Claude Berge, *The Theory of Graphs*, Dover (2001) pp. 119, original in French Dunod (1958)
computeSingletonRanking(self, Comments=False, Debug=False)
Renders the sorted bipolar net determinatation of outrankingness
minus outrankedness credibilities of all singleton choices.
 
res = ((netdet,singleton,dom,absorb)+)
computeSize(self)
Renders the number of validated non reflexive arcs
computeSizeTransitiveClosure(self)
Renders the size of the transitive closure of a digraph.
computeSlaterOrder(self, isProbabilistic=False, seed=None, sampleSize=1000, Debug=False)
Reversed return from computeSlaterRanking method.
computeSlaterRanking(self, isProbabilistic=False, seed=None, sampleSize=1000, Debug=False)
Renders a ranking of the actions with minimal Slater index.
Return a tuple: slaterOrder, slaterIndex
computeSymmetryDegree(self, InPercents=False, Comments=False)
Renders the symmetry degree (Decimal) of the irreflexive part of a digraph.
 
.. note::
 
   Empty and indeterminate digraphs are considered to be symmetric.
computeTopologicalRanking(self, Debug=False)
Mimetic Wrapper of the topologicalSort() method.
computeTransitivityDegree(self, InPercents=False, Comments=False)
Renders the transitivity degree (Decimal) of a digraph.
 
.. note:: 
 
   An empty or indeterminate digraph is considered to be transitive.
computeUnrelatedPairs(self)
Renders a list of more or less unrelated pairs.
computeValuationLevels(self, choice=None, Debug=False)
renders the symmetric closure of the
apparent valuations levels of self
in an increasingly ordered list.
If parameter choice is given, the
computation is limited to the actions
of the choice.
computeValuationPercentages(self, choice, percentiles, withValues=False)
Parameters: choice and list of percentiles.
renders a series of percentages of the characteristics valuation of
the arcs in the digraph.
computeValuationPercentiles(self, choice, percentages, withValues=False)
Parameters: choice and list of percentages.
renders a series of quantiles of the characteristics valuation of
the arcs in the digraph.
computeValuationStatistics(self, Sampling=False, Comments=False)
Renders the mean and variance of the valuation
of the non reflexive pairs.
computeValuedRankingRelation(self, ranking)
Renders the valued relation characteristics compatible 
with the given linar ranking. Discordant charcateristics 
are set to the indeterminate value.
computeWeakCondorcetLosers(self)
Wrapper for weakCondorcetLosers().
computeWeakCondorcetWinners(self)
Wrapper for weakCondorcetWinners().
computeupdown1(self, s, S)
Help method for show_MIS_HB2 method.
fills self.newmisset, self.upmis, self.downmis.
computeupdown2(self, s, S)
Help method for show_MIS_HB1 method.
Fills self.newmisset, self.upmis, self.downmis.
computeupdown2irred(self, s, S)
Help method for show_MIS_HB1 method.
Fills self.newmisset, self.upmis, self.downmis.
condorcetLosers(self)
Renders the set of decision actions x such that
self.relation[x][y] < self.valuationdomain['med']
for all y != x.
condorcetWinners(self)
Renders the set of decision actions x such that
self.relation[x][y] > self.valuationdomain['med']
for all y != x.
contra(self, v)
Parameter: choice.
Renders the negation of a choice v characteristic's vector.
convertRelationToDecimal(self)
Converts the float valued self.relation in a decimal valued one.
convertValuation2Integer(self, InSite=True, Comments=False)
Converts the self.relation valuation to integer values by converting the Decimals to Fractions and multiply by the least commun multiple of the fraction denominators.
 
*Parameters*:
 
    - If *Insite* == False (True by default) the method returns a modified copy of self.relation without altering the original self.relation, otherwise self.relation and self.valuationdomain is modified.
convertValuationToDecimal(self)
Convert the float valuation limits to Decimals.
coveringIndex(self, choice, direction='out')
Renders the covering index of a given choice in a set of objects,
ie the minimum number of choice members that cover each
non selected object.
crispKDistance(self, digraph, Debug=False)
Renders the crisp Kendall distance between two bipolar valued
digraphs.
 
.. warning::
 
     Obsolete! Is replaced by the self.computeBipolarCorrelation(other, MedianCut=True) Digraph method
detectChordlessCircuits(self, Comments=False, Debug=False)
Detects a chordless circuit in a digraph.
Returns a Boolean
detectChordlessPath(self, Pk, n2, Comments=False, Debug=False)
New procedure from Agrum study April 2009
recursive chordless path extraction starting from path
Pk = [n2, ...., n1] and ending in node n2.
Optimized with marking of visited chordless P1s.
determinateness(self, vec, inPercent=True)
Renders the determinateness of a characteristic vector *vec* = 
[(r(x),x),(r(y),y), ...] of length *n* in valuationdomain [Min,Med,Max]:
 
*result* =  sum_x( abs(r(x)-Med) ) / ( n*(Max-Med) )
 
If inPercent, *result* shifted (+1) and reduced (/2) to [0,1] range.
digraph2Graph(self, valuationDomain={'min': -1, 'med': 0, 'max': 1}, Debug=False, ConjunctiveConversion=True)
Convert a Digraph instance to a Graph instance.
dneighbors(self, node)
Renders the set of dominated out-neighbors of a node.
domin(self, choice)
Renders the dominance degree of a choice.
dominantChoices(self, S)
Generates all minimal dominant choices of a bipolar valued digraph.
 
.. note::
 
     Initiate with S = self.actions.copy().
domirred(self, choice)
Renders the crips +irredundance degree of a choice.
domirredval(self, choice, relation)
Renders the valued +irredundance degree of a choice.
domirredx(self, choice, x)
Renders the crips +irredundance degree of node x in a choice.
domkernelrestrict(self, prekernel)
Parameter: dominant prekernel
Renders dominant prekernel restricted relation.
exportGraphViz(self, fileName=None, actionsSubset=None, bestChoice=set(), worstChoice=set(), firstChoice=set(), lastChoice=set(), Comments=True, graphType='png', pictureFormat=None, graphSize='7,7', relation=None, bgcolor='cornsilk')
export GraphViz dot file  for graph drawing filtering.
flatChoice(self, ch, Debug=False)
Converts set or list ch recursively to a flat list of items.
forcedBestSingleChoice(self)
Renders the set of most determined outranking singletons in self.
gammaSets(self)
Renders the dictionary of neighborhoods {node: (dx,ax)}
with set *dx* gathering the dominated, and set *ax* gathering
the absorbed neighborhood.
generateAbsPreKernels(self)
Generate all absorbent prekernels from independent choices generator.
generateDomPreKernels(self)
Generate all dominant prekernels from independent choices generator.
htmlChoiceVector(self, ch, ChoiceVector=True, choiceType='good')
Show procedure for annotated bipolar choices.
inDegrees(self)
renders the median cut indegrees
inDegreesDistribution(self)
Renders the distribution of indegrees.
independentChoices(self, U)
Generator for all independent choices with neighborhoods of a bipolar valued digraph:
 
.. note::
 
       * Initiate with U = self.singletons().
       * Yields [(independent choice, domnb, absnb, indnb)].
inner_prod(self, v1, v2)
Parameters: two choice characteristic vectors
Renders the inner product of two characteristic vetors.
intstab(self, choice)
Computes the independence degree of a choice.
irreflex(self, mat)
Puts diagonal entries of mat to valuationdomain['min']
isAsymmetricIndeterminate(self, Debug=False)
Checks the self.relation for assymmetric indeterminateness!!
 
.. warning::
 
    The reflexive links are ignored !!
isComplete(self, Debug=False)
checks the completeness property of self.relation by checking
for the absence of a link between two actions!!
 
.. warning::
 
    The reflexive links are ignored !!
isCyclic(self, Debug=False)
checks the cyclicity of self.relation by checking
for a reflexive loop in its transitive closure-
 
.. warning::
 
     self.relation is supposed to be irreflexive !
isIntegerValued(self, Debug=False)
Checks whether the decimal valuation of self is integer-valued
be using the as_integer_ratio() method of a Decimal 
giving a tuple (numerator,denominator). If denominator == 1, the
number is an integer.
isOutrankingDigraph(self, Comments=True, Debug=False)
Checks the outranking digraph characteristic condition (3.3).
 
relation[x][y] + relation[y][x)[y] >= 0.0
 
.. warning::
 
    The reflexive links are ignored and the valuation must be bipolar !!
isStrictOutrankingDigraph(self, Comments=True, Debug=False)
Checks the strict outranking digraph characteristic condition (3.1).
 
-(relation[x][y] + relation[y][x]) <= 0.0 , x != y
 
.. warning::
 
    The reflexive links are ignored and the valuation must be bipolar !!
isSymmetric(self, Comments=False)
True if symmetry degree == 1.0.
isTransitive(self, Comments=False)
True if transitivity degree == 1.0.
isWeaklyComplete(self, Debug=False)
checks the weakly completeness property of self.relation by checking
for the absence of a link between two actions!!
 
.. warning::
 
    The reflexive links are ignored !!
iterateRankingByChoosing(self, Odd=False, CoDual=False, Comments=True, Debug=False, Limited=None)
Renders a ranking by choosing result when progressively eliminating
all chordless (odd only) circuits with rising valuation cut levels.
 
Parameters
    CoDual = False (default)/True
    Limited = proportion (in [0,1]) * (max - med) valuationdomain
kChoices(self, A, k)
Renders all choices of length k from set A
matmult2(self, m, v)
Parameters: digraph relation and choice characteristic vector
matrix multiply vector by inner production
meanDegree(self)
Renders the mean degree of self.
!!! self.size must be set previously !!!
meanLength(self, Oriented=False)
Renders the (by default non-oriented) mean neighbourhoor depth of self.
!!! self.order must be set previously !!!
minimalChoices(self, S)
Generates all dominant or absorbent choices of a bipolar
valued digraph.
 
.. note:
 
   * Initiate with S = (actions, dict of dominant or absorbent closed neighborhoods)
   * See showMinDom and showMinAbs methods.
minimalValuationLevelForCircuitsElimination(self, Odd=True, Debug=False, Comments=False)
renders the minimal valuation level <lambda> that eliminates all
self.circuitsList stored odd chordless circuits from self.
 
.. warning::
 
    The <lambda> level polarised may still contain newly appearing chordless odd circuits !
neighbourhoodCollection(self, Oriented=False, Potential=False)
Renders the neighbourhood.
neighbourhoodDepthDistribution(self, Oriented=False)
Renders the distribtion of neighbourhood depths.
notGammaSets(self)
Renders the dictionary of neighborhoods {node: (dx,ax)}
with set *dx* gathering the not dominated, and set *ax* gathering
the not absorbed neighborhood.
notaneighbors(self, node)
Renders the set of absorbed not in-neighbors of a node.
notdneighbors(self, node)
Renders the set of not dominated out-neighbors of a node.
outDegrees(self)
renders the median cut outdegrees
outDegreesDistribution(self)
Renders the distribution of outdegrees.
plusirredundant(self, U)
Generates all +irredundant choices of a digraph.
powerset(self, U)
Generates all subsets of a set.
readPerrinMisset(self, file='curd.dat')
read method for 0-1-char-coded MISs by default from the perrinMIS.c curd.dat result file.
readabsvector(self, x, relation)
Parameter: action x
absorbent in vector.
readdomvector(self, x, relation)
Parameter: action x
dominant out vector.
recodeValuation(self, newMin=-1.0, newMax=1.0, ndigits=4, Debug=False)
Recodes the characteristic valuation domain according
to the parameters given. 
 
*ndigits* indicates the number of decimal digits of the valuation.
relationFct(self, x, y)
wrapper for self.relation dictionary access to ensure interoperability
with the sparse and big outranking digraph implementation model.
save(self, fileName='tempdigraph', option=None, DecimalValuation=True, decDigits=2)
Persistent storage of a Digraph class instance in the form of
a python source code file
saveCSV(self, fileName='tempdigraph', Normalized=False, Dual=False, Converse=False, Diagonal=False, Debug=False)
Persistent storage of a Digraph class instance in the form of
a csv file.
saveXMCDA2(self, fileName='temp', fileExt='xmcda2', Comments=True, relationName='R', relationType='binary', category='random', subcategory='valued', author='digraphs Module (RB)', reference='saved from Python', valuationType='standard', digits=2, servingD3=False)
save digraph in XMCDA 2.0 format. Deprecated now.
savedre(self, fileName='temp')
save digraph in nauty format.
sharp(self, x, y)
Paramaters: choice characteristic values.
Renders the sharpest of two characteristic values x and y.
sharpvec(self, v, w)
Paramaters: choice characteristic vectors.
Renders the sharpest of two characteristic vectors v and w.
showActions(self)
presentation methods for digraphs actions
showAll(self)
Detailed show method for genuine digraphs.
showAttributes(self)
Prints out the attributes of self.
showAutomorphismGenerators(self)
Renders the generators of the automorphism group.
showBadChoices(self, Recompute=True)
Characteristic values for potentially bad choices.
showBestChoiceRecommendation(self, Verbose=False, Comments=True, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True)
Shows the RuBis best choice recommendation.
 
.. note::
 
    Computes by default the Rubis best choice recommendation on the corresponding strict (codual) outranking digraph.
 
    By default, with BrokenCocs=True, we brake all chordless circuits at their weakest determined ( abs(r(x>y)) + abs(r(y>x)) ) link.
 
    When BrokenCocs=False we proceed like follows:
 
    In case of chordless circuits, if supporting arcs are more credible
    than the reversed negating arcs, we collapse the circuits into hyper nodes.
    Inversely,  if supporting arcs are not more credible than the reversed negating arcs,
    we brake the circuits on their weakest arc.
 
Usage example:
 
>>> from outrankingDigraphs import *
>>> t = Random3ObjectivesPerformanceTableau(seed=5)
>>> g = BipolarOutrankingDigraph(t)
>>> g.showBestChoiceRecommendation()
***********************
RuBis Best Choice Recommendation (BCR)
(in decreasing order of determinateness)   
Credibility domain:  [-100.0, 100.0]
=== >> potential first choices
* choice              : ['a04', 'a14', 'a19', 'a20']
   independence        : 1.19
   dominance           : 4.76
   absorbency          : -59.52
   covering (%)        : 75.00
   determinateness (%) : 57.86
   - most credible action(s) = { 'a14': 23.81, 'a19': 11.90, 'a04': 2.38, 'a20': 1.19, }  
=== >> potential last choices 
* choice              : ['a03', 'a12', 'a17']
  independence        : 4.76
  dominance           : -76.19
  absorbency          : 4.76
  covering (%)        : 0.00
  determinateness (%) : 65.39
  - most credible action(s) = { 'a03': 38.10, 'a12': 13.10, 'a17': 4.76, }
Execution time: 0.024 seconds
*****************************
showChoiceVector(self, ch, choiceType='good', ChoiceVector=True)
Show procedure for annotated bipolar choices.
showChordlessCircuits(self, Recompute=False)
Show method for chordless circuits observed in a Digraph instance.
 
If previous computation is required, stores the detected circuits in self.circuitsList attribute.
showComponents(self)
Shows the list of connected components of the digraph instance.
showCorrelation(self, corr=None, ndigits=3)
Renders the valued ordinal correlation index, the crisp Kendall tau index and their epistemic determination degree.
showFirstChoiceRecommendation(self, Verbose=False, Comments=True, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True)
Shows the RuBis first choice recommendation.
 
.. note::
 
    Computes by default the Rubis first choice recommendation on the corresponding strict (codual) outranking digraph.
 
    By default, with BrokenCocs=True, we brake all chordless circuits at their weakest determined ( abs(r(x>y)) + abs(r(y>x)) ) link.
 
    When BrokenCocs=False we proceed like follows:
 
    In case of chordless circuits, if supporting arcs are more credible
    than the reversed negating arcs, we collapse the circuits into hyper nodes.
    Inversely,  if supporting arcs are not more credible than the reversed negating arcs,
    we brake the circuits on their weakest arc.
 
Usage example:
 
>>> from outrankingDigraphs import *
>>> t = Random3ObjectivesPerformanceTableau(seed=5)
>>> g = BipolarOutrankingDigraph(t)
>>> g.showFirstChoiceRecommendation()
***********************
RuBis First Choice Recommendation (BCR)
(in decreasing order of determinateness)   
Credibility domain:  [-100.0, 100.0]
=== >> potential first choices
* choice              : ['a04', 'a14', 'a19', 'a20']
   independence        : 1.19
   dominance           : 4.76
   absorbency          : -59.52
   covering (%)        : 75.00
   determinateness (%) : 57.86
   - most credible action(s) = { 'a14': 23.81, 'a19': 11.90, 'a04': 2.38, 'a20': 1.19, }  
=== >> potential last choices 
* choice              : ['a03', 'a12', 'a17']
  independence        : 4.76
  dominance           : -76.19
  absorbency          : 4.76
  covering (%)        : 0.00
  determinateness (%) : 65.39
  - most credible action(s) = { 'a03': 38.10, 'a12': 13.10, 'a17': 4.76, }
Execution time: 0.024 seconds
*****************************
showGoodChoices(self, Recompute=True)
Characteristic values for potentially good choices.
showHTMLBestChoiceRecommendation(self, pageTitle=None, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True, htmlFileName=None)
showHTMLRelationHeatmap(self, actionsList=None, rankingRule='NetFlows', colorLevels=7, tableTitle='Relation Heatmap', relationName='r(x S y)', ndigits=2, fromIndex=None, toIndex=None, htmlFileName=None)
Launches a browser window with the colored relation map of self.
 
See corresponding :py:class:`~digraphs.Digraph.showHTMLRelationMap` method.
 
The *colorLevels* parameter may be set to 3, 5, 7 (default) or 9.
 
When the *actionsList* parameter is *None* (default), the digraphs actions list may be ranked with the *rankingRule* parameter set to the 'Copeland' (default) or to the 'Netlows' ranking rule.
 
When the *htmlFileName* parameter is set to a string value 'xxx', a html file named 'xxx.html' will be generated in the current working directory. Otherwise, a temporary file named 'tmp*.html' will be generated there.
 
Example::
 
    >>> from outrankingDigraphs import *
    >>> t = RandomCBPerformanceTableau(numberOfActions=25,seed=1)
    >>> g = BipolarOutrankingDigraph(t,ndigits=2)
    >>> gcd = ~(-g)  # strict outranking relation
    >>> gcd.showHTMLRelationHeatmap(colorLevels=7,ndigits=2)
    
.. image:: relationHeatmap.png
   :alt: Browser view of a relation map
   :width: 600 px
   :align: center
showHTMLRelationMap(self, actionsList=None, rankingRule='Copeland', Colored=True, tableTitle='Relation Map', relationName='r(x S y)', symbols=['+', '&middot;', '&nbsp;', '&#150;', '&#151'], fromIndex=None, toIndex=None, htmlFileName=None)
Launches a browser window with the colored relation map of self.
See corresponding Digraph.showRelationMap() method.
 
When *htmlFileName* parameter is set to a string value, a html file
with that name will be stored in the current working directory.
 
By default, a temporary file named: tmp*.html will be generated
instead in the current working directory.
 
Example::
 
    >>> from outrankingDigraphs import *
    >>> t = RandomCBPerformanceTableau(numberOfActions=25,seed=1)
    >>> g = BipolarOutrankingDigraph(t,Normalized=True)
    >>> gcd = ~(-g)  # strict outranking relation
    >>> gcd.showHTMLRelationMap(rankingRule="NetFlows")
    
.. image:: relationMap.png
   :alt: Browser view of a relation map
   :width: 600 px
   :align: center
showHTMLRelationTable(self, actionsList=None, relation=None, IntegerValues=False, ndigits=2, Colored=True, tableTitle='Valued Adjacency Matrix', relationName='r(x S y)', ReflexiveTerms=False, htmlFileName=None, fromIndex=None, toIndex=None)
Launches a browser window with the colored relation table of self.
showMIS(self, withListing=True)
Prints all maximal independent choices:
    Result in self.misset.
showMIS_AH(self, withListing=True)
Prints all MIS using the Hertz method.
 
Result saved in self.hertzmisset.
showMIS_HB2(self, withListing=True)
Prints all MIS using the Hertz-Bisdorff method.
 
Result saved in self.newmisset.
showMIS_RB(self, withListing=True)
Prints all MIS using the Bisdorff method.
 
Result saved in self.newmisset.
showMIS_UD(self, withListing=True)
Prints all MIS using the Hertz-Bisdorff method.
 
Result saved in self.newmisset.
showMaxAbsIrred(self, withListing=True)
Computing maximal -irredundant choices:
    Result in self.absirset.
showMaxDomIrred(self, withListing=True)
Computing maximal +irredundant choices:
   Result in self.domirset.
showMinAbs(self, withListing=True)
Prints minimal absorbent choices:
    Result in self.absset.
showMinDom(self, withListing=True)
Prints all minimal dominant choices:
    Result in self.domset.
showNeighborhoods(self)
Lists the gamma and the notGamma function of self.
showOrbits(self, InChoices, withListing=True)
Prints the orbits of Choices along the automorphisms of
the Digraph instance.
 
Example Python session for computing the non isomorphic MISs from the 12-cycle graph:
 
>>> from digraphs import *
>>> c12 = CirculantDigraph(order=12,circulants=[1,-1])
>>> c12.automorphismGenerators()
...
  Permutations
  {'1': '1', '2': '12', '3': '11', '4': '10', '5': 
   '9', '6': '8', '7': '7', '8': '6', '9': '5', '10': 
   '4', '11': '3', '12': '2'}
  {'1': '2', '2': '1', '3': '12', '4': '11', '5': '10', 
   '6': '9', '7': '8', '8': '7', '9': '6', '10': '5', 
   '11': '4', '12': '3'}
  Reflections {}
>>> print('grpsize = ', c12.automorphismGroupSize)
  grpsize = 24
>>> c12.showMIS(withListing=False)
  *---  Maximal independent choices ---*
  number of solutions:  29
  cardinality distribution
  card.:  [0, 1, 2, 3, 4,  5,  6, 7, 8, 9, 10, 11, 12]
  freq.:  [0, 0, 0, 0, 3, 24,  2, 0, 0, 0,  0,  0,  0]
  Results in c12.misset
>>> c12.showOrbits(c12.misset,withListing=False)
...
  *---- Global result ----
  Number of MIS:  29
  Number of orbits :  4
  Labelled representatives:
  1: ['2','4','6','8','10','12']
  2: ['2','5','8','11']
  3: ['2','4','6','9','11']
  4: ['1','4','7','9','11']
  Symmetry vector
  stabilizer size: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, ...]
  frequency      : [0, 2, 0, 0, 0, 0, 0, 1, 0,  0,  0,  1, ...]
 
*Figure*: The symmetry axes of the non isomorphic MISs of the 12-cycle:
 
.. image:: c12.png
   :width: 400 px
   :align: center
   :alt: The 4 non isomorphic MIS of the 12-cycle graph
 
*Reference*: R. Bisdorff and J.L. Marichal (2008). Counting non-isomorphic maximal independent sets of the n-cycle graph. *Journal of Integer Sequences*, Vol. 11 Article 08.5.7 (`openly accessible here <https://www.cs.uwaterloo.ca/journals/JIS/VOL11/Marichal/marichal.html>`_)
showOrbitsFromFile(self, InFile, withListing=True)
Prints the orbits of Choices along the automorphisms of
the digraph self by reading in the 0-1 misset file format.
See the :py:func:`digraphs.Digraph.readPerrinMisset` method.
showPreKernels(self, withListing=True)
Printing dominant and absorbent preKernels:
    Result in self.dompreKernels and self.abspreKernels
showRankingByBestChoosing(self, rankingByBestChoosing=None)
A show method for self.rankinByBestChoosing result.
 
.. warning::
 
     The self.computeRankingByBestChoosing(CoDual=False/True) method instantiating the self.rankingByBestChoosing slot is pre-required !
showRankingByChoosing(self, rankingByChoosing=None, WithCoverCredibility=False)
A show method for self.rankinByChoosing result.
 
When parameter *WithCoverCredibility* is set to True, the credibility of outranking, respectively being outranked is indicated at each selection step. 
 
.. warning::
 
     The self.computeRankingByChoosing(CoDual=False/True) method instantiating the self.rankingByChoosing slot is pre-required !
showRankingByLastChoosing(self, rankingByLastChoosing=None, Debug=None)
A show method for self.rankinByChoosing result.
 
.. warning::
 
     The self.computeRankingByLastChoosing(CoDual=False/True) method instantiating the self.rankingByChoosing slot is pre-required !
showRelation(self)
prints the relation valuation in ##.## format.
showRelationMap(self, symbols=None, rankingRule='Copeland', fromIndex=None, toIndex=None, actionsList=None)
Prints on the console, in text map format, the location of
certainly validated and certainly invalidated outranking situations.
 
By default, symbols = {'max':'┬','positive': '+', 'median': ' ',
                       'negative': '-', 'min': '┴'}
 
The default ordering of the output is following the Copeland ranking rule
from best to worst actions. Further available ranking rule is the 'NetFlows' net flows rule.
 
 
Example::
 
    >>> from outrankingDigraphs import *
    >>> t = RandomCBPerformanceTableau(numberOfActions=25,seed=1)
    >>> g = BipolarOutrankingDigraph(t,Normalized=True)
    >>> gcd = ~(-g)  # strict outranking relation
    >>> gcd.showRelationMap(rankingRule="NetFlows")
     -   ++++++++  +++++┬+┬┬+
    - -   + +++++ ++┬+┬+++┬++
    ┴+  ┴ + ++  ++++┬+┬┬++┬++
    -   ++ - ++++-++++++┬++┬+
       - - - ++- ┬- + -+┬+-┬┬
    -----  -      -┬┬┬-+  -┬┬
    ----    --+-+++++++++++++
    -- --+- --++ ++ +++-┬+-┬┬
    ----  -  -+-- ++--+++++ +
    ----- ++- --- +---++++┬ +
    -- -- ---+ -++-+++-+ +-++
    -- --┴---+  + +-++-+ -  +
    ---- ┴---+-- ++--++++ - +
      --┴┴--  --- -  --+ --┬┬
     ---------+--+ ----- +-┬┬
    -┴---┴- ---+- + ---+++┬ +
    -┴┴--┴---+--- ++ -++--+++
    -----┴--- ---+-+- ++---+ 
    -┴┴--------------- --++┬ 
    --┴---------------- --+┬ 
    ┴--┴┴ -┴--┴┴-┴ --++  ++-+
    ----┴┴--------------- -  
    ┴┴┴----+-┴+┴---┴-+---+ ┴+
    ┴┴-┴┴┴-┴- - -┴┴---┴┴+ ┬ -
    ----┴┴-┴-----┴┴---  - -- 
    Ranking rule: NetFlows
    >>>
showRelationTable(self, Sorted=True, rankingRule=None, IntegerValues=False, actionsSubset=None, relation=None, ndigits=2, ReflexiveTerms=True, fromIndex=None, toIndex=None)
Prints the relation valuation in actions X actions table format.
Copeland and NetFlows rankings my be used.
showRubisBestChoiceRecommendation(self, **kwargs)
Dummy for backward portable showBestChoiceRecommendation().
showRubyChoice(self, Verbose=False, Comments=True, _OldCoca=True)
Dummy for showBestChoiceRecommendation()
needed for older versions compatibility.
showShort(self)
concise presentation method for genuine digraphs.
showSingletonRanking(self, Comments=True, Debug=False)
Calls self.computeSingletonRanking(comments=True,Debug = False).
Renders and prints the sorted bipolar net determinatation of outrankingness
minus outrankedness credibilities of all singleton choices.
 
res = ((netdet,sigleton,dom,absorb)+)
showStatistics(self)
Computes digraph statistics like order, size and arc-density.
showdre(self)
Shows relation in nauty format.
singletons(self)
list of singletons and neighborhoods
[(singx1, +nx1, -nx1, not(+nx1 or -nx1)),.... ]
sizeSubGraph(self, choice)
Output: (size, undeterm,arcDensity).
Renders the arc density of the induced subgraph.
strongComponents(self, setPotential=False)
Renders the set of strong components of self.
symDegreesDistribution(self)
Renders the distribution of symmetric degrees.
topologicalSort(self, Debug=False)
If self is acyclic, adds topological sort number to each node of self
and renders ordered list of nodes. Otherwise renders None.
Source: M. Golumbic Algorithmic Graph heory and Perfect Graphs,
Annals Of Discrete Mathematics 57 2nd Ed. , Elsevier 2004, Algorithm 2.4 p.44.
weakAneighbors(self, node)
Renders the set of absorbed in-neighbors of a node.
weakCondorcetLosers(self)
Renders the set of decision actions x such that
self.relation[x][y] <= self.valuationdomain['med']
for all y != x.
weakCondorcetWinners(self)
Renders the set of decision actions x such that
self.relation[x][y] >= self.valuationdomain['med']
for all y != x.
weakDneighbors(self, node)
Renders the set of dominated out-neighbors of a node.
weakGammaSets(self)
Renders the dictionary of neighborhoods {node: (dx,ax)}
zoomValuation(self, zoomFactor=1.0)
Zooms in or out, depending on the value of the zoomFactor provided,
the bipolar valuation of a digraph.

Data descriptors inherited from Digraph:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class Digraph(builtins.object)
    Digraph(file=None, order=7)
 
Genuine root class of all Digraph3 modules.
See Digraph3 tutorials.
 
All instances of the :py:class:`digraphs.Digraph` class contain at least the following components: 
 
1. A collection of digraph nodes called **actions** (decision alternatives): a list, set or (ordered) dictionary of nodes with 'name' and 'shortname' attributes,
2. A logical characteristic **valuationdomain**, a dictionary with three decimal entries: the minimum (-1.0, means certainly false), the median (0.0, means missing information) and the maximum characteristic value (+1.0, means certainly true),
3. The digraph **relation** : a double dictionary indexed by an oriented pair of actions (nodes) and carrying a characteristic value in the range of the previous valuation domain,
4. Its associated **gamma function** : a dictionary containing the direct successors, respectively predecessors of each action, automatically added by the object constructor,
5. Its associated **notGamma function** : a dictionary containing the actions that are not direct successors respectively predecessors of each action, automatically added by the object constructor.
 
A previously stored :py:class:`digraphs.Digraph` instance may be reloaded with the *file* argument::
 
    >>> from randomDigraphs import RandomValuationDigraph
    >>> dg = RandomValuationDigraph(order=3,Normalized=True,seed=1)
    >>> dg.save('testdigraph')
    Saving digraph in file: <testdigraph.py> 
    >>> from digraphs import Digraph
    >>> dg = Digraph(file='testdigraph') # without the .py extenseion
    >>> dg.__dict__
    {'name': 'testdigraph',
    'actions': {'a1': {'name': 'random decision action', 'shortName': 'a1'},
                'a2': {'name': 'random decision action', 'shortName': 'a2'},
                'a3': {'name': 'random decision action', 'shortName': 'a3'}},
    'valuationdomain': {'min': Decimal('-1.0'), 'med': Decimal('0.0'),
                            'max': Decimal('1.0'), 'hasIntegerValuation': False,},
    'relation': {'a1': {'a1': Decimal('0.0'), 'a2': Decimal('-0.66'), 'a3': Decimal('0.44')},
                 'a2': {'a1': Decimal('0.94'), 'a2': Decimal('0.0'), 'a3': Decimal('-0.84')},
                 'a3': {'a1': Decimal('-0.36'), 'a2': Decimal('-0.70'), 'a3': Decimal('0.0')}},
    'order': 3,
    'gamma': {'a1': ({'a3'}, {'a2'}), 'a2': ({'a1'}, set()), 'a3': (set(), {'a1'})},
    'notGamma': {'a1': ({'a2'}, {'a3'}),
                 'a2': ({'a3'}, {'a1', 'a3'}),
                 'a3': ({'a1', 'a2'}, {'a2'})}}
    >>>
 
  Methods defined here:
MISgen(self, S, I)
generator of maximal independent choices (voir Byskov 2004):
    * S ::= remaining nodes;
    * I ::= current independent choice
 
.. note::
 
        Inititalize: self.MISgen(self.actions.copy(),set())
__init__(self, file=None, order=7)
Initialize self.  See help(type(self)) for accurate signature.
__invert__(self)
Make the inverting operator ~self available for Digraph instances. 
 
Returns a ConverseDigraph instance of self.
__neg__(self)
Make the negation operator -self available for Digraph instances. 
 
Returns a DualDigraph instance of self.
__repr__(self)
Default presentation method for Digraph instances.
absirred(self, choice)
Renders the crips -irredundance degree of a choice.
absirredundant(self, U)
Generates all -irredundant choices of a digraph.
absirredval(self, choice, relation)
Renders the valued -irredundance degree of a choice.
absirredx(self, choice, x)
Computes the crips -irredundance degree of node x in a choice.
abskernelrestrict(self, prekernel)
Parameter: prekernel
Renders absorbent prekernel restricted relation.
absorb(self, choice)
Renders the absorbency degree of a choice.
absorbentChoices(self, S)
Generates all minimal absorbent choices of a bipolar valued digraph.
addValuationAttribute(self)
Adds the numpy valuation attribute
agglomerationDistribution(self)
Output: aggloCoeffDistribution, meanCoeff
Renders the distribution of agglomeration coefficients.
aneighbors(self, node)
Renders the set of absorbed in-neighbors of a node.
automorphismGenerators(self)
Adds automorphism group generators to the digraph instance.
 
.. note::
 
    Dependency: Uses the dreadnaut command from the nauty software package. See https://www3.cs.stonybrook.edu/~algorith/implement/nauty/implement.shtml
 
    On Ubuntu Linux:
      ...$ sudo apt-get install nauty
averageCoveringIndex(self, choice, direction='out')
Renders the average covering index of a given choice in a set of objects,
ie the average number of choice members that cover each
non selected object.
bipolarKCorrelation(self, digraph, Debug=False)
Renders the bipolar Kendall correlation between two bipolar valued
digraphs computed from the average valuation of the
XORDigraph(self,digraph) instance.
 
.. warning::
 
     Obsolete! Is replaced by the self.computeBipolarCorrelation(other) Digraph method
bipolarKDistance(self, digraph, Debug=False)
Renders the bipolar crisp Kendall distance between two bipolar valued
digraphs.
 
.. warning::
 
     Obsolete! Is replaced by the self.computeBipolarCorrelation(other, MedianCut=True) Digraph method
chordlessPaths(self, Pk, n2, Odd=False, Comments=False, Debug=False)
New procedure from Agrum study April 2009
recursive chordless path extraction starting from path
Pk = [n2, ...., n1] and ending in node n2.
Optimized with marking of visited chordless P1s.
circuitAverageCredibility(self, circ)
Renders the average linking credibility of a Chordless Circuit.
circuitCredibilities(self, circuit, Debug=False)
Renders the average linking credibilities and the minimal link of a Chordless Circuit.
circuitMaxCredibility(self, circ)
Renders the maximal linking credibility of a Chordless Circuit.
circuitMinCredibility(self, circ)
Renders the minimal linking credibility of a Chordless Circuit.
closeSymmetric(self, InSite=True)
Produces the symmetric closure of self.relation.
closeTransitive(self, Reverse=False, InSite=True, Comments=False)
Produces the transitive closure of self.relation
 
*Parameters*:
 
    - If *Reverse* == True (False default) all transitive links are dropped, otherwise all transitive links are closed with min[r(x,y),r(y,z)];
    - If *Insite* == False (True by default) the methods return a modified copy of self.relation without altering the original self.relation, otherwise self.relation is modified.
components(self)
Renders the list of connected components.
computeAllDensities(self, choice=None)
parameter: choice in self
renders six densitiy parameters:
arc density, double arc density,
single arc density, strict single arc density,
absence arc density, strict absence arc densitiy.
computeArrowRaynaudOrder(self)
Renders a linear ordering from worst to best of the actions following Arrow&Raynaud's rule.
computeArrowRaynaudRanking(self)
renders a linear ranking from best to worst of the actions following Arrow&Raynaud's rule.
computeAverageValuation(self)
Computes the bipolar average correlation between
self and the crisp complete digraph of same order
of the irreflexive and determined arcs of the digraph
computeBadChoices(self, Comments=False)
Computes characteristic values for potentially bad choices.
 
.. note::
 
     Returns a tuple with following content:
 
     [(0)-determ,(1)degirred,(2)degi,(3)degd,(4)dega,(5)str(choice),(6)absvec]
computeBadPirlotChoices(self, Comments=False)
Characteristic values for potentially bad choices
using the Pirlot's fixpoint algorithm.
computeBestChoiceRecommendation(self, Verbose=False, Comments=False, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True)
Sets self.bestChoice, self.bestChoiceData, self.worstChoice and self.worstChoiceData
with the showBestChoiceRecommendation method.
 
First and last choices data is the following:
[(0)-determ,(1)degirred,(2)degi,(3)degd,(4)dega,(5)str(choice),(6)domvec,(7)cover]
 
self.bestChoice = self.bestChoiceData[5]
self.worstChoice = self.worstChoiceData[5]
computeBipolarCorrelation(self, other, MedianCut=False, filterRelation=None, Debug=False)
obsolete: dummy replacement for Digraph.computeOrdinalCorrelation method
computeChordlessCircuits(self, Odd=False, Comments=False, Debug=False)
Renders the set of all chordless circuits detected in a digraph.
Result is stored in <self.circuitsList>
holding a possibly empty list of tuples with at position 0 the
list of adjacent actions of the circuit and at position 1
the set of actions in the stored circuit.
 
When *Odd* is True, only chordless circuits with an odd length
are collected.
computeChordlessCircuitsMP(self, Odd=False, Threading=False, nbrOfCPUs=None, startMethod=None, Comments=False, Debug=False)
Multiprocessing version of computeChordlessCircuits().
 
Renders the set of all chordless odd circuits detected in a digraph.
Result (possible empty list) stored in <self.circuitsList>
holding a possibly empty list tuples with at position 0 the
list of adjacent actions of the circuit and at position 1
the set of actions in the stored circuit.
Inspired by Dias, Castonguay, Longo, Jradi, Algorithmica (2015).
 
Returns a possibly empty list of tuples (circuit,frozenset(circuit)).
 
If Odd == True, only circuits of odd length are retained in the result.
computeCoSize(self)
Renders the number of non validated non reflexive arcs
computeConcentrationIndex(self, X, N)
Renders the Gini concentration index of the X serie.
N contains the partial frequencies.
Based on the triangle summation formula.
computeConcentrationIndexTrapez(self, X, N)
Renders the Gini concentration index of the X serie.
N contains the partial frequencies.
Based on the triangles summation formula.
computeCondorcetLosers(self)
Wrapper for condorcetLosers().
computeCondorcetWinners(self)
Wrapper for condorcetWinners().
computeCopelandOrder(self)
renders a linear ordering from worst to best of the actions following Arrow&Raynaud's rule.
computeCopelandRanking(self)
renders a linear ranking from best to worst of the actions following Arrow&Raynaud's rule.
computeCutLevelDensities(self, choice, level)
parameter: choice in self, robustness level
renders three robust densitiy parameters:
robust double arc density,
robust single arc density,
robust absence arc densitiy.
computeDensities(self, choice)
parameter: choice in self
renders the four densitiy parameters:
arc density, double arc density, single arc density, absence arc density.
computeDeterminateness(self, InPercents=False)
Computes the Kendalll distance of self
with the all median-valued indeterminate digraph of order n.
 
Return the average determination of the irreflexive part of the digraph.
 
*determination* = sum_(x,y) { abs[ r(xRy) - Med ] } / n(n-1)
 
If *InPercents* is True, returns the average determination in percentage of
(Max - Med) difference.
 
>>> from outrankingDigraphs import BipolarOutrankingDigraph
>>> from randomPerfTabs import Random3ObjectivesPerformanceTableau
>>> t = Random3ObjectivesPerformanceTableau(numberOfActions=7,numberOfCriteria=7,seed=101)
>>> g = BipolarOutrankingDigraph(t,Normalized=True)
>>> g
*------- Object instance description ------*
Instance class      : BipolarOutrankingDigraph
Instance name       : rel_random3ObjectivesPerfTab
Actions             : 7
Criteria            : 7
Size                : 27
Determinateness (%) : 65.67
Valuation domain    : [-1.00;1.00]
>>> print(g.computeDeterminateness())
0.3134920634920634920634920638
>>> print(g.computeDeterminateness(InPercents=True))
65.67460317460317460317460320
>>> g.recodeValuation(0,1)
>>> g
*------- Object instance description ------*
Instance class      : BipolarOutrankingDigraph
Instance name       : rel_random3ObjectivesPerfTab
Actions             : 7
Criteria            : 7
Size                : 27
Determinateness (%) : 65.67
Valuation domain    : [0.00;1.00]
>>> print(g.computeDeterminateness())
0.1567460317460317460317460318
>>> print(g.computeDeterminateness(InPercents=True))
65.67460317460317460317460320
computeDiameter(self, Oriented=True)
Renders the (by default oriented) diameter of the digraph instance
computeDigraphCentres(self, WeakDistances=False, Comments=False)
The centers of a digraph are the nodes with finite minimal shortes path lengths.
 
The maximal neighborhood distances are stored in *self.maximalNeighborhoodDistances*.
 
The corresponding digraph radius and diameter are stored respectively  in *self.radius* and *self.diameter*.
 
With *Comments* = True, all these results are printed out.
 
*Source*: Claude Berge, *The Theory of Graphs*, Dover (2001) pp. 119, original in French Dunod (1958)
computeDynamicProgrammingStages(self, source, sink, Debug=False)
Renders the discrete stages of the optimal substructure for
dynamic pogramming digrahs from a given source node 
to a given sink sink node.
 
Returns a list of list of action identifyers.
computeGoodChoiceVector(self, ker, Comments=False)
| Computing Characteristic values for dominant pre-kernels
| using the von Neumann dual fixoint equation
computeGoodChoices(self, Comments=False)
Computes characteristic values for potentially good choices.
 
..note::
 
     Return a tuple with following content:
 
     [(0)-determ,(1)degirred,(2)degi,(3)degd,(4)dega,(5)str(choice),(6)domvec,(7)cover]
computeGoodPirlotChoices(self, Comments=False)
Characteristic values for potentially good choices
using the Pirlot fixpoint algorithm.
computeIncomparabilityDegree(self, InPercents=False, Comments=False)
Renders the incomparability degree (Decimal), i.e. the relative number of symmetric indeterminate relations of the irreflexive part of a digraph.
computeKemenyIndex(self, otherRelation)
renders the Kemeny index of the self.relation
compared with a given crisp valued relation of a compatible
other digraph (same nodes or actions).
computeKemenyOrder(self, orderLimit=7, Debug=False)
Renders a ordering from worst to best of the actions with maximal Kemeny index.
Return a tuple: kemenyOrder (from worst to best), kemenyIndex
computeKemenyRanking(self, orderLimit=7, seed=None, sampleSize=1000, Debug=False)
Renders a ranking from best to worst of the actions with maximal Kemeny index.
 
.. note::
 
     Returns a tuple: kemenyRanking (from best to worst), kemenyIndex.
computeKernelVector(self, kernel, Initial=True, Comments=False)
| Computing Characteristic values for dominant pre-kernels
| using the von Neumann dual fixpoint equation
computeKohlerOrder(self)
Renders an ordering (worst to best) of the actions following Kohler's rule.
computeKohlerRanking(self)
Renders a ranking (best to worst) of the actions following Kohler's rule.
computeMaxHoleSize(self, Comments=False)
Renders the length of the largest chordless cycle
in the corresponding disjunctive undirected graph.
computeMeanInDegree(self)
Renders the mean indegree of self.
!!! self.size must be set previously !!!
computeMeanOutDegree(self)
Renders the mean degree of self.
!!! self.size must be set previously !!!
computeMeanSymDegree(self)
Renders the mean degree of self.
!!! self.size must be set previously !!!
computeMedianOutDegree(self)
Renders the median outdegree of self.
!!! self.size must be set previously !!!
computeMedianSymDegree(self)
Renders the median symmetric degree of self.
!!! self.size must be set previously !!!
computeMoreOrLessUnrelatedPairs(self)
Renders a list of more or less unrelated pairs.
computeNetFlowsOrder(self)
Renders an ordered list (from best to worst) of the actions
following the net flows ranking rule.
computeNetFlowsOrderDict(self)
Renders an ordered list (from worst to best) of the actions
following the net flows ranking rule.
computeNetFlowsRanking(self)
Renders an ordered list (from best to worst) of the actions
following the net flows ranking rule.
computeNetFlowsRankingDict(self)
Renders an ordered list (from best to worst) of the actions
following the net flows ranking rule.
computeODistance(self, op2, comments=False)
renders the squared normalized distance of
two digraph valuations.
 
.. note::
 
     op2 = digraphs of same order as self.
computeOrbit(self, choice, withListing=False)
renders the set of isomorph copies of a choice following
the automorphism of the digraph self
computeOrderCorrelation(self, order, Debug=False)
Renders the ordinal correlation K of a digraph instance
when compared with a given linear order (from worst to best) of its actions
 
K = sum_{x != y} [ min( max(-self.relation(x,y)),other.relation(x,y), max(self.relation(x,y),-other.relation(x,y)) ]
 
K /= sum_{x!=y} [ min(abs(self.relation(x,y),abs(other.relation(x,y)) ]
 
.. note::
 
     Renders a dictionary with the key 'correlation' containing the actual bipolar correlation index and the key 'determination' containing the minimal determination level D of self and the other relation.
 
     D = sum_{x != y} min(abs(self.relation(x,y)),abs(other.relation(x,y)) / n(n-1)
 
     where n is the number of actions considered.
 
     The correlation index with a completely indeterminate relation
     is by convention 0.0 at determination level 0.0 .
 
.. warning::
 
     self must be a normalized outranking digraph instance !
computeOrdinalCorrelation(self, other, MedianCut=False, filterRelation=None, Debug=False)
Renders the bipolar correlation K of a
self.relation when compared
with a given compatible (same actions set)) digraph or
a [-1,1] valued compatible relation (same actions set).
 
If MedianCut=True, the correlation is computed on the median polarized relations.
 
If filterRelation is not None, the correlation is computed on the partial domain corresponding to the determined part of the filter relation.
 
.. warning::
 
     Notice that the 'other' relation and/or the 'filterRelation',
     the case given, must both be normalized, ie [-1,1]-valued !
 
K = sum_{x != y} [ min( max(-self.relation[x][y]),other.relation[x][y]), max(self.relation[x][y],-other.relation[x][y]) ]
 
K /= sum_{x!=y} [ min(abs(self.relation[x][y]),abs(other.relation[x][y])) ]
 
.. note::
 
     Renders a tuple with at position 0 the actual bipolar correlation index
     and in position 1 the minimal determination level D of self and
     the other relation.
 
     D = sum_{x != y} min(abs(self.relation[x][y]),abs(other.relation[x][y])) / n(n-1)
 
     where n is the number of actions considered.
 
     The correlation index with a completely indeterminate relation
     is by convention 0.0 at determination level 0.0 .
computeOrdinalCorrelationMP(self, other, MedianCut=False, Threading=False, nbrOfCPUs=None, startMethod=None, Comments=False, Debug=False)
Multi processing version of the digraphs.computeOrdinalCorrelation() method.
 
.. note::
     The relation filtering and the MedinaCut option are not implemented in the MP version.
computePairwiseClusterComparison(self, K1, K2, Debug=False)
Computes the pairwise cluster comparison credibility vector
from bipolar-valued digraph g. with K1 and K2 disjoint
lists of action keys from g actions disctionary.
Returns the dictionary
{'I': Decimal(),'P+':Decimal(),'P-':Decimal(),'R' :Decimal()}
where one and only one item is strictly positive.
computePreKernels(self)
computing dominant and absorbent preKernels:
    Result in self.dompreKernels and self.abspreKernels
computePreRankingRelation(self, preRanking, Normalized=True, Debug=False)
Renders the bipolar-valued relation obtained from
a given preRanking in decreasing levels (list of lists) result.
computePreorderRelation(self, preorder, Normalized=True, Debug=False)
Renders the bipolar-valued relation obtained from
a given preordering in increasing levels (list of lists) result.
computePrincipalOrder(self, Colwise=False, Comments=False)
Rendesr an ordering from wrost to best of the decision actions.
computePrincipalRanking(self, Colwise=False, Comments=False)
Rendesr a ranking from best to worst of the decision actions.
computePrincipalScores(self, plotFileName=None, Colwise=False, imageType=None, tempDir=None, bgcolor='cornsilk', Comments=False, Debug=False)
Renders a ordered list of the first principal eigenvector of the covariance of the valued outdegrees of self.
 
.. note::
 
   The method, relying on writing and reading temporary files by default in a temporary directory is threading and multiprocessing safe !
   (see Digraph.exportPrincipalImage method)
computePrudentBetaLevel(self, Debug=False)
computes alpha, ie the lowest valuation level, for which the
bipolarly polarised digraph doesn't contain a chordless circuit.
computeRankingByBestChoosing(self, CoDual=False, Debug=False)
Computes a weak preordering of the self.actions by recursive
best choice elagations.
 
Stores in self.rankingByBestChoosing['result'] a list of (P+,bestChoice) tuples
where P+ gives the best choice complement outranking
average valuation via the computePairwiseClusterComparison
method.
 
If self.rankingByBestChoosing['CoDual'] is True, 
the ranking-by-choosing was computed on the codual of self.
computeRankingByBestChoosingRelation(self, rankingByBestChoosing=None, Debug=False)
Renders the bipolar-valued relation obtained from
the self.rankingByBestChoosing result.
computeRankingByChoosing(self, actionsSubset=None, Debug=False, CoDual=False)
Computes a weak preordring of the self.actions by iterating
jointly first and last choice elagations.
 
Stores in self.rankingByChoosing['result'] a list of ((P+,bestChoice),(P-,worstChoice)) pairs
where P+ (resp. P-) gives the best (resp. worst) choice complement outranking
(resp. outranked) average valuation via the computePairwiseClusterComparison
method.
 
If self.rankingByChoosing['CoDual'] is True, the ranking-by-choosing was computed on the codual of self.
computeRankingByChoosingRelation(self, rankingByChoosing=None, actionsSubset=None, Debug=False)
Renders the bipolar-valued relation obtained from
the self.rankingByChoosing result.
computeRankingByLastChoosing(self, CoDual=False, Debug=False)
Computes a weak preordring of the self.actions by iterating
worst choice elagations.
 
Stores in self.rankingByLastChoosing['result'] a list of (P-,worstChoice) pairs
where P- gives the worst choice complement outranked
average valuation via the computePairwiseClusterComparison
method.
 
If self.rankingByChoosing['CoDual'] is True, the ranking-by-last-chossing 
was computed on the codual of self.
computeRankingByLastChoosingRelation(self, rankingByLastChoosing=None, Debug=False)
Renders the bipolar-valued relation obtained from
the self.rankingByLastChoosing result.
computeRankingCorrelation(self, ranking, Debug=False)
Renders the ordinal correlation K of a digraph instance
when compared with a given linear ranking of its actions
 
K = sum_{x != y} [ min( max(-self.relation(x,y)),other.relation(x,y), max(self.relation(x,y),-other.relation(x,y)) ]
 
K /= sum_{x!=y} [ min(abs(self.relation(x,y),abs(other.relation(x,y)) ]
 
.. note::
 
     Renders a tuple with at position 0 the actual bipolar correlation index
     and in position 1 the minimal determination level D of self and
     the other relation.
 
     D = sum_{x != y} min(abs(self.relation(x,y)),abs(other.relation(x,y)) / n(n-1)
 
     where n is the number of actions considered.
 
     The correlation index with a completely indeterminate relation
     is by convention 0.0 at determination level 0.0 .
computeRelationalStructure(self, Debug=False)
Renders the counted decomposition of the valued relations into
the following type of links:
gt '>', eq '=', lt '<', incomp '<>',
leq '<=', geq '>=', indeterm '?'
computeRubisChoice(self, Comments=False, _OldCoca=False, BrokenCocs=True, Threading=False, nbrOfCPUs=1)
Renders self.strictGoodChoices, self.nullChoices
self.strictBadChoices, self.nonRobustChoices.
 
.. warning::
    Changes in site the outranking digraph by
    adding or braking chordless odd outranking circuits.
computeRubyChoice(self, Comments=False, _OldCoca=False)
dummy for computeRubisChoice()
old versions compatibility.
computeShortestPathLengths(self, WeakPaths=False, Comments=False, Debug=False)
Renders a double dictionary with the directed distances, i.e. the shortest path lengths between all self.actions
 
Equals *None* if there does not exist a directed path between two actions.
 
*Source*: Claude Berge, *The Theory of Graphs*, Dover (2001) pp. 119, original in French Dunod (1958)
computeSingletonRanking(self, Comments=False, Debug=False)
Renders the sorted bipolar net determinatation of outrankingness
minus outrankedness credibilities of all singleton choices.
 
res = ((netdet,singleton,dom,absorb)+)
computeSize(self)
Renders the number of validated non reflexive arcs
computeSizeTransitiveClosure(self)
Renders the size of the transitive closure of a digraph.
computeSlaterOrder(self, isProbabilistic=False, seed=None, sampleSize=1000, Debug=False)
Reversed return from computeSlaterRanking method.
computeSlaterRanking(self, isProbabilistic=False, seed=None, sampleSize=1000, Debug=False)
Renders a ranking of the actions with minimal Slater index.
Return a tuple: slaterOrder, slaterIndex
computeSymmetryDegree(self, InPercents=False, Comments=False)
Renders the symmetry degree (Decimal) of the irreflexive part of a digraph.
 
.. note::
 
   Empty and indeterminate digraphs are considered to be symmetric.
computeTopologicalRanking(self, Debug=False)
Mimetic Wrapper of the topologicalSort() method.
computeTransitivityDegree(self, InPercents=False, Comments=False)
Renders the transitivity degree (Decimal) of a digraph.
 
.. note:: 
 
   An empty or indeterminate digraph is considered to be transitive.
computeUnrelatedPairs(self)
Renders a list of more or less unrelated pairs.
computeValuationLevels(self, choice=None, Debug=False)
renders the symmetric closure of the
apparent valuations levels of self
in an increasingly ordered list.
If parameter choice is given, the
computation is limited to the actions
of the choice.
computeValuationPercentages(self, choice, percentiles, withValues=False)
Parameters: choice and list of percentiles.
renders a series of percentages of the characteristics valuation of
the arcs in the digraph.
computeValuationPercentiles(self, choice, percentages, withValues=False)
Parameters: choice and list of percentages.
renders a series of quantiles of the characteristics valuation of
the arcs in the digraph.
computeValuationStatistics(self, Sampling=False, Comments=False)
Renders the mean and variance of the valuation
of the non reflexive pairs.
computeValuedRankingRelation(self, ranking)
Renders the valued relation characteristics compatible 
with the given linar ranking. Discordant charcateristics 
are set to the indeterminate value.
computeWeakCondorcetLosers(self)
Wrapper for weakCondorcetLosers().
computeWeakCondorcetWinners(self)
Wrapper for weakCondorcetWinners().
computeupdown1(self, s, S)
Help method for show_MIS_HB2 method.
fills self.newmisset, self.upmis, self.downmis.
computeupdown2(self, s, S)
Help method for show_MIS_HB1 method.
Fills self.newmisset, self.upmis, self.downmis.
computeupdown2irred(self, s, S)
Help method for show_MIS_HB1 method.
Fills self.newmisset, self.upmis, self.downmis.
condorcetLosers(self)
Renders the set of decision actions x such that
self.relation[x][y] < self.valuationdomain['med']
for all y != x.
condorcetWinners(self)
Renders the set of decision actions x such that
self.relation[x][y] > self.valuationdomain['med']
for all y != x.
contra(self, v)
Parameter: choice.
Renders the negation of a choice v characteristic's vector.
convertRelationToDecimal(self)
Converts the float valued self.relation in a decimal valued one.
convertValuation2Integer(self, InSite=True, Comments=False)
Converts the self.relation valuation to integer values by converting the Decimals to Fractions and multiply by the least commun multiple of the fraction denominators.
 
*Parameters*:
 
    - If *Insite* == False (True by default) the method returns a modified copy of self.relation without altering the original self.relation, otherwise self.relation and self.valuationdomain is modified.
convertValuationToDecimal(self)
Convert the float valuation limits to Decimals.
coveringIndex(self, choice, direction='out')
Renders the covering index of a given choice in a set of objects,
ie the minimum number of choice members that cover each
non selected object.
crispKDistance(self, digraph, Debug=False)
Renders the crisp Kendall distance between two bipolar valued
digraphs.
 
.. warning::
 
     Obsolete! Is replaced by the self.computeBipolarCorrelation(other, MedianCut=True) Digraph method
detectChordlessCircuits(self, Comments=False, Debug=False)
Detects a chordless circuit in a digraph.
Returns a Boolean
detectChordlessPath(self, Pk, n2, Comments=False, Debug=False)
New procedure from Agrum study April 2009
recursive chordless path extraction starting from path
Pk = [n2, ...., n1] and ending in node n2.
Optimized with marking of visited chordless P1s.
determinateness(self, vec, inPercent=True)
Renders the determinateness of a characteristic vector *vec* = 
[(r(x),x),(r(y),y), ...] of length *n* in valuationdomain [Min,Med,Max]:
 
*result* =  sum_x( abs(r(x)-Med) ) / ( n*(Max-Med) )
 
If inPercent, *result* shifted (+1) and reduced (/2) to [0,1] range.
digraph2Graph(self, valuationDomain={'min': -1, 'med': 0, 'max': 1}, Debug=False, ConjunctiveConversion=True)
Convert a Digraph instance to a Graph instance.
dneighbors(self, node)
Renders the set of dominated out-neighbors of a node.
domin(self, choice)
Renders the dominance degree of a choice.
dominantChoices(self, S)
Generates all minimal dominant choices of a bipolar valued digraph.
 
.. note::
 
     Initiate with S = self.actions.copy().
domirred(self, choice)
Renders the crips +irredundance degree of a choice.
domirredval(self, choice, relation)
Renders the valued +irredundance degree of a choice.
domirredx(self, choice, x)
Renders the crips +irredundance degree of node x in a choice.
domkernelrestrict(self, prekernel)
Parameter: dominant prekernel
Renders dominant prekernel restricted relation.
exportGraphViz(self, fileName=None, actionsSubset=None, bestChoice=set(), worstChoice=set(), firstChoice=set(), lastChoice=set(), Comments=True, graphType='png', pictureFormat=None, graphSize='7,7', relation=None, bgcolor='cornsilk')
export GraphViz dot file  for graph drawing filtering.
exportPrincipalImage(self, plotFileName=None, pictureFormat='pdf', bgcolor='cornsilk', fontcolor='red3', fontsize='0.75', Reduced=False, Colwise=False, tempDir='.', Comments=False)
Export as PDF (default) the principal projection of
the valued relation using the three principal eigen vectors.
 
Implemeted picture formats are: 
'pdf' (default), 'png', 'jpeg' and 'xfig'.
 
The background color is set by default to 'cornsilk'. 
 
Font size and color are set by default to 'red3', resp. '0.75'. 
 
When *Reduced==True*, the valued relation characeteristics are centered and reduced.
 
When *Colwise==True*, the column vectors of the adjacency table are used for the principal projection, otherwise the rows (default) are used. Has no incidence when the *Digraph* instance *self*  is symmetric. 
 
.. warning::
 
    The method, writing and reading temporary files: 
    tempCol.r and rotationCol.csv, resp. tempRow.r and rotationRow.csv,
    by default in the working directory (./),
    is hence not safe for multiprocessing programs, unless a
    temporary directory *tempDir* is provided.
flatChoice(self, ch, Debug=False)
Converts set or list ch recursively to a flat list of items.
forcedBestSingleChoice(self)
Renders the set of most determined outranking singletons in self.
gammaSets(self)
Renders the dictionary of neighborhoods {node: (dx,ax)}
with set *dx* gathering the dominated, and set *ax* gathering
the absorbed neighborhood.
generateAbsPreKernels(self)
Generate all absorbent prekernels from independent choices generator.
generateDomPreKernels(self)
Generate all dominant prekernels from independent choices generator.
htmlChoiceVector(self, ch, ChoiceVector=True, choiceType='good')
Show procedure for annotated bipolar choices.
inDegrees(self)
renders the median cut indegrees
inDegreesDistribution(self)
Renders the distribution of indegrees.
independentChoices(self, U)
Generator for all independent choices with neighborhoods of a bipolar valued digraph:
 
.. note::
 
       * Initiate with U = self.singletons().
       * Yields [(independent choice, domnb, absnb, indnb)].
inner_prod(self, v1, v2)
Parameters: two choice characteristic vectors
Renders the inner product of two characteristic vetors.
intstab(self, choice)
Computes the independence degree of a choice.
irreflex(self, mat)
Puts diagonal entries of mat to valuationdomain['min']
isAsymmetricIndeterminate(self, Debug=False)
Checks the self.relation for assymmetric indeterminateness!!
 
.. warning::
 
    The reflexive links are ignored !!
isComplete(self, Debug=False)
checks the completeness property of self.relation by checking
for the absence of a link between two actions!!
 
.. warning::
 
    The reflexive links are ignored !!
isCyclic(self, Debug=False)
checks the cyclicity of self.relation by checking
for a reflexive loop in its transitive closure-
 
.. warning::
 
     self.relation is supposed to be irreflexive !
isIntegerValued(self, Debug=False)
Checks whether the decimal valuation of self is integer-valued
be using the as_integer_ratio() method of a Decimal 
giving a tuple (numerator,denominator). If denominator == 1, the
number is an integer.
isOutrankingDigraph(self, Comments=True, Debug=False)
Checks the outranking digraph characteristic condition (3.3).
 
relation[x][y] + relation[y][x)[y] >= 0.0
 
.. warning::
 
    The reflexive links are ignored and the valuation must be bipolar !!
isStrictOutrankingDigraph(self, Comments=True, Debug=False)
Checks the strict outranking digraph characteristic condition (3.1).
 
-(relation[x][y] + relation[y][x]) <= 0.0 , x != y
 
.. warning::
 
    The reflexive links are ignored and the valuation must be bipolar !!
isSymmetric(self, Comments=False)
True if symmetry degree == 1.0.
isTransitive(self, Comments=False)
True if transitivity degree == 1.0.
isWeaklyComplete(self, Debug=False)
checks the weakly completeness property of self.relation by checking
for the absence of a link between two actions!!
 
.. warning::
 
    The reflexive links are ignored !!
iterateRankingByChoosing(self, Odd=False, CoDual=False, Comments=True, Debug=False, Limited=None)
Renders a ranking by choosing result when progressively eliminating
all chordless (odd only) circuits with rising valuation cut levels.
 
Parameters
    CoDual = False (default)/True
    Limited = proportion (in [0,1]) * (max - med) valuationdomain
kChoices(self, A, k)
Renders all choices of length k from set A
matmult2(self, m, v)
Parameters: digraph relation and choice characteristic vector
matrix multiply vector by inner production
meanDegree(self)
Renders the mean degree of self.
!!! self.size must be set previously !!!
meanLength(self, Oriented=False)
Renders the (by default non-oriented) mean neighbourhoor depth of self.
!!! self.order must be set previously !!!
minimalChoices(self, S)
Generates all dominant or absorbent choices of a bipolar
valued digraph.
 
.. note:
 
   * Initiate with S = (actions, dict of dominant or absorbent closed neighborhoods)
   * See showMinDom and showMinAbs methods.
minimalValuationLevelForCircuitsElimination(self, Odd=True, Debug=False, Comments=False)
renders the minimal valuation level <lambda> that eliminates all
self.circuitsList stored odd chordless circuits from self.
 
.. warning::
 
    The <lambda> level polarised may still contain newly appearing chordless odd circuits !
neighbourhoodCollection(self, Oriented=False, Potential=False)
Renders the neighbourhood.
neighbourhoodDepthDistribution(self, Oriented=False)
Renders the distribtion of neighbourhood depths.
notGammaSets(self)
Renders the dictionary of neighborhoods {node: (dx,ax)}
with set *dx* gathering the not dominated, and set *ax* gathering
the not absorbed neighborhood.
notaneighbors(self, node)
Renders the set of absorbed not in-neighbors of a node.
notdneighbors(self, node)
Renders the set of not dominated out-neighbors of a node.
outDegrees(self)
renders the median cut outdegrees
outDegreesDistribution(self)
Renders the distribution of outdegrees.
plusirredundant(self, U)
Generates all +irredundant choices of a digraph.
powerset(self, U)
Generates all subsets of a set.
readPerrinMisset(self, file='curd.dat')
read method for 0-1-char-coded MISs by default from the perrinMIS.c curd.dat result file.
readabsvector(self, x, relation)
Parameter: action x
absorbent in vector.
readdomvector(self, x, relation)
Parameter: action x
dominant out vector.
recodeValuation(self, newMin=-1.0, newMax=1.0, ndigits=4, Debug=False)
Recodes the characteristic valuation domain according
to the parameters given. 
 
*ndigits* indicates the number of decimal digits of the valuation.
relationFct(self, x, y)
wrapper for self.relation dictionary access to ensure interoperability
with the sparse and big outranking digraph implementation model.
save(self, fileName='tempdigraph', option=None, DecimalValuation=True, decDigits=2)
Persistent storage of a Digraph class instance in the form of
a python source code file
saveCSV(self, fileName='tempdigraph', Normalized=False, Dual=False, Converse=False, Diagonal=False, Debug=False)
Persistent storage of a Digraph class instance in the form of
a csv file.
saveXMCDA2(self, fileName='temp', fileExt='xmcda2', Comments=True, relationName='R', relationType='binary', category='random', subcategory='valued', author='digraphs Module (RB)', reference='saved from Python', valuationType='standard', digits=2, servingD3=False)
save digraph in XMCDA 2.0 format. Deprecated now.
savedre(self, fileName='temp')
save digraph in nauty format.
sharp(self, x, y)
Paramaters: choice characteristic values.
Renders the sharpest of two characteristic values x and y.
sharpvec(self, v, w)
Paramaters: choice characteristic vectors.
Renders the sharpest of two characteristic vectors v and w.
showActions(self)
presentation methods for digraphs actions
showAll(self)
Detailed show method for genuine digraphs.
showAttributes(self)
Prints out the attributes of self.
showAutomorphismGenerators(self)
Renders the generators of the automorphism group.
showBadChoices(self, Recompute=True)
Characteristic values for potentially bad choices.
showBestChoiceRecommendation(self, Verbose=False, Comments=True, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True)
Shows the RuBis best choice recommendation.
 
.. note::
 
    Computes by default the Rubis best choice recommendation on the corresponding strict (codual) outranking digraph.
 
    By default, with BrokenCocs=True, we brake all chordless circuits at their weakest determined ( abs(r(x>y)) + abs(r(y>x)) ) link.
 
    When BrokenCocs=False we proceed like follows:
 
    In case of chordless circuits, if supporting arcs are more credible
    than the reversed negating arcs, we collapse the circuits into hyper nodes.
    Inversely,  if supporting arcs are not more credible than the reversed negating arcs,
    we brake the circuits on their weakest arc.
 
Usage example:
 
>>> from outrankingDigraphs import *
>>> t = Random3ObjectivesPerformanceTableau(seed=5)
>>> g = BipolarOutrankingDigraph(t)
>>> g.showBestChoiceRecommendation()
***********************
RuBis Best Choice Recommendation (BCR)
(in decreasing order of determinateness)   
Credibility domain:  [-100.0, 100.0]
=== >> potential first choices
* choice              : ['a04', 'a14', 'a19', 'a20']
   independence        : 1.19
   dominance           : 4.76
   absorbency          : -59.52
   covering (%)        : 75.00
   determinateness (%) : 57.86
   - most credible action(s) = { 'a14': 23.81, 'a19': 11.90, 'a04': 2.38, 'a20': 1.19, }  
=== >> potential last choices 
* choice              : ['a03', 'a12', 'a17']
  independence        : 4.76
  dominance           : -76.19
  absorbency          : 4.76
  covering (%)        : 0.00
  determinateness (%) : 65.39
  - most credible action(s) = { 'a03': 38.10, 'a12': 13.10, 'a17': 4.76, }
Execution time: 0.024 seconds
*****************************
showChoiceVector(self, ch, choiceType='good', ChoiceVector=True)
Show procedure for annotated bipolar choices.
showChordlessCircuits(self, Recompute=False)
Show method for chordless circuits observed in a Digraph instance.
 
If previous computation is required, stores the detected circuits in self.circuitsList attribute.
showComponents(self)
Shows the list of connected components of the digraph instance.
showCorrelation(self, corr=None, ndigits=3)
Renders the valued ordinal correlation index, the crisp Kendall tau index and their epistemic determination degree.
showFirstChoiceRecommendation(self, Verbose=False, Comments=True, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True)
Shows the RuBis first choice recommendation.
 
.. note::
 
    Computes by default the Rubis first choice recommendation on the corresponding strict (codual) outranking digraph.
 
    By default, with BrokenCocs=True, we brake all chordless circuits at their weakest determined ( abs(r(x>y)) + abs(r(y>x)) ) link.
 
    When BrokenCocs=False we proceed like follows:
 
    In case of chordless circuits, if supporting arcs are more credible
    than the reversed negating arcs, we collapse the circuits into hyper nodes.
    Inversely,  if supporting arcs are not more credible than the reversed negating arcs,
    we brake the circuits on their weakest arc.
 
Usage example:
 
>>> from outrankingDigraphs import *
>>> t = Random3ObjectivesPerformanceTableau(seed=5)
>>> g = BipolarOutrankingDigraph(t)
>>> g.showFirstChoiceRecommendation()
***********************
RuBis First Choice Recommendation (BCR)
(in decreasing order of determinateness)   
Credibility domain:  [-100.0, 100.0]
=== >> potential first choices
* choice              : ['a04', 'a14', 'a19', 'a20']
   independence        : 1.19
   dominance           : 4.76
   absorbency          : -59.52
   covering (%)        : 75.00
   determinateness (%) : 57.86
   - most credible action(s) = { 'a14': 23.81, 'a19': 11.90, 'a04': 2.38, 'a20': 1.19, }  
=== >> potential last choices 
* choice              : ['a03', 'a12', 'a17']
  independence        : 4.76
  dominance           : -76.19
  absorbency          : 4.76
  covering (%)        : 0.00
  determinateness (%) : 65.39
  - most credible action(s) = { 'a03': 38.10, 'a12': 13.10, 'a17': 4.76, }
Execution time: 0.024 seconds
*****************************
showGoodChoices(self, Recompute=True)
Characteristic values for potentially good choices.
showHTMLBestChoiceRecommendation(self, pageTitle=None, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True, htmlFileName=None)
showHTMLRelationHeatmap(self, actionsList=None, rankingRule='NetFlows', colorLevels=7, tableTitle='Relation Heatmap', relationName='r(x S y)', ndigits=2, fromIndex=None, toIndex=None, htmlFileName=None)
Launches a browser window with the colored relation map of self.
 
See corresponding :py:class:`~digraphs.Digraph.showHTMLRelationMap` method.
 
The *colorLevels* parameter may be set to 3, 5, 7 (default) or 9.
 
When the *actionsList* parameter is *None* (default), the digraphs actions list may be ranked with the *rankingRule* parameter set to the 'Copeland' (default) or to the 'Netlows' ranking rule.
 
When the *htmlFileName* parameter is set to a string value 'xxx', a html file named 'xxx.html' will be generated in the current working directory. Otherwise, a temporary file named 'tmp*.html' will be generated there.
 
Example::
 
    >>> from outrankingDigraphs import *
    >>> t = RandomCBPerformanceTableau(numberOfActions=25,seed=1)
    >>> g = BipolarOutrankingDigraph(t,ndigits=2)
    >>> gcd = ~(-g)  # strict outranking relation
    >>> gcd.showHTMLRelationHeatmap(colorLevels=7,ndigits=2)
    
.. image:: relationHeatmap.png
   :alt: Browser view of a relation map
   :width: 600 px
   :align: center
showHTMLRelationMap(self, actionsList=None, rankingRule='Copeland', Colored=True, tableTitle='Relation Map', relationName='r(x S y)', symbols=['+', '&middot;', '&nbsp;', '&#150;', '&#151'], fromIndex=None, toIndex=None, htmlFileName=None)
Launches a browser window with the colored relation map of self.
See corresponding Digraph.showRelationMap() method.
 
When *htmlFileName* parameter is set to a string value, a html file
with that name will be stored in the current working directory.
 
By default, a temporary file named: tmp*.html will be generated
instead in the current working directory.
 
Example::
 
    >>> from outrankingDigraphs import *
    >>> t = RandomCBPerformanceTableau(numberOfActions=25,seed=1)
    >>> g = BipolarOutrankingDigraph(t,Normalized=True)
    >>> gcd = ~(-g)  # strict outranking relation
    >>> gcd.showHTMLRelationMap(rankingRule="NetFlows")
    
.. image:: relationMap.png
   :alt: Browser view of a relation map
   :width: 600 px
   :align: center
showHTMLRelationTable(self, actionsList=None, relation=None, IntegerValues=False, ndigits=2, Colored=True, tableTitle='Valued Adjacency Matrix', relationName='r(x S y)', ReflexiveTerms=False, htmlFileName=None, fromIndex=None, toIndex=None)
Launches a browser window with the colored relation table of self.
showMIS(self, withListing=True)
Prints all maximal independent choices:
    Result in self.misset.
showMIS_AH(self, withListing=True)
Prints all MIS using the Hertz method.
 
Result saved in self.hertzmisset.
showMIS_HB2(self, withListing=True)
Prints all MIS using the Hertz-Bisdorff method.
 
Result saved in self.newmisset.
showMIS_RB(self, withListing=True)
Prints all MIS using the Bisdorff method.
 
Result saved in self.newmisset.
showMIS_UD(self, withListing=True)
Prints all MIS using the Hertz-Bisdorff method.
 
Result saved in self.newmisset.
showMaxAbsIrred(self, withListing=True)
Computing maximal -irredundant choices:
    Result in self.absirset.
showMaxDomIrred(self, withListing=True)
Computing maximal +irredundant choices:
   Result in self.domirset.
showMinAbs(self, withListing=True)
Prints minimal absorbent choices:
    Result in self.absset.
showMinDom(self, withListing=True)
Prints all minimal dominant choices:
    Result in self.domset.
showNeighborhoods(self)
Lists the gamma and the notGamma function of self.
showOrbits(self, InChoices, withListing=True)
Prints the orbits of Choices along the automorphisms of
the Digraph instance.
 
Example Python session for computing the non isomorphic MISs from the 12-cycle graph:
 
>>> from digraphs import *
>>> c12 = CirculantDigraph(order=12,circulants=[1,-1])
>>> c12.automorphismGenerators()
...
  Permutations
  {'1': '1', '2': '12', '3': '11', '4': '10', '5': 
   '9', '6': '8', '7': '7', '8': '6', '9': '5', '10': 
   '4', '11': '3', '12': '2'}
  {'1': '2', '2': '1', '3': '12', '4': '11', '5': '10', 
   '6': '9', '7': '8', '8': '7', '9': '6', '10': '5', 
   '11': '4', '12': '3'}
  Reflections {}
>>> print('grpsize = ', c12.automorphismGroupSize)
  grpsize = 24
>>> c12.showMIS(withListing=False)
  *---  Maximal independent choices ---*
  number of solutions:  29
  cardinality distribution
  card.:  [0, 1, 2, 3, 4,  5,  6, 7, 8, 9, 10, 11, 12]
  freq.:  [0, 0, 0, 0, 3, 24,  2, 0, 0, 0,  0,  0,  0]
  Results in c12.misset
>>> c12.showOrbits(c12.misset,withListing=False)
...
  *---- Global result ----
  Number of MIS:  29
  Number of orbits :  4
  Labelled representatives:
  1: ['2','4','6','8','10','12']
  2: ['2','5','8','11']
  3: ['2','4','6','9','11']
  4: ['1','4','7','9','11']
  Symmetry vector
  stabilizer size: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, ...]
  frequency      : [0, 2, 0, 0, 0, 0, 0, 1, 0,  0,  0,  1, ...]
 
*Figure*: The symmetry axes of the non isomorphic MISs of the 12-cycle:
 
.. image:: c12.png
   :width: 400 px
   :align: center
   :alt: The 4 non isomorphic MIS of the 12-cycle graph
 
*Reference*: R. Bisdorff and J.L. Marichal (2008). Counting non-isomorphic maximal independent sets of the n-cycle graph. *Journal of Integer Sequences*, Vol. 11 Article 08.5.7 (`openly accessible here <https://www.cs.uwaterloo.ca/journals/JIS/VOL11/Marichal/marichal.html>`_)
showOrbitsFromFile(self, InFile, withListing=True)
Prints the orbits of Choices along the automorphisms of
the digraph self by reading in the 0-1 misset file format.
See the :py:func:`digraphs.Digraph.readPerrinMisset` method.
showPreKernels(self, withListing=True)
Printing dominant and absorbent preKernels:
    Result in self.dompreKernels and self.abspreKernels
showRankingByBestChoosing(self, rankingByBestChoosing=None)
A show method for self.rankinByBestChoosing result.
 
.. warning::
 
     The self.computeRankingByBestChoosing(CoDual=False/True) method instantiating the self.rankingByBestChoosing slot is pre-required !
showRankingByChoosing(self, rankingByChoosing=None, WithCoverCredibility=False)
A show method for self.rankinByChoosing result.
 
When parameter *WithCoverCredibility* is set to True, the credibility of outranking, respectively being outranked is indicated at each selection step. 
 
.. warning::
 
     The self.computeRankingByChoosing(CoDual=False/True) method instantiating the self.rankingByChoosing slot is pre-required !
showRankingByLastChoosing(self, rankingByLastChoosing=None, Debug=None)
A show method for self.rankinByChoosing result.
 
.. warning::
 
     The self.computeRankingByLastChoosing(CoDual=False/True) method instantiating the self.rankingByChoosing slot is pre-required !
showRelation(self)
prints the relation valuation in ##.## format.
showRelationMap(self, symbols=None, rankingRule='Copeland', fromIndex=None, toIndex=None, actionsList=None)
Prints on the console, in text map format, the location of
certainly validated and certainly invalidated outranking situations.
 
By default, symbols = {'max':'┬','positive': '+', 'median': ' ',
                       'negative': '-', 'min': '┴'}
 
The default ordering of the output is following the Copeland ranking rule
from best to worst actions. Further available ranking rule is the 'NetFlows' net flows rule.
 
 
Example::
 
    >>> from outrankingDigraphs import *
    >>> t = RandomCBPerformanceTableau(numberOfActions=25,seed=1)
    >>> g = BipolarOutrankingDigraph(t,Normalized=True)
    >>> gcd = ~(-g)  # strict outranking relation
    >>> gcd.showRelationMap(rankingRule="NetFlows")
     -   ++++++++  +++++┬+┬┬+
    - -   + +++++ ++┬+┬+++┬++
    ┴+  ┴ + ++  ++++┬+┬┬++┬++
    -   ++ - ++++-++++++┬++┬+
       - - - ++- ┬- + -+┬+-┬┬
    -----  -      -┬┬┬-+  -┬┬
    ----    --+-+++++++++++++
    -- --+- --++ ++ +++-┬+-┬┬
    ----  -  -+-- ++--+++++ +
    ----- ++- --- +---++++┬ +
    -- -- ---+ -++-+++-+ +-++
    -- --┴---+  + +-++-+ -  +
    ---- ┴---+-- ++--++++ - +
      --┴┴--  --- -  --+ --┬┬
     ---------+--+ ----- +-┬┬
    -┴---┴- ---+- + ---+++┬ +
    -┴┴--┴---+--- ++ -++--+++
    -----┴--- ---+-+- ++---+ 
    -┴┴--------------- --++┬ 
    --┴---------------- --+┬ 
    ┴--┴┴ -┴--┴┴-┴ --++  ++-+
    ----┴┴--------------- -  
    ┴┴┴----+-┴+┴---┴-+---+ ┴+
    ┴┴-┴┴┴-┴- - -┴┴---┴┴+ ┬ -
    ----┴┴-┴-----┴┴---  - -- 
    Ranking rule: NetFlows
    >>>
showRelationTable(self, Sorted=True, rankingRule=None, IntegerValues=False, actionsSubset=None, relation=None, ndigits=2, ReflexiveTerms=True, fromIndex=None, toIndex=None)
Prints the relation valuation in actions X actions table format.
Copeland and NetFlows rankings my be used.
showRubisBestChoiceRecommendation(self, **kwargs)
Dummy for backward portable showBestChoiceRecommendation().
showRubyChoice(self, Verbose=False, Comments=True, _OldCoca=True)
Dummy for showBestChoiceRecommendation()
needed for older versions compatibility.
showShort(self)
concise presentation method for genuine digraphs.
showSingletonRanking(self, Comments=True, Debug=False)
Calls self.computeSingletonRanking(comments=True,Debug = False).
Renders and prints the sorted bipolar net determinatation of outrankingness
minus outrankedness credibilities of all singleton choices.
 
res = ((netdet,sigleton,dom,absorb)+)
showStatistics(self)
Computes digraph statistics like order, size and arc-density.
showdre(self)
Shows relation in nauty format.
singletons(self)
list of singletons and neighborhoods
[(singx1, +nx1, -nx1, not(+nx1 or -nx1)),.... ]
sizeSubGraph(self, choice)
Output: (size, undeterm,arcDensity).
Renders the arc density of the induced subgraph.
strongComponents(self, setPotential=False)
Renders the set of strong components of self.
symDegreesDistribution(self)
Renders the distribution of symmetric degrees.
topologicalSort(self, Debug=False)
If self is acyclic, adds topological sort number to each node of self
and renders ordered list of nodes. Otherwise renders None.
Source: M. Golumbic Algorithmic Graph heory and Perfect Graphs,
Annals Of Discrete Mathematics 57 2nd Ed. , Elsevier 2004, Algorithm 2.4 p.44.
weakAneighbors(self, node)
Renders the set of absorbed in-neighbors of a node.
weakCondorcetLosers(self)
Renders the set of decision actions x such that
self.relation[x][y] <= self.valuationdomain['med']
for all y != x.
weakCondorcetWinners(self)
Renders the set of decision actions x such that
self.relation[x][y] >= self.valuationdomain['med']
for all y != x.
weakDneighbors(self, node)
Renders the set of dominated out-neighbors of a node.
weakGammaSets(self)
Renders the dictionary of neighborhoods {node: (dx,ax)}
zoomValuation(self, zoomFactor=1.0)
Zooms in or out, depending on the value of the zoomFactor provided,
the bipolar valuation of a digraph.

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class DualDigraph(Digraph)
    DualDigraph(other)
 
Instantiates the dual ( = negated valuation) Digraph object from a deep copy of a given other Digraph instance.
 
The relation constructor returns the dual (negation) of
self.relation with generic formula: 
 
        relationOut[a][b] = Max - self.relation[a][b] + Min, where
        Max (resp. Min) equals valuation maximum (resp. minimum).
 
.. note::
 
    In a bipolar valuation, the dual operator corresponds to a simple changing of signs.
 
 
Method resolution order:
DualDigraph
Digraph
builtins.object

Methods defined here:
__init__(self, other)
Initialize self.  See help(type(self)) for accurate signature.

Methods inherited from Digraph:
MISgen(self, S, I)
generator of maximal independent choices (voir Byskov 2004):
    * S ::= remaining nodes;
    * I ::= current independent choice
 
.. note::
 
        Inititalize: self.MISgen(self.actions.copy(),set())
__invert__(self)
Make the inverting operator ~self available for Digraph instances. 
 
Returns a ConverseDigraph instance of self.
__neg__(self)
Make the negation operator -self available for Digraph instances. 
 
Returns a DualDigraph instance of self.
__repr__(self)
Default presentation method for Digraph instances.
absirred(self, choice)
Renders the crips -irredundance degree of a choice.
absirredundant(self, U)
Generates all -irredundant choices of a digraph.
absirredval(self, choice, relation)
Renders the valued -irredundance degree of a choice.
absirredx(self, choice, x)
Computes the crips -irredundance degree of node x in a choice.
abskernelrestrict(self, prekernel)
Parameter: prekernel
Renders absorbent prekernel restricted relation.
absorb(self, choice)
Renders the absorbency degree of a choice.
absorbentChoices(self, S)
Generates all minimal absorbent choices of a bipolar valued digraph.
addValuationAttribute(self)
Adds the numpy valuation attribute
agglomerationDistribution(self)
Output: aggloCoeffDistribution, meanCoeff
Renders the distribution of agglomeration coefficients.
aneighbors(self, node)
Renders the set of absorbed in-neighbors of a node.
automorphismGenerators(self)
Adds automorphism group generators to the digraph instance.
 
.. note::
 
    Dependency: Uses the dreadnaut command from the nauty software package. See https://www3.cs.stonybrook.edu/~algorith/implement/nauty/implement.shtml
 
    On Ubuntu Linux:
      ...$ sudo apt-get install nauty
averageCoveringIndex(self, choice, direction='out')
Renders the average covering index of a given choice in a set of objects,
ie the average number of choice members that cover each
non selected object.
bipolarKCorrelation(self, digraph, Debug=False)
Renders the bipolar Kendall correlation between two bipolar valued
digraphs computed from the average valuation of the
XORDigraph(self,digraph) instance.
 
.. warning::
 
     Obsolete! Is replaced by the self.computeBipolarCorrelation(other) Digraph method
bipolarKDistance(self, digraph, Debug=False)
Renders the bipolar crisp Kendall distance between two bipolar valued
digraphs.
 
.. warning::
 
     Obsolete! Is replaced by the self.computeBipolarCorrelation(other, MedianCut=True) Digraph method
chordlessPaths(self, Pk, n2, Odd=False, Comments=False, Debug=False)
New procedure from Agrum study April 2009
recursive chordless path extraction starting from path
Pk = [n2, ...., n1] and ending in node n2.
Optimized with marking of visited chordless P1s.
circuitAverageCredibility(self, circ)
Renders the average linking credibility of a Chordless Circuit.
circuitCredibilities(self, circuit, Debug=False)
Renders the average linking credibilities and the minimal link of a Chordless Circuit.
circuitMaxCredibility(self, circ)
Renders the maximal linking credibility of a Chordless Circuit.
circuitMinCredibility(self, circ)
Renders the minimal linking credibility of a Chordless Circuit.
closeSymmetric(self, InSite=True)
Produces the symmetric closure of self.relation.
closeTransitive(self, Reverse=False, InSite=True, Comments=False)
Produces the transitive closure of self.relation
 
*Parameters*:
 
    - If *Reverse* == True (False default) all transitive links are dropped, otherwise all transitive links are closed with min[r(x,y),r(y,z)];
    - If *Insite* == False (True by default) the methods return a modified copy of self.relation without altering the original self.relation, otherwise self.relation is modified.
components(self)
Renders the list of connected components.
computeAllDensities(self, choice=None)
parameter: choice in self
renders six densitiy parameters:
arc density, double arc density,
single arc density, strict single arc density,
absence arc density, strict absence arc densitiy.
computeArrowRaynaudOrder(self)
Renders a linear ordering from worst to best of the actions following Arrow&Raynaud's rule.
computeArrowRaynaudRanking(self)
renders a linear ranking from best to worst of the actions following Arrow&Raynaud's rule.
computeAverageValuation(self)
Computes the bipolar average correlation between
self and the crisp complete digraph of same order
of the irreflexive and determined arcs of the digraph
computeBadChoices(self, Comments=False)
Computes characteristic values for potentially bad choices.
 
.. note::
 
     Returns a tuple with following content:
 
     [(0)-determ,(1)degirred,(2)degi,(3)degd,(4)dega,(5)str(choice),(6)absvec]
computeBadPirlotChoices(self, Comments=False)
Characteristic values for potentially bad choices
using the Pirlot's fixpoint algorithm.
computeBestChoiceRecommendation(self, Verbose=False, Comments=False, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True)
Sets self.bestChoice, self.bestChoiceData, self.worstChoice and self.worstChoiceData
with the showBestChoiceRecommendation method.
 
First and last choices data is the following:
[(0)-determ,(1)degirred,(2)degi,(3)degd,(4)dega,(5)str(choice),(6)domvec,(7)cover]
 
self.bestChoice = self.bestChoiceData[5]
self.worstChoice = self.worstChoiceData[5]
computeBipolarCorrelation(self, other, MedianCut=False, filterRelation=None, Debug=False)
obsolete: dummy replacement for Digraph.computeOrdinalCorrelation method
computeChordlessCircuits(self, Odd=False, Comments=False, Debug=False)
Renders the set of all chordless circuits detected in a digraph.
Result is stored in <self.circuitsList>
holding a possibly empty list of tuples with at position 0 the
list of adjacent actions of the circuit and at position 1
the set of actions in the stored circuit.
 
When *Odd* is True, only chordless circuits with an odd length
are collected.
computeChordlessCircuitsMP(self, Odd=False, Threading=False, nbrOfCPUs=None, startMethod=None, Comments=False, Debug=False)
Multiprocessing version of computeChordlessCircuits().
 
Renders the set of all chordless odd circuits detected in a digraph.
Result (possible empty list) stored in <self.circuitsList>
holding a possibly empty list tuples with at position 0 the
list of adjacent actions of the circuit and at position 1
the set of actions in the stored circuit.
Inspired by Dias, Castonguay, Longo, Jradi, Algorithmica (2015).
 
Returns a possibly empty list of tuples (circuit,frozenset(circuit)).
 
If Odd == True, only circuits of odd length are retained in the result.
computeCoSize(self)
Renders the number of non validated non reflexive arcs
computeConcentrationIndex(self, X, N)
Renders the Gini concentration index of the X serie.
N contains the partial frequencies.
Based on the triangle summation formula.
computeConcentrationIndexTrapez(self, X, N)
Renders the Gini concentration index of the X serie.
N contains the partial frequencies.
Based on the triangles summation formula.
computeCondorcetLosers(self)
Wrapper for condorcetLosers().
computeCondorcetWinners(self)
Wrapper for condorcetWinners().
computeCopelandOrder(self)
renders a linear ordering from worst to best of the actions following Arrow&Raynaud's rule.
computeCopelandRanking(self)
renders a linear ranking from best to worst of the actions following Arrow&Raynaud's rule.
computeCutLevelDensities(self, choice, level)
parameter: choice in self, robustness level
renders three robust densitiy parameters:
robust double arc density,
robust single arc density,
robust absence arc densitiy.
computeDensities(self, choice)
parameter: choice in self
renders the four densitiy parameters:
arc density, double arc density, single arc density, absence arc density.
computeDeterminateness(self, InPercents=False)
Computes the Kendalll distance of self
with the all median-valued indeterminate digraph of order n.
 
Return the average determination of the irreflexive part of the digraph.
 
*determination* = sum_(x,y) { abs[ r(xRy) - Med ] } / n(n-1)
 
If *InPercents* is True, returns the average determination in percentage of
(Max - Med) difference.
 
>>> from outrankingDigraphs import BipolarOutrankingDigraph
>>> from randomPerfTabs import Random3ObjectivesPerformanceTableau
>>> t = Random3ObjectivesPerformanceTableau(numberOfActions=7,numberOfCriteria=7,seed=101)
>>> g = BipolarOutrankingDigraph(t,Normalized=True)
>>> g
*------- Object instance description ------*
Instance class      : BipolarOutrankingDigraph
Instance name       : rel_random3ObjectivesPerfTab
Actions             : 7
Criteria            : 7
Size                : 27
Determinateness (%) : 65.67
Valuation domain    : [-1.00;1.00]
>>> print(g.computeDeterminateness())
0.3134920634920634920634920638
>>> print(g.computeDeterminateness(InPercents=True))
65.67460317460317460317460320
>>> g.recodeValuation(0,1)
>>> g
*------- Object instance description ------*
Instance class      : BipolarOutrankingDigraph
Instance name       : rel_random3ObjectivesPerfTab
Actions             : 7
Criteria            : 7
Size                : 27
Determinateness (%) : 65.67
Valuation domain    : [0.00;1.00]
>>> print(g.computeDeterminateness())
0.1567460317460317460317460318
>>> print(g.computeDeterminateness(InPercents=True))
65.67460317460317460317460320
computeDiameter(self, Oriented=True)
Renders the (by default oriented) diameter of the digraph instance
computeDigraphCentres(self, WeakDistances=False, Comments=False)
The centers of a digraph are the nodes with finite minimal shortes path lengths.
 
The maximal neighborhood distances are stored in *self.maximalNeighborhoodDistances*.
 
The corresponding digraph radius and diameter are stored respectively  in *self.radius* and *self.diameter*.
 
With *Comments* = True, all these results are printed out.
 
*Source*: Claude Berge, *The Theory of Graphs*, Dover (2001) pp. 119, original in French Dunod (1958)
computeDynamicProgrammingStages(self, source, sink, Debug=False)
Renders the discrete stages of the optimal substructure for
dynamic pogramming digrahs from a given source node 
to a given sink sink node.
 
Returns a list of list of action identifyers.
computeGoodChoiceVector(self, ker, Comments=False)
| Computing Characteristic values for dominant pre-kernels
| using the von Neumann dual fixoint equation
computeGoodChoices(self, Comments=False)
Computes characteristic values for potentially good choices.
 
..note::
 
     Return a tuple with following content:
 
     [(0)-determ,(1)degirred,(2)degi,(3)degd,(4)dega,(5)str(choice),(6)domvec,(7)cover]
computeGoodPirlotChoices(self, Comments=False)
Characteristic values for potentially good choices
using the Pirlot fixpoint algorithm.
computeIncomparabilityDegree(self, InPercents=False, Comments=False)
Renders the incomparability degree (Decimal), i.e. the relative number of symmetric indeterminate relations of the irreflexive part of a digraph.
computeKemenyIndex(self, otherRelation)
renders the Kemeny index of the self.relation
compared with a given crisp valued relation of a compatible
other digraph (same nodes or actions).
computeKemenyOrder(self, orderLimit=7, Debug=False)
Renders a ordering from worst to best of the actions with maximal Kemeny index.
Return a tuple: kemenyOrder (from worst to best), kemenyIndex
computeKemenyRanking(self, orderLimit=7, seed=None, sampleSize=1000, Debug=False)
Renders a ranking from best to worst of the actions with maximal Kemeny index.
 
.. note::
 
     Returns a tuple: kemenyRanking (from best to worst), kemenyIndex.
computeKernelVector(self, kernel, Initial=True, Comments=False)
| Computing Characteristic values for dominant pre-kernels
| using the von Neumann dual fixpoint equation
computeKohlerOrder(self)
Renders an ordering (worst to best) of the actions following Kohler's rule.
computeKohlerRanking(self)
Renders a ranking (best to worst) of the actions following Kohler's rule.
computeMaxHoleSize(self, Comments=False)
Renders the length of the largest chordless cycle
in the corresponding disjunctive undirected graph.
computeMeanInDegree(self)
Renders the mean indegree of self.
!!! self.size must be set previously !!!
computeMeanOutDegree(self)
Renders the mean degree of self.
!!! self.size must be set previously !!!
computeMeanSymDegree(self)
Renders the mean degree of self.
!!! self.size must be set previously !!!
computeMedianOutDegree(self)
Renders the median outdegree of self.
!!! self.size must be set previously !!!
computeMedianSymDegree(self)
Renders the median symmetric degree of self.
!!! self.size must be set previously !!!
computeMoreOrLessUnrelatedPairs(self)
Renders a list of more or less unrelated pairs.
computeNetFlowsOrder(self)
Renders an ordered list (from best to worst) of the actions
following the net flows ranking rule.
computeNetFlowsOrderDict(self)
Renders an ordered list (from worst to best) of the actions
following the net flows ranking rule.
computeNetFlowsRanking(self)
Renders an ordered list (from best to worst) of the actions
following the net flows ranking rule.
computeNetFlowsRankingDict(self)
Renders an ordered list (from best to worst) of the actions
following the net flows ranking rule.
computeODistance(self, op2, comments=False)
renders the squared normalized distance of
two digraph valuations.
 
.. note::
 
     op2 = digraphs of same order as self.
computeOrbit(self, choice, withListing=False)
renders the set of isomorph copies of a choice following
the automorphism of the digraph self
computeOrderCorrelation(self, order, Debug=False)
Renders the ordinal correlation K of a digraph instance
when compared with a given linear order (from worst to best) of its actions
 
K = sum_{x != y} [ min( max(-self.relation(x,y)),other.relation(x,y), max(self.relation(x,y),-other.relation(x,y)) ]
 
K /= sum_{x!=y} [ min(abs(self.relation(x,y),abs(other.relation(x,y)) ]
 
.. note::
 
     Renders a dictionary with the key 'correlation' containing the actual bipolar correlation index and the key 'determination' containing the minimal determination level D of self and the other relation.
 
     D = sum_{x != y} min(abs(self.relation(x,y)),abs(other.relation(x,y)) / n(n-1)
 
     where n is the number of actions considered.
 
     The correlation index with a completely indeterminate relation
     is by convention 0.0 at determination level 0.0 .
 
.. warning::
 
     self must be a normalized outranking digraph instance !
computeOrdinalCorrelation(self, other, MedianCut=False, filterRelation=None, Debug=False)
Renders the bipolar correlation K of a
self.relation when compared
with a given compatible (same actions set)) digraph or
a [-1,1] valued compatible relation (same actions set).
 
If MedianCut=True, the correlation is computed on the median polarized relations.
 
If filterRelation is not None, the correlation is computed on the partial domain corresponding to the determined part of the filter relation.
 
.. warning::
 
     Notice that the 'other' relation and/or the 'filterRelation',
     the case given, must both be normalized, ie [-1,1]-valued !
 
K = sum_{x != y} [ min( max(-self.relation[x][y]),other.relation[x][y]), max(self.relation[x][y],-other.relation[x][y]) ]
 
K /= sum_{x!=y} [ min(abs(self.relation[x][y]),abs(other.relation[x][y])) ]
 
.. note::
 
     Renders a tuple with at position 0 the actual bipolar correlation index
     and in position 1 the minimal determination level D of self and
     the other relation.
 
     D = sum_{x != y} min(abs(self.relation[x][y]),abs(other.relation[x][y])) / n(n-1)
 
     where n is the number of actions considered.
 
     The correlation index with a completely indeterminate relation
     is by convention 0.0 at determination level 0.0 .
computeOrdinalCorrelationMP(self, other, MedianCut=False, Threading=False, nbrOfCPUs=None, startMethod=None, Comments=False, Debug=False)
Multi processing version of the digraphs.computeOrdinalCorrelation() method.
 
.. note::
     The relation filtering and the MedinaCut option are not implemented in the MP version.
computePairwiseClusterComparison(self, K1, K2, Debug=False)
Computes the pairwise cluster comparison credibility vector
from bipolar-valued digraph g. with K1 and K2 disjoint
lists of action keys from g actions disctionary.
Returns the dictionary
{'I': Decimal(),'P+':Decimal(),'P-':Decimal(),'R' :Decimal()}
where one and only one item is strictly positive.
computePreKernels(self)
computing dominant and absorbent preKernels:
    Result in self.dompreKernels and self.abspreKernels
computePreRankingRelation(self, preRanking, Normalized=True, Debug=False)
Renders the bipolar-valued relation obtained from
a given preRanking in decreasing levels (list of lists) result.
computePreorderRelation(self, preorder, Normalized=True, Debug=False)
Renders the bipolar-valued relation obtained from
a given preordering in increasing levels (list of lists) result.
computePrincipalOrder(self, Colwise=False, Comments=False)
Rendesr an ordering from wrost to best of the decision actions.
computePrincipalRanking(self, Colwise=False, Comments=False)
Rendesr a ranking from best to worst of the decision actions.
computePrincipalScores(self, plotFileName=None, Colwise=False, imageType=None, tempDir=None, bgcolor='cornsilk', Comments=False, Debug=False)
Renders a ordered list of the first principal eigenvector of the covariance of the valued outdegrees of self.
 
.. note::
 
   The method, relying on writing and reading temporary files by default in a temporary directory is threading and multiprocessing safe !
   (see Digraph.exportPrincipalImage method)
computePrudentBetaLevel(self, Debug=False)
computes alpha, ie the lowest valuation level, for which the
bipolarly polarised digraph doesn't contain a chordless circuit.
computeRankingByBestChoosing(self, CoDual=False, Debug=False)
Computes a weak preordering of the self.actions by recursive
best choice elagations.
 
Stores in self.rankingByBestChoosing['result'] a list of (P+,bestChoice) tuples
where P+ gives the best choice complement outranking
average valuation via the computePairwiseClusterComparison
method.
 
If self.rankingByBestChoosing['CoDual'] is True, 
the ranking-by-choosing was computed on the codual of self.
computeRankingByBestChoosingRelation(self, rankingByBestChoosing=None, Debug=False)
Renders the bipolar-valued relation obtained from
the self.rankingByBestChoosing result.
computeRankingByChoosing(self, actionsSubset=None, Debug=False, CoDual=False)
Computes a weak preordring of the self.actions by iterating
jointly first and last choice elagations.
 
Stores in self.rankingByChoosing['result'] a list of ((P+,bestChoice),(P-,worstChoice)) pairs
where P+ (resp. P-) gives the best (resp. worst) choice complement outranking
(resp. outranked) average valuation via the computePairwiseClusterComparison
method.
 
If self.rankingByChoosing['CoDual'] is True, the ranking-by-choosing was computed on the codual of self.
computeRankingByChoosingRelation(self, rankingByChoosing=None, actionsSubset=None, Debug=False)
Renders the bipolar-valued relation obtained from
the self.rankingByChoosing result.
computeRankingByLastChoosing(self, CoDual=False, Debug=False)
Computes a weak preordring of the self.actions by iterating
worst choice elagations.
 
Stores in self.rankingByLastChoosing['result'] a list of (P-,worstChoice) pairs
where P- gives the worst choice complement outranked
average valuation via the computePairwiseClusterComparison
method.
 
If self.rankingByChoosing['CoDual'] is True, the ranking-by-last-chossing 
was computed on the codual of self.
computeRankingByLastChoosingRelation(self, rankingByLastChoosing=None, Debug=False)
Renders the bipolar-valued relation obtained from
the self.rankingByLastChoosing result.
computeRankingCorrelation(self, ranking, Debug=False)
Renders the ordinal correlation K of a digraph instance
when compared with a given linear ranking of its actions
 
K = sum_{x != y} [ min( max(-self.relation(x,y)),other.relation(x,y), max(self.relation(x,y),-other.relation(x,y)) ]
 
K /= sum_{x!=y} [ min(abs(self.relation(x,y),abs(other.relation(x,y)) ]
 
.. note::
 
     Renders a tuple with at position 0 the actual bipolar correlation index
     and in position 1 the minimal determination level D of self and
     the other relation.
 
     D = sum_{x != y} min(abs(self.relation(x,y)),abs(other.relation(x,y)) / n(n-1)
 
     where n is the number of actions considered.
 
     The correlation index with a completely indeterminate relation
     is by convention 0.0 at determination level 0.0 .
computeRelationalStructure(self, Debug=False)
Renders the counted decomposition of the valued relations into
the following type of links:
gt '>', eq '=', lt '<', incomp '<>',
leq '<=', geq '>=', indeterm '?'
computeRubisChoice(self, Comments=False, _OldCoca=False, BrokenCocs=True, Threading=False, nbrOfCPUs=1)
Renders self.strictGoodChoices, self.nullChoices
self.strictBadChoices, self.nonRobustChoices.
 
.. warning::
    Changes in site the outranking digraph by
    adding or braking chordless odd outranking circuits.
computeRubyChoice(self, Comments=False, _OldCoca=False)
dummy for computeRubisChoice()
old versions compatibility.
computeShortestPathLengths(self, WeakPaths=False, Comments=False, Debug=False)
Renders a double dictionary with the directed distances, i.e. the shortest path lengths between all self.actions
 
Equals *None* if there does not exist a directed path between two actions.
 
*Source*: Claude Berge, *The Theory of Graphs*, Dover (2001) pp. 119, original in French Dunod (1958)
computeSingletonRanking(self, Comments=False, Debug=False)
Renders the sorted bipolar net determinatation of outrankingness
minus outrankedness credibilities of all singleton choices.
 
res = ((netdet,singleton,dom,absorb)+)
computeSize(self)
Renders the number of validated non reflexive arcs
computeSizeTransitiveClosure(self)
Renders the size of the transitive closure of a digraph.
computeSlaterOrder(self, isProbabilistic=False, seed=None, sampleSize=1000, Debug=False)
Reversed return from computeSlaterRanking method.
computeSlaterRanking(self, isProbabilistic=False, seed=None, sampleSize=1000, Debug=False)
Renders a ranking of the actions with minimal Slater index.
Return a tuple: slaterOrder, slaterIndex
computeSymmetryDegree(self, InPercents=False, Comments=False)
Renders the symmetry degree (Decimal) of the irreflexive part of a digraph.
 
.. note::
 
   Empty and indeterminate digraphs are considered to be symmetric.
computeTopologicalRanking(self, Debug=False)
Mimetic Wrapper of the topologicalSort() method.
computeTransitivityDegree(self, InPercents=False, Comments=False)
Renders the transitivity degree (Decimal) of a digraph.
 
.. note:: 
 
   An empty or indeterminate digraph is considered to be transitive.
computeUnrelatedPairs(self)
Renders a list of more or less unrelated pairs.
computeValuationLevels(self, choice=None, Debug=False)
renders the symmetric closure of the
apparent valuations levels of self
in an increasingly ordered list.
If parameter choice is given, the
computation is limited to the actions
of the choice.
computeValuationPercentages(self, choice, percentiles, withValues=False)
Parameters: choice and list of percentiles.
renders a series of percentages of the characteristics valuation of
the arcs in the digraph.
computeValuationPercentiles(self, choice, percentages, withValues=False)
Parameters: choice and list of percentages.
renders a series of quantiles of the characteristics valuation of
the arcs in the digraph.
computeValuationStatistics(self, Sampling=False, Comments=False)
Renders the mean and variance of the valuation
of the non reflexive pairs.
computeValuedRankingRelation(self, ranking)
Renders the valued relation characteristics compatible 
with the given linar ranking. Discordant charcateristics 
are set to the indeterminate value.
computeWeakCondorcetLosers(self)
Wrapper for weakCondorcetLosers().
computeWeakCondorcetWinners(self)
Wrapper for weakCondorcetWinners().
computeupdown1(self, s, S)
Help method for show_MIS_HB2 method.
fills self.newmisset, self.upmis, self.downmis.
computeupdown2(self, s, S)
Help method for show_MIS_HB1 method.
Fills self.newmisset, self.upmis, self.downmis.
computeupdown2irred(self, s, S)
Help method for show_MIS_HB1 method.
Fills self.newmisset, self.upmis, self.downmis.
condorcetLosers(self)
Renders the set of decision actions x such that
self.relation[x][y] < self.valuationdomain['med']
for all y != x.
condorcetWinners(self)
Renders the set of decision actions x such that
self.relation[x][y] > self.valuationdomain['med']
for all y != x.
contra(self, v)
Parameter: choice.
Renders the negation of a choice v characteristic's vector.
convertRelationToDecimal(self)
Converts the float valued self.relation in a decimal valued one.
convertValuation2Integer(self, InSite=True, Comments=False)
Converts the self.relation valuation to integer values by converting the Decimals to Fractions and multiply by the least commun multiple of the fraction denominators.
 
*Parameters*:
 
    - If *Insite* == False (True by default) the method returns a modified copy of self.relation without altering the original self.relation, otherwise self.relation and self.valuationdomain is modified.
convertValuationToDecimal(self)
Convert the float valuation limits to Decimals.
coveringIndex(self, choice, direction='out')
Renders the covering index of a given choice in a set of objects,
ie the minimum number of choice members that cover each
non selected object.
crispKDistance(self, digraph, Debug=False)
Renders the crisp Kendall distance between two bipolar valued
digraphs.
 
.. warning::
 
     Obsolete! Is replaced by the self.computeBipolarCorrelation(other, MedianCut=True) Digraph method
detectChordlessCircuits(self, Comments=False, Debug=False)
Detects a chordless circuit in a digraph.
Returns a Boolean
detectChordlessPath(self, Pk, n2, Comments=False, Debug=False)
New procedure from Agrum study April 2009
recursive chordless path extraction starting from path
Pk = [n2, ...., n1] and ending in node n2.
Optimized with marking of visited chordless P1s.
determinateness(self, vec, inPercent=True)
Renders the determinateness of a characteristic vector *vec* = 
[(r(x),x),(r(y),y), ...] of length *n* in valuationdomain [Min,Med,Max]:
 
*result* =  sum_x( abs(r(x)-Med) ) / ( n*(Max-Med) )
 
If inPercent, *result* shifted (+1) and reduced (/2) to [0,1] range.
digraph2Graph(self, valuationDomain={'min': -1, 'med': 0, 'max': 1}, Debug=False, ConjunctiveConversion=True)
Convert a Digraph instance to a Graph instance.
dneighbors(self, node)
Renders the set of dominated out-neighbors of a node.
domin(self, choice)
Renders the dominance degree of a choice.
dominantChoices(self, S)
Generates all minimal dominant choices of a bipolar valued digraph.
 
.. note::
 
     Initiate with S = self.actions.copy().
domirred(self, choice)
Renders the crips +irredundance degree of a choice.
domirredval(self, choice, relation)
Renders the valued +irredundance degree of a choice.
domirredx(self, choice, x)
Renders the crips +irredundance degree of node x in a choice.
domkernelrestrict(self, prekernel)
Parameter: dominant prekernel
Renders dominant prekernel restricted relation.
exportGraphViz(self, fileName=None, actionsSubset=None, bestChoice=set(), worstChoice=set(), firstChoice=set(), lastChoice=set(), Comments=True, graphType='png', pictureFormat=None, graphSize='7,7', relation=None, bgcolor='cornsilk')
export GraphViz dot file  for graph drawing filtering.
exportPrincipalImage(self, plotFileName=None, pictureFormat='pdf', bgcolor='cornsilk', fontcolor='red3', fontsize='0.75', Reduced=False, Colwise=False, tempDir='.', Comments=False)
Export as PDF (default) the principal projection of
the valued relation using the three principal eigen vectors.
 
Implemeted picture formats are: 
'pdf' (default), 'png', 'jpeg' and 'xfig'.
 
The background color is set by default to 'cornsilk'. 
 
Font size and color are set by default to 'red3', resp. '0.75'. 
 
When *Reduced==True*, the valued relation characeteristics are centered and reduced.
 
When *Colwise==True*, the column vectors of the adjacency table are used for the principal projection, otherwise the rows (default) are used. Has no incidence when the *Digraph* instance *self*  is symmetric. 
 
.. warning::
 
    The method, writing and reading temporary files: 
    tempCol.r and rotationCol.csv, resp. tempRow.r and rotationRow.csv,
    by default in the working directory (./),
    is hence not safe for multiprocessing programs, unless a
    temporary directory *tempDir* is provided.
flatChoice(self, ch, Debug=False)
Converts set or list ch recursively to a flat list of items.
forcedBestSingleChoice(self)
Renders the set of most determined outranking singletons in self.
gammaSets(self)
Renders the dictionary of neighborhoods {node: (dx,ax)}
with set *dx* gathering the dominated, and set *ax* gathering
the absorbed neighborhood.
generateAbsPreKernels(self)
Generate all absorbent prekernels from independent choices generator.
generateDomPreKernels(self)
Generate all dominant prekernels from independent choices generator.
htmlChoiceVector(self, ch, ChoiceVector=True, choiceType='good')
Show procedure for annotated bipolar choices.
inDegrees(self)
renders the median cut indegrees
inDegreesDistribution(self)
Renders the distribution of indegrees.
independentChoices(self, U)
Generator for all independent choices with neighborhoods of a bipolar valued digraph:
 
.. note::
 
       * Initiate with U = self.singletons().
       * Yields [(independent choice, domnb, absnb, indnb)].
inner_prod(self, v1, v2)
Parameters: two choice characteristic vectors
Renders the inner product of two characteristic vetors.
intstab(self, choice)
Computes the independence degree of a choice.
irreflex(self, mat)
Puts diagonal entries of mat to valuationdomain['min']
isAsymmetricIndeterminate(self, Debug=False)
Checks the self.relation for assymmetric indeterminateness!!
 
.. warning::
 
    The reflexive links are ignored !!
isComplete(self, Debug=False)
checks the completeness property of self.relation by checking
for the absence of a link between two actions!!
 
.. warning::
 
    The reflexive links are ignored !!
isCyclic(self, Debug=False)
checks the cyclicity of self.relation by checking
for a reflexive loop in its transitive closure-
 
.. warning::
 
     self.relation is supposed to be irreflexive !
isIntegerValued(self, Debug=False)
Checks whether the decimal valuation of self is integer-valued
be using the as_integer_ratio() method of a Decimal 
giving a tuple (numerator,denominator). If denominator == 1, the
number is an integer.
isOutrankingDigraph(self, Comments=True, Debug=False)
Checks the outranking digraph characteristic condition (3.3).
 
relation[x][y] + relation[y][x)[y] >= 0.0
 
.. warning::
 
    The reflexive links are ignored and the valuation must be bipolar !!
isStrictOutrankingDigraph(self, Comments=True, Debug=False)
Checks the strict outranking digraph characteristic condition (3.1).
 
-(relation[x][y] + relation[y][x]) <= 0.0 , x != y
 
.. warning::
 
    The reflexive links are ignored and the valuation must be bipolar !!
isSymmetric(self, Comments=False)
True if symmetry degree == 1.0.
isTransitive(self, Comments=False)
True if transitivity degree == 1.0.
isWeaklyComplete(self, Debug=False)
checks the weakly completeness property of self.relation by checking
for the absence of a link between two actions!!
 
.. warning::
 
    The reflexive links are ignored !!
iterateRankingByChoosing(self, Odd=False, CoDual=False, Comments=True, Debug=False, Limited=None)
Renders a ranking by choosing result when progressively eliminating
all chordless (odd only) circuits with rising valuation cut levels.
 
Parameters
    CoDual = False (default)/True
    Limited = proportion (in [0,1]) * (max - med) valuationdomain
kChoices(self, A, k)
Renders all choices of length k from set A
matmult2(self, m, v)
Parameters: digraph relation and choice characteristic vector
matrix multiply vector by inner production
meanDegree(self)
Renders the mean degree of self.
!!! self.size must be set previously !!!
meanLength(self, Oriented=False)
Renders the (by default non-oriented) mean neighbourhoor depth of self.
!!! self.order must be set previously !!!
minimalChoices(self, S)
Generates all dominant or absorbent choices of a bipolar
valued digraph.
 
.. note:
 
   * Initiate with S = (actions, dict of dominant or absorbent closed neighborhoods)
   * See showMinDom and showMinAbs methods.
minimalValuationLevelForCircuitsElimination(self, Odd=True, Debug=False, Comments=False)
renders the minimal valuation level <lambda> that eliminates all
self.circuitsList stored odd chordless circuits from self.
 
.. warning::
 
    The <lambda> level polarised may still contain newly appearing chordless odd circuits !
neighbourhoodCollection(self, Oriented=False, Potential=False)
Renders the neighbourhood.
neighbourhoodDepthDistribution(self, Oriented=False)
Renders the distribtion of neighbourhood depths.
notGammaSets(self)
Renders the dictionary of neighborhoods {node: (dx,ax)}
with set *dx* gathering the not dominated, and set *ax* gathering
the not absorbed neighborhood.
notaneighbors(self, node)
Renders the set of absorbed not in-neighbors of a node.
notdneighbors(self, node)
Renders the set of not dominated out-neighbors of a node.
outDegrees(self)
renders the median cut outdegrees
outDegreesDistribution(self)
Renders the distribution of outdegrees.
plusirredundant(self, U)
Generates all +irredundant choices of a digraph.
powerset(self, U)
Generates all subsets of a set.
readPerrinMisset(self, file='curd.dat')
read method for 0-1-char-coded MISs by default from the perrinMIS.c curd.dat result file.
readabsvector(self, x, relation)
Parameter: action x
absorbent in vector.
readdomvector(self, x, relation)
Parameter: action x
dominant out vector.
recodeValuation(self, newMin=-1.0, newMax=1.0, ndigits=4, Debug=False)
Recodes the characteristic valuation domain according
to the parameters given. 
 
*ndigits* indicates the number of decimal digits of the valuation.
relationFct(self, x, y)
wrapper for self.relation dictionary access to ensure interoperability
with the sparse and big outranking digraph implementation model.
save(self, fileName='tempdigraph', option=None, DecimalValuation=True, decDigits=2)
Persistent storage of a Digraph class instance in the form of
a python source code file
saveCSV(self, fileName='tempdigraph', Normalized=False, Dual=False, Converse=False, Diagonal=False, Debug=False)
Persistent storage of a Digraph class instance in the form of
a csv file.
saveXMCDA2(self, fileName='temp', fileExt='xmcda2', Comments=True, relationName='R', relationType='binary', category='random', subcategory='valued', author='digraphs Module (RB)', reference='saved from Python', valuationType='standard', digits=2, servingD3=False)
save digraph in XMCDA 2.0 format. Deprecated now.
savedre(self, fileName='temp')
save digraph in nauty format.
sharp(self, x, y)
Paramaters: choice characteristic values.
Renders the sharpest of two characteristic values x and y.
sharpvec(self, v, w)
Paramaters: choice characteristic vectors.
Renders the sharpest of two characteristic vectors v and w.
showActions(self)
presentation methods for digraphs actions
showAll(self)
Detailed show method for genuine digraphs.
showAttributes(self)
Prints out the attributes of self.
showAutomorphismGenerators(self)
Renders the generators of the automorphism group.
showBadChoices(self, Recompute=True)
Characteristic values for potentially bad choices.
showBestChoiceRecommendation(self, Verbose=False, Comments=True, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True)
Shows the RuBis best choice recommendation.
 
.. note::
 
    Computes by default the Rubis best choice recommendation on the corresponding strict (codual) outranking digraph.
 
    By default, with BrokenCocs=True, we brake all chordless circuits at their weakest determined ( abs(r(x>y)) + abs(r(y>x)) ) link.
 
    When BrokenCocs=False we proceed like follows:
 
    In case of chordless circuits, if supporting arcs are more credible
    than the reversed negating arcs, we collapse the circuits into hyper nodes.
    Inversely,  if supporting arcs are not more credible than the reversed negating arcs,
    we brake the circuits on their weakest arc.
 
Usage example:
 
>>> from outrankingDigraphs import *
>>> t = Random3ObjectivesPerformanceTableau(seed=5)
>>> g = BipolarOutrankingDigraph(t)
>>> g.showBestChoiceRecommendation()
***********************
RuBis Best Choice Recommendation (BCR)
(in decreasing order of determinateness)   
Credibility domain:  [-100.0, 100.0]
=== >> potential first choices
* choice              : ['a04', 'a14', 'a19', 'a20']
   independence        : 1.19
   dominance           : 4.76
   absorbency          : -59.52
   covering (%)        : 75.00
   determinateness (%) : 57.86
   - most credible action(s) = { 'a14': 23.81, 'a19': 11.90, 'a04': 2.38, 'a20': 1.19, }  
=== >> potential last choices 
* choice              : ['a03', 'a12', 'a17']
  independence        : 4.76
  dominance           : -76.19
  absorbency          : 4.76
  covering (%)        : 0.00
  determinateness (%) : 65.39
  - most credible action(s) = { 'a03': 38.10, 'a12': 13.10, 'a17': 4.76, }
Execution time: 0.024 seconds
*****************************
showChoiceVector(self, ch, choiceType='good', ChoiceVector=True)
Show procedure for annotated bipolar choices.
showChordlessCircuits(self, Recompute=False)
Show method for chordless circuits observed in a Digraph instance.
 
If previous computation is required, stores the detected circuits in self.circuitsList attribute.
showComponents(self)
Shows the list of connected components of the digraph instance.
showCorrelation(self, corr=None, ndigits=3)
Renders the valued ordinal correlation index, the crisp Kendall tau index and their epistemic determination degree.
showFirstChoiceRecommendation(self, Verbose=False, Comments=True, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True)
Shows the RuBis first choice recommendation.
 
.. note::
 
    Computes by default the Rubis first choice recommendation on the corresponding strict (codual) outranking digraph.
 
    By default, with BrokenCocs=True, we brake all chordless circuits at their weakest determined ( abs(r(x>y)) + abs(r(y>x)) ) link.
 
    When BrokenCocs=False we proceed like follows:
 
    In case of chordless circuits, if supporting arcs are more credible
    than the reversed negating arcs, we collapse the circuits into hyper nodes.
    Inversely,  if supporting arcs are not more credible than the reversed negating arcs,
    we brake the circuits on their weakest arc.
 
Usage example:
 
>>> from outrankingDigraphs import *
>>> t = Random3ObjectivesPerformanceTableau(seed=5)
>>> g = BipolarOutrankingDigraph(t)
>>> g.showFirstChoiceRecommendation()
***********************
RuBis First Choice Recommendation (BCR)
(in decreasing order of determinateness)   
Credibility domain:  [-100.0, 100.0]
=== >> potential first choices
* choice              : ['a04', 'a14', 'a19', 'a20']
   independence        : 1.19
   dominance           : 4.76
   absorbency          : -59.52
   covering (%)        : 75.00
   determinateness (%) : 57.86
   - most credible action(s) = { 'a14': 23.81, 'a19': 11.90, 'a04': 2.38, 'a20': 1.19, }  
=== >> potential last choices 
* choice              : ['a03', 'a12', 'a17']
  independence        : 4.76
  dominance           : -76.19
  absorbency          : 4.76
  covering (%)        : 0.00
  determinateness (%) : 65.39
  - most credible action(s) = { 'a03': 38.10, 'a12': 13.10, 'a17': 4.76, }
Execution time: 0.024 seconds
*****************************
showGoodChoices(self, Recompute=True)
Characteristic values for potentially good choices.
showHTMLBestChoiceRecommendation(self, pageTitle=None, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True, htmlFileName=None)
showHTMLRelationHeatmap(self, actionsList=None, rankingRule='NetFlows', colorLevels=7, tableTitle='Relation Heatmap', relationName='r(x S y)', ndigits=2, fromIndex=None, toIndex=None, htmlFileName=None)
Launches a browser window with the colored relation map of self.
 
See corresponding :py:class:`~digraphs.Digraph.showHTMLRelationMap` method.
 
The *colorLevels* parameter may be set to 3, 5, 7 (default) or 9.
 
When the *actionsList* parameter is *None* (default), the digraphs actions list may be ranked with the *rankingRule* parameter set to the 'Copeland' (default) or to the 'Netlows' ranking rule.
 
When the *htmlFileName* parameter is set to a string value 'xxx', a html file named 'xxx.html' will be generated in the current working directory. Otherwise, a temporary file named 'tmp*.html' will be generated there.
 
Example::
 
    >>> from outrankingDigraphs import *
    >>> t = RandomCBPerformanceTableau(numberOfActions=25,seed=1)
    >>> g = BipolarOutrankingDigraph(t,ndigits=2)
    >>> gcd = ~(-g)  # strict outranking relation
    >>> gcd.showHTMLRelationHeatmap(colorLevels=7,ndigits=2)
    
.. image:: relationHeatmap.png
   :alt: Browser view of a relation map
   :width: 600 px
   :align: center
showHTMLRelationMap(self, actionsList=None, rankingRule='Copeland', Colored=True, tableTitle='Relation Map', relationName='r(x S y)', symbols=['+', '&middot;', '&nbsp;', '&#150;', '&#151'], fromIndex=None, toIndex=None, htmlFileName=None)
Launches a browser window with the colored relation map of self.
See corresponding Digraph.showRelationMap() method.
 
When *htmlFileName* parameter is set to a string value, a html file
with that name will be stored in the current working directory.
 
By default, a temporary file named: tmp*.html will be generated
instead in the current working directory.
 
Example::
 
    >>> from outrankingDigraphs import *
    >>> t = RandomCBPerformanceTableau(numberOfActions=25,seed=1)
    >>> g = BipolarOutrankingDigraph(t,Normalized=True)
    >>> gcd = ~(-g)  # strict outranking relation
    >>> gcd.showHTMLRelationMap(rankingRule="NetFlows")
    
.. image:: relationMap.png
   :alt: Browser view of a relation map
   :width: 600 px
   :align: center
showHTMLRelationTable(self, actionsList=None, relation=None, IntegerValues=False, ndigits=2, Colored=True, tableTitle='Valued Adjacency Matrix', relationName='r(x S y)', ReflexiveTerms=False, htmlFileName=None, fromIndex=None, toIndex=None)
Launches a browser window with the colored relation table of self.
showMIS(self, withListing=True)
Prints all maximal independent choices:
    Result in self.misset.
showMIS_AH(self, withListing=True)
Prints all MIS using the Hertz method.
 
Result saved in self.hertzmisset.
showMIS_HB2(self, withListing=True)
Prints all MIS using the Hertz-Bisdorff method.
 
Result saved in self.newmisset.
showMIS_RB(self, withListing=True)
Prints all MIS using the Bisdorff method.
 
Result saved in self.newmisset.
showMIS_UD(self, withListing=True)
Prints all MIS using the Hertz-Bisdorff method.
 
Result saved in self.newmisset.
showMaxAbsIrred(self, withListing=True)
Computing maximal -irredundant choices:
    Result in self.absirset.
showMaxDomIrred(self, withListing=True)
Computing maximal +irredundant choices:
   Result in self.domirset.
showMinAbs(self, withListing=True)
Prints minimal absorbent choices:
    Result in self.absset.
showMinDom(self, withListing=True)
Prints all minimal dominant choices:
    Result in self.domset.
showNeighborhoods(self)
Lists the gamma and the notGamma function of self.
showOrbits(self, InChoices, withListing=True)
Prints the orbits of Choices along the automorphisms of
the Digraph instance.
 
Example Python session for computing the non isomorphic MISs from the 12-cycle graph:
 
>>> from digraphs import *
>>> c12 = CirculantDigraph(order=12,circulants=[1,-1])
>>> c12.automorphismGenerators()
...
  Permutations
  {'1': '1', '2': '12', '3': '11', '4': '10', '5': 
   '9', '6': '8', '7': '7', '8': '6', '9': '5', '10': 
   '4', '11': '3', '12': '2'}
  {'1': '2', '2': '1', '3': '12', '4': '11', '5': '10', 
   '6': '9', '7': '8', '8': '7', '9': '6', '10': '5', 
   '11': '4', '12': '3'}
  Reflections {}
>>> print('grpsize = ', c12.automorphismGroupSize)
  grpsize = 24
>>> c12.showMIS(withListing=False)
  *---  Maximal independent choices ---*
  number of solutions:  29
  cardinality distribution
  card.:  [0, 1, 2, 3, 4,  5,  6, 7, 8, 9, 10, 11, 12]
  freq.:  [0, 0, 0, 0, 3, 24,  2, 0, 0, 0,  0,  0,  0]
  Results in c12.misset
>>> c12.showOrbits(c12.misset,withListing=False)
...
  *---- Global result ----
  Number of MIS:  29
  Number of orbits :  4
  Labelled representatives:
  1: ['2','4','6','8','10','12']
  2: ['2','5','8','11']
  3: ['2','4','6','9','11']
  4: ['1','4','7','9','11']
  Symmetry vector
  stabilizer size: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, ...]
  frequency      : [0, 2, 0, 0, 0, 0, 0, 1, 0,  0,  0,  1, ...]
 
*Figure*: The symmetry axes of the non isomorphic MISs of the 12-cycle:
 
.. image:: c12.png
   :width: 400 px
   :align: center
   :alt: The 4 non isomorphic MIS of the 12-cycle graph
 
*Reference*: R. Bisdorff and J.L. Marichal (2008). Counting non-isomorphic maximal independent sets of the n-cycle graph. *Journal of Integer Sequences*, Vol. 11 Article 08.5.7 (`openly accessible here <https://www.cs.uwaterloo.ca/journals/JIS/VOL11/Marichal/marichal.html>`_)
showOrbitsFromFile(self, InFile, withListing=True)
Prints the orbits of Choices along the automorphisms of
the digraph self by reading in the 0-1 misset file format.
See the :py:func:`digraphs.Digraph.readPerrinMisset` method.
showPreKernels(self, withListing=True)
Printing dominant and absorbent preKernels:
    Result in self.dompreKernels and self.abspreKernels
showRankingByBestChoosing(self, rankingByBestChoosing=None)
A show method for self.rankinByBestChoosing result.
 
.. warning::
 
     The self.computeRankingByBestChoosing(CoDual=False/True) method instantiating the self.rankingByBestChoosing slot is pre-required !
showRankingByChoosing(self, rankingByChoosing=None, WithCoverCredibility=False)
A show method for self.rankinByChoosing result.
 
When parameter *WithCoverCredibility* is set to True, the credibility of outranking, respectively being outranked is indicated at each selection step. 
 
.. warning::
 
     The self.computeRankingByChoosing(CoDual=False/True) method instantiating the self.rankingByChoosing slot is pre-required !
showRankingByLastChoosing(self, rankingByLastChoosing=None, Debug=None)
A show method for self.rankinByChoosing result.
 
.. warning::
 
     The self.computeRankingByLastChoosing(CoDual=False/True) method instantiating the self.rankingByChoosing slot is pre-required !
showRelation(self)
prints the relation valuation in ##.## format.
showRelationMap(self, symbols=None, rankingRule='Copeland', fromIndex=None, toIndex=None, actionsList=None)
Prints on the console, in text map format, the location of
certainly validated and certainly invalidated outranking situations.
 
By default, symbols = {'max':'┬','positive': '+', 'median': ' ',
                       'negative': '-', 'min': '┴'}
 
The default ordering of the output is following the Copeland ranking rule
from best to worst actions. Further available ranking rule is the 'NetFlows' net flows rule.
 
 
Example::
 
    >>> from outrankingDigraphs import *
    >>> t = RandomCBPerformanceTableau(numberOfActions=25,seed=1)
    >>> g = BipolarOutrankingDigraph(t,Normalized=True)
    >>> gcd = ~(-g)  # strict outranking relation
    >>> gcd.showRelationMap(rankingRule="NetFlows")
     -   ++++++++  +++++┬+┬┬+
    - -   + +++++ ++┬+┬+++┬++
    ┴+  ┴ + ++  ++++┬+┬┬++┬++
    -   ++ - ++++-++++++┬++┬+
       - - - ++- ┬- + -+┬+-┬┬
    -----  -      -┬┬┬-+  -┬┬
    ----    --+-+++++++++++++
    -- --+- --++ ++ +++-┬+-┬┬
    ----  -  -+-- ++--+++++ +
    ----- ++- --- +---++++┬ +
    -- -- ---+ -++-+++-+ +-++
    -- --┴---+  + +-++-+ -  +
    ---- ┴---+-- ++--++++ - +
      --┴┴--  --- -  --+ --┬┬
     ---------+--+ ----- +-┬┬
    -┴---┴- ---+- + ---+++┬ +
    -┴┴--┴---+--- ++ -++--+++
    -----┴--- ---+-+- ++---+ 
    -┴┴--------------- --++┬ 
    --┴---------------- --+┬ 
    ┴--┴┴ -┴--┴┴-┴ --++  ++-+
    ----┴┴--------------- -  
    ┴┴┴----+-┴+┴---┴-+---+ ┴+
    ┴┴-┴┴┴-┴- - -┴┴---┴┴+ ┬ -
    ----┴┴-┴-----┴┴---  - -- 
    Ranking rule: NetFlows
    >>>
showRelationTable(self, Sorted=True, rankingRule=None, IntegerValues=False, actionsSubset=None, relation=None, ndigits=2, ReflexiveTerms=True, fromIndex=None, toIndex=None)
Prints the relation valuation in actions X actions table format.
Copeland and NetFlows rankings my be used.
showRubisBestChoiceRecommendation(self, **kwargs)
Dummy for backward portable showBestChoiceRecommendation().
showRubyChoice(self, Verbose=False, Comments=True, _OldCoca=True)
Dummy for showBestChoiceRecommendation()
needed for older versions compatibility.
showShort(self)
concise presentation method for genuine digraphs.
showSingletonRanking(self, Comments=True, Debug=False)
Calls self.computeSingletonRanking(comments=True,Debug = False).
Renders and prints the sorted bipolar net determinatation of outrankingness
minus outrankedness credibilities of all singleton choices.
 
res = ((netdet,sigleton,dom,absorb)+)
showStatistics(self)
Computes digraph statistics like order, size and arc-density.
showdre(self)
Shows relation in nauty format.
singletons(self)
list of singletons and neighborhoods
[(singx1, +nx1, -nx1, not(+nx1 or -nx1)),.... ]
sizeSubGraph(self, choice)
Output: (size, undeterm,arcDensity).
Renders the arc density of the induced subgraph.
strongComponents(self, setPotential=False)
Renders the set of strong components of self.
symDegreesDistribution(self)
Renders the distribution of symmetric degrees.
topologicalSort(self, Debug=False)
If self is acyclic, adds topological sort number to each node of self
and renders ordered list of nodes. Otherwise renders None.
Source: M. Golumbic Algorithmic Graph heory and Perfect Graphs,
Annals Of Discrete Mathematics 57 2nd Ed. , Elsevier 2004, Algorithm 2.4 p.44.
weakAneighbors(self, node)
Renders the set of absorbed in-neighbors of a node.
weakCondorcetLosers(self)
Renders the set of decision actions x such that
self.relation[x][y] <= self.valuationdomain['med']
for all y != x.
weakCondorcetWinners(self)
Renders the set of decision actions x such that
self.relation[x][y] >= self.valuationdomain['med']
for all y != x.
weakDneighbors(self, node)
Renders the set of dominated out-neighbors of a node.
weakGammaSets(self)
Renders the dictionary of neighborhoods {node: (dx,ax)}
zoomValuation(self, zoomFactor=1.0)
Zooms in or out, depending on the value of the zoomFactor provided,
the bipolar valuation of a digraph.

Data descriptors inherited from Digraph:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class EmptyDigraph(Digraph)
    EmptyDigraph(order=5, valuationdomain=(-1.0, 1.0))
 
Parameters:
    order > 0 (default=5); valuationdomain =(Min,Max).
 
Specialization of the general Digraph class for generating
temporary empty graphs of given order in {-1,0,1}.
 
 
Method resolution order:
EmptyDigraph
Digraph
builtins.object

Methods defined here:
__init__(self, order=5, valuationdomain=(-1.0, 1.0))
Initialize self.  See help(type(self)) for accurate signature.

Methods inherited from Digraph:
MISgen(self, S, I)
generator of maximal independent choices (voir Byskov 2004):
    * S ::= remaining nodes;
    * I ::= current independent choice
 
.. note::
 
        Inititalize: self.MISgen(self.actions.copy(),set())
__invert__(self)
Make the inverting operator ~self available for Digraph instances. 
 
Returns a ConverseDigraph instance of self.
__neg__(self)
Make the negation operator -self available for Digraph instances. 
 
Returns a DualDigraph instance of self.
__repr__(self)
Default presentation method for Digraph instances.
absirred(self, choice)
Renders the crips -irredundance degree of a choice.
absirredundant(self, U)
Generates all -irredundant choices of a digraph.
absirredval(self, choice, relation)
Renders the valued -irredundance degree of a choice.
absirredx(self, choice, x)
Computes the crips -irredundance degree of node x in a choice.
abskernelrestrict(self, prekernel)
Parameter: prekernel
Renders absorbent prekernel restricted relation.
absorb(self, choice)
Renders the absorbency degree of a choice.
absorbentChoices(self, S)
Generates all minimal absorbent choices of a bipolar valued digraph.
addValuationAttribute(self)
Adds the numpy valuation attribute
agglomerationDistribution(self)
Output: aggloCoeffDistribution, meanCoeff
Renders the distribution of agglomeration coefficients.
aneighbors(self, node)
Renders the set of absorbed in-neighbors of a node.
automorphismGenerators(self)
Adds automorphism group generators to the digraph instance.
 
.. note::
 
    Dependency: Uses the dreadnaut command from the nauty software package. See https://www3.cs.stonybrook.edu/~algorith/implement/nauty/implement.shtml
 
    On Ubuntu Linux:
      ...$ sudo apt-get install nauty
averageCoveringIndex(self, choice, direction='out')
Renders the average covering index of a given choice in a set of objects,
ie the average number of choice members that cover each
non selected object.
bipolarKCorrelation(self, digraph, Debug=False)
Renders the bipolar Kendall correlation between two bipolar valued
digraphs computed from the average valuation of the
XORDigraph(self,digraph) instance.
 
.. warning::
 
     Obsolete! Is replaced by the self.computeBipolarCorrelation(other) Digraph method
bipolarKDistance(self, digraph, Debug=False)
Renders the bipolar crisp Kendall distance between two bipolar valued
digraphs.
 
.. warning::
 
     Obsolete! Is replaced by the self.computeBipolarCorrelation(other, MedianCut=True) Digraph method
chordlessPaths(self, Pk, n2, Odd=False, Comments=False, Debug=False)
New procedure from Agrum study April 2009
recursive chordless path extraction starting from path
Pk = [n2, ...., n1] and ending in node n2.
Optimized with marking of visited chordless P1s.
circuitAverageCredibility(self, circ)
Renders the average linking credibility of a Chordless Circuit.
circuitCredibilities(self, circuit, Debug=False)
Renders the average linking credibilities and the minimal link of a Chordless Circuit.
circuitMaxCredibility(self, circ)
Renders the maximal linking credibility of a Chordless Circuit.
circuitMinCredibility(self, circ)
Renders the minimal linking credibility of a Chordless Circuit.
closeSymmetric(self, InSite=True)
Produces the symmetric closure of self.relation.
closeTransitive(self, Reverse=False, InSite=True, Comments=False)
Produces the transitive closure of self.relation
 
*Parameters*:
 
    - If *Reverse* == True (False default) all transitive links are dropped, otherwise all transitive links are closed with min[r(x,y),r(y,z)];
    - If *Insite* == False (True by default) the methods return a modified copy of self.relation without altering the original self.relation, otherwise self.relation is modified.
components(self)
Renders the list of connected components.
computeAllDensities(self, choice=None)
parameter: choice in self
renders six densitiy parameters:
arc density, double arc density,
single arc density, strict single arc density,
absence arc density, strict absence arc densitiy.
computeArrowRaynaudOrder(self)
Renders a linear ordering from worst to best of the actions following Arrow&Raynaud's rule.
computeArrowRaynaudRanking(self)
renders a linear ranking from best to worst of the actions following Arrow&Raynaud's rule.
computeAverageValuation(self)
Computes the bipolar average correlation between
self and the crisp complete digraph of same order
of the irreflexive and determined arcs of the digraph
computeBadChoices(self, Comments=False)
Computes characteristic values for potentially bad choices.
 
.. note::
 
     Returns a tuple with following content:
 
     [(0)-determ,(1)degirred,(2)degi,(3)degd,(4)dega,(5)str(choice),(6)absvec]
computeBadPirlotChoices(self, Comments=False)
Characteristic values for potentially bad choices
using the Pirlot's fixpoint algorithm.
computeBestChoiceRecommendation(self, Verbose=False, Comments=False, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True)
Sets self.bestChoice, self.bestChoiceData, self.worstChoice and self.worstChoiceData
with the showBestChoiceRecommendation method.
 
First and last choices data is the following:
[(0)-determ,(1)degirred,(2)degi,(3)degd,(4)dega,(5)str(choice),(6)domvec,(7)cover]
 
self.bestChoice = self.bestChoiceData[5]
self.worstChoice = self.worstChoiceData[5]
computeBipolarCorrelation(self, other, MedianCut=False, filterRelation=None, Debug=False)
obsolete: dummy replacement for Digraph.computeOrdinalCorrelation method
computeChordlessCircuits(self, Odd=False, Comments=False, Debug=False)
Renders the set of all chordless circuits detected in a digraph.
Result is stored in <self.circuitsList>
holding a possibly empty list of tuples with at position 0 the
list of adjacent actions of the circuit and at position 1
the set of actions in the stored circuit.
 
When *Odd* is True, only chordless circuits with an odd length
are collected.
computeChordlessCircuitsMP(self, Odd=False, Threading=False, nbrOfCPUs=None, startMethod=None, Comments=False, Debug=False)
Multiprocessing version of computeChordlessCircuits().
 
Renders the set of all chordless odd circuits detected in a digraph.
Result (possible empty list) stored in <self.circuitsList>
holding a possibly empty list tuples with at position 0 the
list of adjacent actions of the circuit and at position 1
the set of actions in the stored circuit.
Inspired by Dias, Castonguay, Longo, Jradi, Algorithmica (2015).
 
Returns a possibly empty list of tuples (circuit,frozenset(circuit)).
 
If Odd == True, only circuits of odd length are retained in the result.
computeCoSize(self)
Renders the number of non validated non reflexive arcs
computeConcentrationIndex(self, X, N)
Renders the Gini concentration index of the X serie.
N contains the partial frequencies.
Based on the triangle summation formula.
computeConcentrationIndexTrapez(self, X, N)
Renders the Gini concentration index of the X serie.
N contains the partial frequencies.
Based on the triangles summation formula.
computeCondorcetLosers(self)
Wrapper for condorcetLosers().
computeCondorcetWinners(self)
Wrapper for condorcetWinners().
computeCopelandOrder(self)
renders a linear ordering from worst to best of the actions following Arrow&Raynaud's rule.
computeCopelandRanking(self)
renders a linear ranking from best to worst of the actions following Arrow&Raynaud's rule.
computeCutLevelDensities(self, choice, level)
parameter: choice in self, robustness level
renders three robust densitiy parameters:
robust double arc density,
robust single arc density,
robust absence arc densitiy.
computeDensities(self, choice)
parameter: choice in self
renders the four densitiy parameters:
arc density, double arc density, single arc density, absence arc density.
computeDeterminateness(self, InPercents=False)
Computes the Kendalll distance of self
with the all median-valued indeterminate digraph of order n.
 
Return the average determination of the irreflexive part of the digraph.
 
*determination* = sum_(x,y) { abs[ r(xRy) - Med ] } / n(n-1)
 
If *InPercents* is True, returns the average determination in percentage of
(Max - Med) difference.
 
>>> from outrankingDigraphs import BipolarOutrankingDigraph
>>> from randomPerfTabs import Random3ObjectivesPerformanceTableau
>>> t = Random3ObjectivesPerformanceTableau(numberOfActions=7,numberOfCriteria=7,seed=101)
>>> g = BipolarOutrankingDigraph(t,Normalized=True)
>>> g
*------- Object instance description ------*
Instance class      : BipolarOutrankingDigraph
Instance name       : rel_random3ObjectivesPerfTab
Actions             : 7
Criteria            : 7
Size                : 27
Determinateness (%) : 65.67
Valuation domain    : [-1.00;1.00]
>>> print(g.computeDeterminateness())
0.3134920634920634920634920638
>>> print(g.computeDeterminateness(InPercents=True))
65.67460317460317460317460320
>>> g.recodeValuation(0,1)
>>> g
*------- Object instance description ------*
Instance class      : BipolarOutrankingDigraph
Instance name       : rel_random3ObjectivesPerfTab
Actions             : 7
Criteria            : 7
Size                : 27
Determinateness (%) : 65.67
Valuation domain    : [0.00;1.00]
>>> print(g.computeDeterminateness())
0.1567460317460317460317460318
>>> print(g.computeDeterminateness(InPercents=True))
65.67460317460317460317460320
computeDiameter(self, Oriented=True)
Renders the (by default oriented) diameter of the digraph instance
computeDigraphCentres(self, WeakDistances=False, Comments=False)
The centers of a digraph are the nodes with finite minimal shortes path lengths.
 
The maximal neighborhood distances are stored in *self.maximalNeighborhoodDistances*.
 
The corresponding digraph radius and diameter are stored respectively  in *self.radius* and *self.diameter*.
 
With *Comments* = True, all these results are printed out.
 
*Source*: Claude Berge, *The Theory of Graphs*, Dover (2001) pp. 119, original in French Dunod (1958)
computeDynamicProgrammingStages(self, source, sink, Debug=False)
Renders the discrete stages of the optimal substructure for
dynamic pogramming digrahs from a given source node 
to a given sink sink node.
 
Returns a list of list of action identifyers.
computeGoodChoiceVector(self, ker, Comments=False)
| Computing Characteristic values for dominant pre-kernels
| using the von Neumann dual fixoint equation
computeGoodChoices(self, Comments=False)
Computes characteristic values for potentially good choices.
 
..note::
 
     Return a tuple with following content:
 
     [(0)-determ,(1)degirred,(2)degi,(3)degd,(4)dega,(5)str(choice),(6)domvec,(7)cover]
computeGoodPirlotChoices(self, Comments=False)
Characteristic values for potentially good choices
using the Pirlot fixpoint algorithm.
computeIncomparabilityDegree(self, InPercents=False, Comments=False)
Renders the incomparability degree (Decimal), i.e. the relative number of symmetric indeterminate relations of the irreflexive part of a digraph.
computeKemenyIndex(self, otherRelation)
renders the Kemeny index of the self.relation
compared with a given crisp valued relation of a compatible
other digraph (same nodes or actions).
computeKemenyOrder(self, orderLimit=7, Debug=False)
Renders a ordering from worst to best of the actions with maximal Kemeny index.
Return a tuple: kemenyOrder (from worst to best), kemenyIndex
computeKemenyRanking(self, orderLimit=7, seed=None, sampleSize=1000, Debug=False)
Renders a ranking from best to worst of the actions with maximal Kemeny index.
 
.. note::
 
     Returns a tuple: kemenyRanking (from best to worst), kemenyIndex.
computeKernelVector(self, kernel, Initial=True, Comments=False)
| Computing Characteristic values for dominant pre-kernels
| using the von Neumann dual fixpoint equation
computeKohlerOrder(self)
Renders an ordering (worst to best) of the actions following Kohler's rule.
computeKohlerRanking(self)
Renders a ranking (best to worst) of the actions following Kohler's rule.
computeMaxHoleSize(self, Comments=False)
Renders the length of the largest chordless cycle
in the corresponding disjunctive undirected graph.
computeMeanInDegree(self)
Renders the mean indegree of self.
!!! self.size must be set previously !!!
computeMeanOutDegree(self)
Renders the mean degree of self.
!!! self.size must be set previously !!!
computeMeanSymDegree(self)
Renders the mean degree of self.
!!! self.size must be set previously !!!
computeMedianOutDegree(self)
Renders the median outdegree of self.
!!! self.size must be set previously !!!
computeMedianSymDegree(self)
Renders the median symmetric degree of self.
!!! self.size must be set previously !!!
computeMoreOrLessUnrelatedPairs(self)
Renders a list of more or less unrelated pairs.
computeNetFlowsOrder(self)
Renders an ordered list (from best to worst) of the actions
following the net flows ranking rule.
computeNetFlowsOrderDict(self)
Renders an ordered list (from worst to best) of the actions
following the net flows ranking rule.
computeNetFlowsRanking(self)
Renders an ordered list (from best to worst) of the actions
following the net flows ranking rule.
computeNetFlowsRankingDict(self)
Renders an ordered list (from best to worst) of the actions
following the net flows ranking rule.
computeODistance(self, op2, comments=False)
renders the squared normalized distance of
two digraph valuations.
 
.. note::
 
     op2 = digraphs of same order as self.
computeOrbit(self, choice, withListing=False)
renders the set of isomorph copies of a choice following
the automorphism of the digraph self
computeOrderCorrelation(self, order, Debug=False)
Renders the ordinal correlation K of a digraph instance
when compared with a given linear order (from worst to best) of its actions
 
K = sum_{x != y} [ min( max(-self.relation(x,y)),other.relation(x,y), max(self.relation(x,y),-other.relation(x,y)) ]
 
K /= sum_{x!=y} [ min(abs(self.relation(x,y),abs(other.relation(x,y)) ]
 
.. note::
 
     Renders a dictionary with the key 'correlation' containing the actual bipolar correlation index and the key 'determination' containing the minimal determination level D of self and the other relation.
 
     D = sum_{x != y} min(abs(self.relation(x,y)),abs(other.relation(x,y)) / n(n-1)
 
     where n is the number of actions considered.
 
     The correlation index with a completely indeterminate relation
     is by convention 0.0 at determination level 0.0 .
 
.. warning::
 
     self must be a normalized outranking digraph instance !
computeOrdinalCorrelation(self, other, MedianCut=False, filterRelation=None, Debug=False)
Renders the bipolar correlation K of a
self.relation when compared
with a given compatible (same actions set)) digraph or
a [-1,1] valued compatible relation (same actions set).
 
If MedianCut=True, the correlation is computed on the median polarized relations.
 
If filterRelation is not None, the correlation is computed on the partial domain corresponding to the determined part of the filter relation.
 
.. warning::
 
     Notice that the 'other' relation and/or the 'filterRelation',
     the case given, must both be normalized, ie [-1,1]-valued !
 
K = sum_{x != y} [ min( max(-self.relation[x][y]),other.relation[x][y]), max(self.relation[x][y],-other.relation[x][y]) ]
 
K /= sum_{x!=y} [ min(abs(self.relation[x][y]),abs(other.relation[x][y])) ]
 
.. note::
 
     Renders a tuple with at position 0 the actual bipolar correlation index
     and in position 1 the minimal determination level D of self and
     the other relation.
 
     D = sum_{x != y} min(abs(self.relation[x][y]),abs(other.relation[x][y])) / n(n-1)
 
     where n is the number of actions considered.
 
     The correlation index with a completely indeterminate relation
     is by convention 0.0 at determination level 0.0 .
computeOrdinalCorrelationMP(self, other, MedianCut=False, Threading=False, nbrOfCPUs=None, startMethod=None, Comments=False, Debug=False)
Multi processing version of the digraphs.computeOrdinalCorrelation() method.
 
.. note::
     The relation filtering and the MedinaCut option are not implemented in the MP version.
computePairwiseClusterComparison(self, K1, K2, Debug=False)
Computes the pairwise cluster comparison credibility vector
from bipolar-valued digraph g. with K1 and K2 disjoint
lists of action keys from g actions disctionary.
Returns the dictionary
{'I': Decimal(),'P+':Decimal(),'P-':Decimal(),'R' :Decimal()}
where one and only one item is strictly positive.
computePreKernels(self)
computing dominant and absorbent preKernels:
    Result in self.dompreKernels and self.abspreKernels
computePreRankingRelation(self, preRanking, Normalized=True, Debug=False)
Renders the bipolar-valued relation obtained from
a given preRanking in decreasing levels (list of lists) result.
computePreorderRelation(self, preorder, Normalized=True, Debug=False)
Renders the bipolar-valued relation obtained from
a given preordering in increasing levels (list of lists) result.
computePrincipalOrder(self, Colwise=False, Comments=False)
Rendesr an ordering from wrost to best of the decision actions.
computePrincipalRanking(self, Colwise=False, Comments=False)
Rendesr a ranking from best to worst of the decision actions.
computePrincipalScores(self, plotFileName=None, Colwise=False, imageType=None, tempDir=None, bgcolor='cornsilk', Comments=False, Debug=False)
Renders a ordered list of the first principal eigenvector of the covariance of the valued outdegrees of self.
 
.. note::
 
   The method, relying on writing and reading temporary files by default in a temporary directory is threading and multiprocessing safe !
   (see Digraph.exportPrincipalImage method)
computePrudentBetaLevel(self, Debug=False)
computes alpha, ie the lowest valuation level, for which the
bipolarly polarised digraph doesn't contain a chordless circuit.
computeRankingByBestChoosing(self, CoDual=False, Debug=False)
Computes a weak preordering of the self.actions by recursive
best choice elagations.
 
Stores in self.rankingByBestChoosing['result'] a list of (P+,bestChoice) tuples
where P+ gives the best choice complement outranking
average valuation via the computePairwiseClusterComparison
method.
 
If self.rankingByBestChoosing['CoDual'] is True, 
the ranking-by-choosing was computed on the codual of self.
computeRankingByBestChoosingRelation(self, rankingByBestChoosing=None, Debug=False)
Renders the bipolar-valued relation obtained from
the self.rankingByBestChoosing result.
computeRankingByChoosing(self, actionsSubset=None, Debug=False, CoDual=False)
Computes a weak preordring of the self.actions by iterating
jointly first and last choice elagations.
 
Stores in self.rankingByChoosing['result'] a list of ((P+,bestChoice),(P-,worstChoice)) pairs
where P+ (resp. P-) gives the best (resp. worst) choice complement outranking
(resp. outranked) average valuation via the computePairwiseClusterComparison
method.
 
If self.rankingByChoosing['CoDual'] is True, the ranking-by-choosing was computed on the codual of self.
computeRankingByChoosingRelation(self, rankingByChoosing=None, actionsSubset=None, Debug=False)
Renders the bipolar-valued relation obtained from
the self.rankingByChoosing result.
computeRankingByLastChoosing(self, CoDual=False, Debug=False)
Computes a weak preordring of the self.actions by iterating
worst choice elagations.
 
Stores in self.rankingByLastChoosing['result'] a list of (P-,worstChoice) pairs
where P- gives the worst choice complement outranked
average valuation via the computePairwiseClusterComparison
method.
 
If self.rankingByChoosing['CoDual'] is True, the ranking-by-last-chossing 
was computed on the codual of self.
computeRankingByLastChoosingRelation(self, rankingByLastChoosing=None, Debug=False)
Renders the bipolar-valued relation obtained from
the self.rankingByLastChoosing result.
computeRankingCorrelation(self, ranking, Debug=False)
Renders the ordinal correlation K of a digraph instance
when compared with a given linear ranking of its actions
 
K = sum_{x != y} [ min( max(-self.relation(x,y)),other.relation(x,y), max(self.relation(x,y),-other.relation(x,y)) ]
 
K /= sum_{x!=y} [ min(abs(self.relation(x,y),abs(other.relation(x,y)) ]
 
.. note::
 
     Renders a tuple with at position 0 the actual bipolar correlation index
     and in position 1 the minimal determination level D of self and
     the other relation.
 
     D = sum_{x != y} min(abs(self.relation(x,y)),abs(other.relation(x,y)) / n(n-1)
 
     where n is the number of actions considered.
 
     The correlation index with a completely indeterminate relation
     is by convention 0.0 at determination level 0.0 .
computeRelationalStructure(self, Debug=False)
Renders the counted decomposition of the valued relations into
the following type of links:
gt '>', eq '=', lt '<', incomp '<>',
leq '<=', geq '>=', indeterm '?'
computeRubisChoice(self, Comments=False, _OldCoca=False, BrokenCocs=True, Threading=False, nbrOfCPUs=1)
Renders self.strictGoodChoices, self.nullChoices
self.strictBadChoices, self.nonRobustChoices.
 
.. warning::
    Changes in site the outranking digraph by
    adding or braking chordless odd outranking circuits.
computeRubyChoice(self, Comments=False, _OldCoca=False)
dummy for computeRubisChoice()
old versions compatibility.
computeShortestPathLengths(self, WeakPaths=False, Comments=False, Debug=False)
Renders a double dictionary with the directed distances, i.e. the shortest path lengths between all self.actions
 
Equals *None* if there does not exist a directed path between two actions.
 
*Source*: Claude Berge, *The Theory of Graphs*, Dover (2001) pp. 119, original in French Dunod (1958)
computeSingletonRanking(self, Comments=False, Debug=False)
Renders the sorted bipolar net determinatation of outrankingness
minus outrankedness credibilities of all singleton choices.
 
res = ((netdet,singleton,dom,absorb)+)
computeSize(self)
Renders the number of validated non reflexive arcs
computeSizeTransitiveClosure(self)
Renders the size of the transitive closure of a digraph.
computeSlaterOrder(self, isProbabilistic=False, seed=None, sampleSize=1000, Debug=False)
Reversed return from computeSlaterRanking method.
computeSlaterRanking(self, isProbabilistic=False, seed=None, sampleSize=1000, Debug=False)
Renders a ranking of the actions with minimal Slater index.
Return a tuple: slaterOrder, slaterIndex
computeSymmetryDegree(self, InPercents=False, Comments=False)
Renders the symmetry degree (Decimal) of the irreflexive part of a digraph.
 
.. note::
 
   Empty and indeterminate digraphs are considered to be symmetric.
computeTopologicalRanking(self, Debug=False)
Mimetic Wrapper of the topologicalSort() method.
computeTransitivityDegree(self, InPercents=False, Comments=False)
Renders the transitivity degree (Decimal) of a digraph.
 
.. note:: 
 
   An empty or indeterminate digraph is considered to be transitive.
computeUnrelatedPairs(self)
Renders a list of more or less unrelated pairs.
computeValuationLevels(self, choice=None, Debug=False)
renders the symmetric closure of the
apparent valuations levels of self
in an increasingly ordered list.
If parameter choice is given, the
computation is limited to the actions
of the choice.
computeValuationPercentages(self, choice, percentiles, withValues=False)
Parameters: choice and list of percentiles.
renders a series of percentages of the characteristics valuation of
the arcs in the digraph.
computeValuationPercentiles(self, choice, percentages, withValues=False)
Parameters: choice and list of percentages.
renders a series of quantiles of the characteristics valuation of
the arcs in the digraph.
computeValuationStatistics(self, Sampling=False, Comments=False)
Renders the mean and variance of the valuation
of the non reflexive pairs.
computeValuedRankingRelation(self, ranking)
Renders the valued relation characteristics compatible 
with the given linar ranking. Discordant charcateristics 
are set to the indeterminate value.
computeWeakCondorcetLosers(self)
Wrapper for weakCondorcetLosers().
computeWeakCondorcetWinners(self)
Wrapper for weakCondorcetWinners().
computeupdown1(self, s, S)
Help method for show_MIS_HB2 method.
fills self.newmisset, self.upmis, self.downmis.
computeupdown2(self, s, S)
Help method for show_MIS_HB1 method.
Fills self.newmisset, self.upmis, self.downmis.
computeupdown2irred(self, s, S)
Help method for show_MIS_HB1 method.
Fills self.newmisset, self.upmis, self.downmis.
condorcetLosers(self)
Renders the set of decision actions x such that
self.relation[x][y] < self.valuationdomain['med']
for all y != x.
condorcetWinners(self)
Renders the set of decision actions x such that
self.relation[x][y] > self.valuationdomain['med']
for all y != x.
contra(self, v)
Parameter: choice.
Renders the negation of a choice v characteristic's vector.
convertRelationToDecimal(self)
Converts the float valued self.relation in a decimal valued one.
convertValuation2Integer(self, InSite=True, Comments=False)
Converts the self.relation valuation to integer values by converting the Decimals to Fractions and multiply by the least commun multiple of the fraction denominators.
 
*Parameters*:
 
    - If *Insite* == False (True by default) the method returns a modified copy of self.relation without altering the original self.relation, otherwise self.relation and self.valuationdomain is modified.
convertValuationToDecimal(self)
Convert the float valuation limits to Decimals.
coveringIndex(self, choice, direction='out')
Renders the covering index of a given choice in a set of objects,
ie the minimum number of choice members that cover each
non selected object.
crispKDistance(self, digraph, Debug=False)
Renders the crisp Kendall distance between two bipolar valued
digraphs.
 
.. warning::
 
     Obsolete! Is replaced by the self.computeBipolarCorrelation(other, MedianCut=True) Digraph method
detectChordlessCircuits(self, Comments=False, Debug=False)
Detects a chordless circuit in a digraph.
Returns a Boolean
detectChordlessPath(self, Pk, n2, Comments=False, Debug=False)
New procedure from Agrum study April 2009
recursive chordless path extraction starting from path
Pk = [n2, ...., n1] and ending in node n2.
Optimized with marking of visited chordless P1s.
determinateness(self, vec, inPercent=True)
Renders the determinateness of a characteristic vector *vec* = 
[(r(x),x),(r(y),y), ...] of length *n* in valuationdomain [Min,Med,Max]:
 
*result* =  sum_x( abs(r(x)-Med) ) / ( n*(Max-Med) )
 
If inPercent, *result* shifted (+1) and reduced (/2) to [0,1] range.
digraph2Graph(self, valuationDomain={'min': -1, 'med': 0, 'max': 1}, Debug=False, ConjunctiveConversion=True)
Convert a Digraph instance to a Graph instance.
dneighbors(self, node)
Renders the set of dominated out-neighbors of a node.
domin(self, choice)
Renders the dominance degree of a choice.
dominantChoices(self, S)
Generates all minimal dominant choices of a bipolar valued digraph.
 
.. note::
 
     Initiate with S = self.actions.copy().
domirred(self, choice)
Renders the crips +irredundance degree of a choice.
domirredval(self, choice, relation)
Renders the valued +irredundance degree of a choice.
domirredx(self, choice, x)
Renders the crips +irredundance degree of node x in a choice.
domkernelrestrict(self, prekernel)
Parameter: dominant prekernel
Renders dominant prekernel restricted relation.
exportGraphViz(self, fileName=None, actionsSubset=None, bestChoice=set(), worstChoice=set(), firstChoice=set(), lastChoice=set(), Comments=True, graphType='png', pictureFormat=None, graphSize='7,7', relation=None, bgcolor='cornsilk')
export GraphViz dot file  for graph drawing filtering.
exportPrincipalImage(self, plotFileName=None, pictureFormat='pdf', bgcolor='cornsilk', fontcolor='red3', fontsize='0.75', Reduced=False, Colwise=False, tempDir='.', Comments=False)
Export as PDF (default) the principal projection of
the valued relation using the three principal eigen vectors.
 
Implemeted picture formats are: 
'pdf' (default), 'png', 'jpeg' and 'xfig'.
 
The background color is set by default to 'cornsilk'. 
 
Font size and color are set by default to 'red3', resp. '0.75'. 
 
When *Reduced==True*, the valued relation characeteristics are centered and reduced.
 
When *Colwise==True*, the column vectors of the adjacency table are used for the principal projection, otherwise the rows (default) are used. Has no incidence when the *Digraph* instance *self*  is symmetric. 
 
.. warning::
 
    The method, writing and reading temporary files: 
    tempCol.r and rotationCol.csv, resp. tempRow.r and rotationRow.csv,
    by default in the working directory (./),
    is hence not safe for multiprocessing programs, unless a
    temporary directory *tempDir* is provided.
flatChoice(self, ch, Debug=False)
Converts set or list ch recursively to a flat list of items.
forcedBestSingleChoice(self)
Renders the set of most determined outranking singletons in self.
gammaSets(self)
Renders the dictionary of neighborhoods {node: (dx,ax)}
with set *dx* gathering the dominated, and set *ax* gathering
the absorbed neighborhood.
generateAbsPreKernels(self)
Generate all absorbent prekernels from independent choices generator.
generateDomPreKernels(self)
Generate all dominant prekernels from independent choices generator.
htmlChoiceVector(self, ch, ChoiceVector=True, choiceType='good')
Show procedure for annotated bipolar choices.
inDegrees(self)
renders the median cut indegrees
inDegreesDistribution(self)
Renders the distribution of indegrees.
independentChoices(self, U)
Generator for all independent choices with neighborhoods of a bipolar valued digraph:
 
.. note::
 
       * Initiate with U = self.singletons().
       * Yields [(independent choice, domnb, absnb, indnb)].
inner_prod(self, v1, v2)
Parameters: two choice characteristic vectors
Renders the inner product of two characteristic vetors.
intstab(self, choice)
Computes the independence degree of a choice.
irreflex(self, mat)
Puts diagonal entries of mat to valuationdomain['min']
isAsymmetricIndeterminate(self, Debug=False)
Checks the self.relation for assymmetric indeterminateness!!
 
.. warning::
 
    The reflexive links are ignored !!
isComplete(self, Debug=False)
checks the completeness property of self.relation by checking
for the absence of a link between two actions!!
 
.. warning::
 
    The reflexive links are ignored !!
isCyclic(self, Debug=False)
checks the cyclicity of self.relation by checking
for a reflexive loop in its transitive closure-
 
.. warning::
 
     self.relation is supposed to be irreflexive !
isIntegerValued(self, Debug=False)
Checks whether the decimal valuation of self is integer-valued
be using the as_integer_ratio() method of a Decimal 
giving a tuple (numerator,denominator). If denominator == 1, the
number is an integer.
isOutrankingDigraph(self, Comments=True, Debug=False)
Checks the outranking digraph characteristic condition (3.3).
 
relation[x][y] + relation[y][x)[y] >= 0.0
 
.. warning::
 
    The reflexive links are ignored and the valuation must be bipolar !!
isStrictOutrankingDigraph(self, Comments=True, Debug=False)
Checks the strict outranking digraph characteristic condition (3.1).
 
-(relation[x][y] + relation[y][x]) <= 0.0 , x != y
 
.. warning::
 
    The reflexive links are ignored and the valuation must be bipolar !!
isSymmetric(self, Comments=False)
True if symmetry degree == 1.0.
isTransitive(self, Comments=False)
True if transitivity degree == 1.0.
isWeaklyComplete(self, Debug=False)
checks the weakly completeness property of self.relation by checking
for the absence of a link between two actions!!
 
.. warning::
 
    The reflexive links are ignored !!
iterateRankingByChoosing(self, Odd=False, CoDual=False, Comments=True, Debug=False, Limited=None)
Renders a ranking by choosing result when progressively eliminating
all chordless (odd only) circuits with rising valuation cut levels.
 
Parameters
    CoDual = False (default)/True
    Limited = proportion (in [0,1]) * (max - med) valuationdomain
kChoices(self, A, k)
Renders all choices of length k from set A
matmult2(self, m, v)
Parameters: digraph relation and choice characteristic vector
matrix multiply vector by inner production
meanDegree(self)
Renders the mean degree of self.
!!! self.size must be set previously !!!
meanLength(self, Oriented=False)
Renders the (by default non-oriented) mean neighbourhoor depth of self.
!!! self.order must be set previously !!!
minimalChoices(self, S)
Generates all dominant or absorbent choices of a bipolar
valued digraph.
 
.. note:
 
   * Initiate with S = (actions, dict of dominant or absorbent closed neighborhoods)
   * See showMinDom and showMinAbs methods.
minimalValuationLevelForCircuitsElimination(self, Odd=True, Debug=False, Comments=False)
renders the minimal valuation level <lambda> that eliminates all
self.circuitsList stored odd chordless circuits from self.
 
.. warning::
 
    The <lambda> level polarised may still contain newly appearing chordless odd circuits !
neighbourhoodCollection(self, Oriented=False, Potential=False)
Renders the neighbourhood.
neighbourhoodDepthDistribution(self, Oriented=False)
Renders the distribtion of neighbourhood depths.
notGammaSets(self)
Renders the dictionary of neighborhoods {node: (dx,ax)}
with set *dx* gathering the not dominated, and set *ax* gathering
the not absorbed neighborhood.
notaneighbors(self, node)
Renders the set of absorbed not in-neighbors of a node.
notdneighbors(self, node)
Renders the set of not dominated out-neighbors of a node.
outDegrees(self)
renders the median cut outdegrees
outDegreesDistribution(self)
Renders the distribution of outdegrees.
plusirredundant(self, U)
Generates all +irredundant choices of a digraph.
powerset(self, U)
Generates all subsets of a set.
readPerrinMisset(self, file='curd.dat')
read method for 0-1-char-coded MISs by default from the perrinMIS.c curd.dat result file.
readabsvector(self, x, relation)
Parameter: action x
absorbent in vector.
readdomvector(self, x, relation)
Parameter: action x
dominant out vector.
recodeValuation(self, newMin=-1.0, newMax=1.0, ndigits=4, Debug=False)
Recodes the characteristic valuation domain according
to the parameters given. 
 
*ndigits* indicates the number of decimal digits of the valuation.
relationFct(self, x, y)
wrapper for self.relation dictionary access to ensure interoperability
with the sparse and big outranking digraph implementation model.
save(self, fileName='tempdigraph', option=None, DecimalValuation=True, decDigits=2)
Persistent storage of a Digraph class instance in the form of
a python source code file
saveCSV(self, fileName='tempdigraph', Normalized=False, Dual=False, Converse=False, Diagonal=False, Debug=False)
Persistent storage of a Digraph class instance in the form of
a csv file.
saveXMCDA2(self, fileName='temp', fileExt='xmcda2', Comments=True, relationName='R', relationType='binary', category='random', subcategory='valued', author='digraphs Module (RB)', reference='saved from Python', valuationType='standard', digits=2, servingD3=False)
save digraph in XMCDA 2.0 format. Deprecated now.
savedre(self, fileName='temp')
save digraph in nauty format.
sharp(self, x, y)
Paramaters: choice characteristic values.
Renders the sharpest of two characteristic values x and y.
sharpvec(self, v, w)
Paramaters: choice characteristic vectors.
Renders the sharpest of two characteristic vectors v and w.
showActions(self)
presentation methods for digraphs actions
showAll(self)
Detailed show method for genuine digraphs.
showAttributes(self)
Prints out the attributes of self.
showAutomorphismGenerators(self)
Renders the generators of the automorphism group.
showBadChoices(self, Recompute=True)
Characteristic values for potentially bad choices.
showBestChoiceRecommendation(self, Verbose=False, Comments=True, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True)
Shows the RuBis best choice recommendation.
 
.. note::
 
    Computes by default the Rubis best choice recommendation on the corresponding strict (codual) outranking digraph.
 
    By default, with BrokenCocs=True, we brake all chordless circuits at their weakest determined ( abs(r(x>y)) + abs(r(y>x)) ) link.
 
    When BrokenCocs=False we proceed like follows:
 
    In case of chordless circuits, if supporting arcs are more credible
    than the reversed negating arcs, we collapse the circuits into hyper nodes.
    Inversely,  if supporting arcs are not more credible than the reversed negating arcs,
    we brake the circuits on their weakest arc.
 
Usage example:
 
>>> from outrankingDigraphs import *
>>> t = Random3ObjectivesPerformanceTableau(seed=5)
>>> g = BipolarOutrankingDigraph(t)
>>> g.showBestChoiceRecommendation()
***********************
RuBis Best Choice Recommendation (BCR)
(in decreasing order of determinateness)   
Credibility domain:  [-100.0, 100.0]
=== >> potential first choices
* choice              : ['a04', 'a14', 'a19', 'a20']
   independence        : 1.19
   dominance           : 4.76
   absorbency          : -59.52
   covering (%)        : 75.00
   determinateness (%) : 57.86
   - most credible action(s) = { 'a14': 23.81, 'a19': 11.90, 'a04': 2.38, 'a20': 1.19, }  
=== >> potential last choices 
* choice              : ['a03', 'a12', 'a17']
  independence        : 4.76
  dominance           : -76.19
  absorbency          : 4.76
  covering (%)        : 0.00
  determinateness (%) : 65.39
  - most credible action(s) = { 'a03': 38.10, 'a12': 13.10, 'a17': 4.76, }
Execution time: 0.024 seconds
*****************************
showChoiceVector(self, ch, choiceType='good', ChoiceVector=True)
Show procedure for annotated bipolar choices.
showChordlessCircuits(self, Recompute=False)
Show method for chordless circuits observed in a Digraph instance.
 
If previous computation is required, stores the detected circuits in self.circuitsList attribute.
showComponents(self)
Shows the list of connected components of the digraph instance.
showCorrelation(self, corr=None, ndigits=3)
Renders the valued ordinal correlation index, the crisp Kendall tau index and their epistemic determination degree.
showFirstChoiceRecommendation(self, Verbose=False, Comments=True, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True)
Shows the RuBis first choice recommendation.
 
.. note::
 
    Computes by default the Rubis first choice recommendation on the corresponding strict (codual) outranking digraph.
 
    By default, with BrokenCocs=True, we brake all chordless circuits at their weakest determined ( abs(r(x>y)) + abs(r(y>x)) ) link.
 
    When BrokenCocs=False we proceed like follows:
 
    In case of chordless circuits, if supporting arcs are more credible
    than the reversed negating arcs, we collapse the circuits into hyper nodes.
    Inversely,  if supporting arcs are not more credible than the reversed negating arcs,
    we brake the circuits on their weakest arc.
 
Usage example:
 
>>> from outrankingDigraphs import *
>>> t = Random3ObjectivesPerformanceTableau(seed=5)
>>> g = BipolarOutrankingDigraph(t)
>>> g.showFirstChoiceRecommendation()
***********************
RuBis First Choice Recommendation (BCR)
(in decreasing order of determinateness)   
Credibility domain:  [-100.0, 100.0]
=== >> potential first choices
* choice              : ['a04', 'a14', 'a19', 'a20']
   independence        : 1.19
   dominance           : 4.76
   absorbency          : -59.52
   covering (%)        : 75.00
   determinateness (%) : 57.86
   - most credible action(s) = { 'a14': 23.81, 'a19': 11.90, 'a04': 2.38, 'a20': 1.19, }  
=== >> potential last choices 
* choice              : ['a03', 'a12', 'a17']
  independence        : 4.76
  dominance           : -76.19
  absorbency          : 4.76
  covering (%)        : 0.00
  determinateness (%) : 65.39
  - most credible action(s) = { 'a03': 38.10, 'a12': 13.10, 'a17': 4.76, }
Execution time: 0.024 seconds
*****************************
showGoodChoices(self, Recompute=True)
Characteristic values for potentially good choices.
showHTMLBestChoiceRecommendation(self, pageTitle=None, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True, htmlFileName=None)
showHTMLRelationHeatmap(self, actionsList=None, rankingRule='NetFlows', colorLevels=7, tableTitle='Relation Heatmap', relationName='r(x S y)', ndigits=2, fromIndex=None, toIndex=None, htmlFileName=None)
Launches a browser window with the colored relation map of self.
 
See corresponding :py:class:`~digraphs.Digraph.showHTMLRelationMap` method.
 
The *colorLevels* parameter may be set to 3, 5, 7 (default) or 9.
 
When the *actionsList* parameter is *None* (default), the digraphs actions list may be ranked with the *rankingRule* parameter set to the 'Copeland' (default) or to the 'Netlows' ranking rule.
 
When the *htmlFileName* parameter is set to a string value 'xxx', a html file named 'xxx.html' will be generated in the current working directory. Otherwise, a temporary file named 'tmp*.html' will be generated there.
 
Example::
 
    >>> from outrankingDigraphs import *
    >>> t = RandomCBPerformanceTableau(numberOfActions=25,seed=1)
    >>> g = BipolarOutrankingDigraph(t,ndigits=2)
    >>> gcd = ~(-g)  # strict outranking relation
    >>> gcd.showHTMLRelationHeatmap(colorLevels=7,ndigits=2)
    
.. image:: relationHeatmap.png
   :alt: Browser view of a relation map
   :width: 600 px
   :align: center
showHTMLRelationMap(self, actionsList=None, rankingRule='Copeland', Colored=True, tableTitle='Relation Map', relationName='r(x S y)', symbols=['+', '&middot;', '&nbsp;', '&#150;', '&#151'], fromIndex=None, toIndex=None, htmlFileName=None)
Launches a browser window with the colored relation map of self.
See corresponding Digraph.showRelationMap() method.
 
When *htmlFileName* parameter is set to a string value, a html file
with that name will be stored in the current working directory.
 
By default, a temporary file named: tmp*.html will be generated
instead in the current working directory.
 
Example::
 
    >>> from outrankingDigraphs import *
    >>> t = RandomCBPerformanceTableau(numberOfActions=25,seed=1)
    >>> g = BipolarOutrankingDigraph(t,Normalized=True)
    >>> gcd = ~(-g)  # strict outranking relation
    >>> gcd.showHTMLRelationMap(rankingRule="NetFlows")
    
.. image:: relationMap.png
   :alt: Browser view of a relation map
   :width: 600 px
   :align: center
showHTMLRelationTable(self, actionsList=None, relation=None, IntegerValues=False, ndigits=2, Colored=True, tableTitle='Valued Adjacency Matrix', relationName='r(x S y)', ReflexiveTerms=False, htmlFileName=None, fromIndex=None, toIndex=None)
Launches a browser window with the colored relation table of self.
showMIS(self, withListing=True)
Prints all maximal independent choices:
    Result in self.misset.
showMIS_AH(self, withListing=True)
Prints all MIS using the Hertz method.
 
Result saved in self.hertzmisset.
showMIS_HB2(self, withListing=True)
Prints all MIS using the Hertz-Bisdorff method.
 
Result saved in self.newmisset.
showMIS_RB(self, withListing=True)
Prints all MIS using the Bisdorff method.
 
Result saved in self.newmisset.
showMIS_UD(self, withListing=True)
Prints all MIS using the Hertz-Bisdorff method.
 
Result saved in self.newmisset.
showMaxAbsIrred(self, withListing=True)
Computing maximal -irredundant choices:
    Result in self.absirset.
showMaxDomIrred(self, withListing=True)
Computing maximal +irredundant choices:
   Result in self.domirset.
showMinAbs(self, withListing=True)
Prints minimal absorbent choices:
    Result in self.absset.
showMinDom(self, withListing=True)
Prints all minimal dominant choices:
    Result in self.domset.
showNeighborhoods(self)
Lists the gamma and the notGamma function of self.
showOrbits(self, InChoices, withListing=True)
Prints the orbits of Choices along the automorphisms of
the Digraph instance.
 
Example Python session for computing the non isomorphic MISs from the 12-cycle graph:
 
>>> from digraphs import *
>>> c12 = CirculantDigraph(order=12,circulants=[1,-1])
>>> c12.automorphismGenerators()
...
  Permutations
  {'1': '1', '2': '12', '3': '11', '4': '10', '5': 
   '9', '6': '8', '7': '7', '8': '6', '9': '5', '10': 
   '4', '11': '3', '12': '2'}
  {'1': '2', '2': '1', '3': '12', '4': '11', '5': '10', 
   '6': '9', '7': '8', '8': '7', '9': '6', '10': '5', 
   '11': '4', '12': '3'}
  Reflections {}
>>> print('grpsize = ', c12.automorphismGroupSize)
  grpsize = 24
>>> c12.showMIS(withListing=False)
  *---  Maximal independent choices ---*
  number of solutions:  29
  cardinality distribution
  card.:  [0, 1, 2, 3, 4,  5,  6, 7, 8, 9, 10, 11, 12]
  freq.:  [0, 0, 0, 0, 3, 24,  2, 0, 0, 0,  0,  0,  0]
  Results in c12.misset
>>> c12.showOrbits(c12.misset,withListing=False)
...
  *---- Global result ----
  Number of MIS:  29
  Number of orbits :  4
  Labelled representatives:
  1: ['2','4','6','8','10','12']
  2: ['2','5','8','11']
  3: ['2','4','6','9','11']
  4: ['1','4','7','9','11']
  Symmetry vector
  stabilizer size: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, ...]
  frequency      : [0, 2, 0, 0, 0, 0, 0, 1, 0,  0,  0,  1, ...]
 
*Figure*: The symmetry axes of the non isomorphic MISs of the 12-cycle:
 
.. image:: c12.png
   :width: 400 px
   :align: center
   :alt: The 4 non isomorphic MIS of the 12-cycle graph
 
*Reference*: R. Bisdorff and J.L. Marichal (2008). Counting non-isomorphic maximal independent sets of the n-cycle graph. *Journal of Integer Sequences*, Vol. 11 Article 08.5.7 (`openly accessible here <https://www.cs.uwaterloo.ca/journals/JIS/VOL11/Marichal/marichal.html>`_)
showOrbitsFromFile(self, InFile, withListing=True)
Prints the orbits of Choices along the automorphisms of
the digraph self by reading in the 0-1 misset file format.
See the :py:func:`digraphs.Digraph.readPerrinMisset` method.
showPreKernels(self, withListing=True)
Printing dominant and absorbent preKernels:
    Result in self.dompreKernels and self.abspreKernels
showRankingByBestChoosing(self, rankingByBestChoosing=None)
A show method for self.rankinByBestChoosing result.
 
.. warning::
 
     The self.computeRankingByBestChoosing(CoDual=False/True) method instantiating the self.rankingByBestChoosing slot is pre-required !
showRankingByChoosing(self, rankingByChoosing=None, WithCoverCredibility=False)
A show method for self.rankinByChoosing result.
 
When parameter *WithCoverCredibility* is set to True, the credibility of outranking, respectively being outranked is indicated at each selection step. 
 
.. warning::
 
     The self.computeRankingByChoosing(CoDual=False/True) method instantiating the self.rankingByChoosing slot is pre-required !
showRankingByLastChoosing(self, rankingByLastChoosing=None, Debug=None)
A show method for self.rankinByChoosing result.
 
.. warning::
 
     The self.computeRankingByLastChoosing(CoDual=False/True) method instantiating the self.rankingByChoosing slot is pre-required !
showRelation(self)
prints the relation valuation in ##.## format.
showRelationMap(self, symbols=None, rankingRule='Copeland', fromIndex=None, toIndex=None, actionsList=None)
Prints on the console, in text map format, the location of
certainly validated and certainly invalidated outranking situations.
 
By default, symbols = {'max':'┬','positive': '+', 'median': ' ',
                       'negative': '-', 'min': '┴'}
 
The default ordering of the output is following the Copeland ranking rule
from best to worst actions. Further available ranking rule is the 'NetFlows' net flows rule.
 
 
Example::
 
    >>> from outrankingDigraphs import *
    >>> t = RandomCBPerformanceTableau(numberOfActions=25,seed=1)
    >>> g = BipolarOutrankingDigraph(t,Normalized=True)
    >>> gcd = ~(-g)  # strict outranking relation
    >>> gcd.showRelationMap(rankingRule="NetFlows")
     -   ++++++++  +++++┬+┬┬+
    - -   + +++++ ++┬+┬+++┬++
    ┴+  ┴ + ++  ++++┬+┬┬++┬++
    -   ++ - ++++-++++++┬++┬+
       - - - ++- ┬- + -+┬+-┬┬
    -----  -      -┬┬┬-+  -┬┬
    ----    --+-+++++++++++++
    -- --+- --++ ++ +++-┬+-┬┬
    ----  -  -+-- ++--+++++ +
    ----- ++- --- +---++++┬ +
    -- -- ---+ -++-+++-+ +-++
    -- --┴---+  + +-++-+ -  +
    ---- ┴---+-- ++--++++ - +
      --┴┴--  --- -  --+ --┬┬
     ---------+--+ ----- +-┬┬
    -┴---┴- ---+- + ---+++┬ +
    -┴┴--┴---+--- ++ -++--+++
    -----┴--- ---+-+- ++---+ 
    -┴┴--------------- --++┬ 
    --┴---------------- --+┬ 
    ┴--┴┴ -┴--┴┴-┴ --++  ++-+
    ----┴┴--------------- -  
    ┴┴┴----+-┴+┴---┴-+---+ ┴+
    ┴┴-┴┴┴-┴- - -┴┴---┴┴+ ┬ -
    ----┴┴-┴-----┴┴---  - -- 
    Ranking rule: NetFlows
    >>>
showRelationTable(self, Sorted=True, rankingRule=None, IntegerValues=False, actionsSubset=None, relation=None, ndigits=2, ReflexiveTerms=True, fromIndex=None, toIndex=None)
Prints the relation valuation in actions X actions table format.
Copeland and NetFlows rankings my be used.
showRubisBestChoiceRecommendation(self, **kwargs)
Dummy for backward portable showBestChoiceRecommendation().
showRubyChoice(self, Verbose=False, Comments=True, _OldCoca=True)
Dummy for showBestChoiceRecommendation()
needed for older versions compatibility.
showShort(self)
concise presentation method for genuine digraphs.
showSingletonRanking(self, Comments=True, Debug=False)
Calls self.computeSingletonRanking(comments=True,Debug = False).
Renders and prints the sorted bipolar net determinatation of outrankingness
minus outrankedness credibilities of all singleton choices.
 
res = ((netdet,sigleton,dom,absorb)+)
showStatistics(self)
Computes digraph statistics like order, size and arc-density.
showdre(self)
Shows relation in nauty format.
singletons(self)
list of singletons and neighborhoods
[(singx1, +nx1, -nx1, not(+nx1 or -nx1)),.... ]
sizeSubGraph(self, choice)
Output: (size, undeterm,arcDensity).
Renders the arc density of the induced subgraph.
strongComponents(self, setPotential=False)
Renders the set of strong components of self.
symDegreesDistribution(self)
Renders the distribution of symmetric degrees.
topologicalSort(self, Debug=False)
If self is acyclic, adds topological sort number to each node of self
and renders ordered list of nodes. Otherwise renders None.
Source: M. Golumbic Algorithmic Graph heory and Perfect Graphs,
Annals Of Discrete Mathematics 57 2nd Ed. , Elsevier 2004, Algorithm 2.4 p.44.
weakAneighbors(self, node)
Renders the set of absorbed in-neighbors of a node.
weakCondorcetLosers(self)
Renders the set of decision actions x such that
self.relation[x][y] <= self.valuationdomain['med']
for all y != x.
weakCondorcetWinners(self)
Renders the set of decision actions x such that
self.relation[x][y] >= self.valuationdomain['med']
for all y != x.
weakDneighbors(self, node)
Renders the set of dominated out-neighbors of a node.
weakGammaSets(self)
Renders the dictionary of neighborhoods {node: (dx,ax)}
zoomValuation(self, zoomFactor=1.0)
Zooms in or out, depending on the value of the zoomFactor provided,
the bipolar valuation of a digraph.

Data descriptors inherited from Digraph:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class EquivalenceDigraph(Digraph)
    EquivalenceDigraph(d1, d2, Debug=False)
 
Instantiates the logical equivalence digraph of two bipolar
digraphs d1 and d2 of same order. Returns None if d1 and d2 are of different order
 
 
Method resolution order:
EquivalenceDigraph
Digraph
builtins.object

Methods defined here:
__init__(self, d1, d2, Debug=False)
Initialize self.  See help(type(self)) for accurate signature.
computeCorrelation(self)
Renders a dictionary with slots: 'correlation' (tau) and 'determination' (d),
representing the ordinal correlation
between the two digraphs *d1* and *d2* given as arguments 
to the EquivalenceDigraph constructor. 
 
See the corresponding advanced topic in the Digraph3 documentation.

Methods inherited from Digraph:
MISgen(self, S, I)
generator of maximal independent choices (voir Byskov 2004):
    * S ::= remaining nodes;
    * I ::= current independent choice
 
.. note::
 
        Inititalize: self.MISgen(self.actions.copy(),set())
__invert__(self)
Make the inverting operator ~self available for Digraph instances. 
 
Returns a ConverseDigraph instance of self.
__neg__(self)
Make the negation operator -self available for Digraph instances. 
 
Returns a DualDigraph instance of self.
__repr__(self)
Default presentation method for Digraph instances.
absirred(self, choice)
Renders the crips -irredundance degree of a choice.
absirredundant(self, U)
Generates all -irredundant choices of a digraph.
absirredval(self, choice, relation)
Renders the valued -irredundance degree of a choice.
absirredx(self, choice, x)
Computes the crips -irredundance degree of node x in a choice.
abskernelrestrict(self, prekernel)
Parameter: prekernel
Renders absorbent prekernel restricted relation.
absorb(self, choice)
Renders the absorbency degree of a choice.
absorbentChoices(self, S)
Generates all minimal absorbent choices of a bipolar valued digraph.
addValuationAttribute(self)
Adds the numpy valuation attribute
agglomerationDistribution(self)
Output: aggloCoeffDistribution, meanCoeff
Renders the distribution of agglomeration coefficients.
aneighbors(self, node)
Renders the set of absorbed in-neighbors of a node.
automorphismGenerators(self)
Adds automorphism group generators to the digraph instance.
 
.. note::
 
    Dependency: Uses the dreadnaut command from the nauty software package. See https://www3.cs.stonybrook.edu/~algorith/implement/nauty/implement.shtml
 
    On Ubuntu Linux:
      ...$ sudo apt-get install nauty
averageCoveringIndex(self, choice, direction='out')
Renders the average covering index of a given choice in a set of objects,
ie the average number of choice members that cover each
non selected object.
bipolarKCorrelation(self, digraph, Debug=False)
Renders the bipolar Kendall correlation between two bipolar valued
digraphs computed from the average valuation of the
XORDigraph(self,digraph) instance.
 
.. warning::
 
     Obsolete! Is replaced by the self.computeBipolarCorrelation(other) Digraph method
bipolarKDistance(self, digraph, Debug=False)
Renders the bipolar crisp Kendall distance between two bipolar valued
digraphs.
 
.. warning::
 
     Obsolete! Is replaced by the self.computeBipolarCorrelation(other, MedianCut=True) Digraph method
chordlessPaths(self, Pk, n2, Odd=False, Comments=False, Debug=False)
New procedure from Agrum study April 2009
recursive chordless path extraction starting from path
Pk = [n2, ...., n1] and ending in node n2.
Optimized with marking of visited chordless P1s.
circuitAverageCredibility(self, circ)
Renders the average linking credibility of a Chordless Circuit.
circuitCredibilities(self, circuit, Debug=False)
Renders the average linking credibilities and the minimal link of a Chordless Circuit.
circuitMaxCredibility(self, circ)
Renders the maximal linking credibility of a Chordless Circuit.
circuitMinCredibility(self, circ)
Renders the minimal linking credibility of a Chordless Circuit.
closeSymmetric(self, InSite=True)
Produces the symmetric closure of self.relation.
closeTransitive(self, Reverse=False, InSite=True, Comments=False)
Produces the transitive closure of self.relation
 
*Parameters*:
 
    - If *Reverse* == True (False default) all transitive links are dropped, otherwise all transitive links are closed with min[r(x,y),r(y,z)];
    - If *Insite* == False (True by default) the methods return a modified copy of self.relation without altering the original self.relation, otherwise self.relation is modified.
components(self)
Renders the list of connected components.
computeAllDensities(self, choice=None)
parameter: choice in self
renders six densitiy parameters:
arc density, double arc density,
single arc density, strict single arc density,
absence arc density, strict absence arc densitiy.
computeArrowRaynaudOrder(self)
Renders a linear ordering from worst to best of the actions following Arrow&Raynaud's rule.
computeArrowRaynaudRanking(self)
renders a linear ranking from best to worst of the actions following Arrow&Raynaud's rule.
computeAverageValuation(self)
Computes the bipolar average correlation between
self and the crisp complete digraph of same order
of the irreflexive and determined arcs of the digraph
computeBadChoices(self, Comments=False)
Computes characteristic values for potentially bad choices.
 
.. note::
 
     Returns a tuple with following content:
 
     [(0)-determ,(1)degirred,(2)degi,(3)degd,(4)dega,(5)str(choice),(6)absvec]
computeBadPirlotChoices(self, Comments=False)
Characteristic values for potentially bad choices
using the Pirlot's fixpoint algorithm.
computeBestChoiceRecommendation(self, Verbose=False, Comments=False, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True)
Sets self.bestChoice, self.bestChoiceData, self.worstChoice and self.worstChoiceData
with the showBestChoiceRecommendation method.
 
First and last choices data is the following:
[(0)-determ,(1)degirred,(2)degi,(3)degd,(4)dega,(5)str(choice),(6)domvec,(7)cover]
 
self.bestChoice = self.bestChoiceData[5]
self.worstChoice = self.worstChoiceData[5]
computeBipolarCorrelation(self, other, MedianCut=False, filterRelation=None, Debug=False)
obsolete: dummy replacement for Digraph.computeOrdinalCorrelation method
computeChordlessCircuits(self, Odd=False, Comments=False, Debug=False)
Renders the set of all chordless circuits detected in a digraph.
Result is stored in <self.circuitsList>
holding a possibly empty list of tuples with at position 0 the
list of adjacent actions of the circuit and at position 1
the set of actions in the stored circuit.
 
When *Odd* is True, only chordless circuits with an odd length
are collected.
computeChordlessCircuitsMP(self, Odd=False, Threading=False, nbrOfCPUs=None, startMethod=None, Comments=False, Debug=False)
Multiprocessing version of computeChordlessCircuits().
 
Renders the set of all chordless odd circuits detected in a digraph.
Result (possible empty list) stored in <self.circuitsList>
holding a possibly empty list tuples with at position 0 the
list of adjacent actions of the circuit and at position 1
the set of actions in the stored circuit.
Inspired by Dias, Castonguay, Longo, Jradi, Algorithmica (2015).
 
Returns a possibly empty list of tuples (circuit,frozenset(circuit)).
 
If Odd == True, only circuits of odd length are retained in the result.
computeCoSize(self)
Renders the number of non validated non reflexive arcs
computeConcentrationIndex(self, X, N)
Renders the Gini concentration index of the X serie.
N contains the partial frequencies.
Based on the triangle summation formula.
computeConcentrationIndexTrapez(self, X, N)
Renders the Gini concentration index of the X serie.
N contains the partial frequencies.
Based on the triangles summation formula.
computeCondorcetLosers(self)
Wrapper for condorcetLosers().
computeCondorcetWinners(self)
Wrapper for condorcetWinners().
computeCopelandOrder(self)
renders a linear ordering from worst to best of the actions following Arrow&Raynaud's rule.
computeCopelandRanking(self)
renders a linear ranking from best to worst of the actions following Arrow&Raynaud's rule.
computeCutLevelDensities(self, choice, level)
parameter: choice in self, robustness level
renders three robust densitiy parameters:
robust double arc density,
robust single arc density,
robust absence arc densitiy.
computeDensities(self, choice)
parameter: choice in self
renders the four densitiy parameters:
arc density, double arc density, single arc density, absence arc density.
computeDeterminateness(self, InPercents=False)
Computes the Kendalll distance of self
with the all median-valued indeterminate digraph of order n.
 
Return the average determination of the irreflexive part of the digraph.
 
*determination* = sum_(x,y) { abs[ r(xRy) - Med ] } / n(n-1)
 
If *InPercents* is True, returns the average determination in percentage of
(Max - Med) difference.
 
>>> from outrankingDigraphs import BipolarOutrankingDigraph
>>> from randomPerfTabs import Random3ObjectivesPerformanceTableau
>>> t = Random3ObjectivesPerformanceTableau(numberOfActions=7,numberOfCriteria=7,seed=101)
>>> g = BipolarOutrankingDigraph(t,Normalized=True)
>>> g
*------- Object instance description ------*
Instance class      : BipolarOutrankingDigraph
Instance name       : rel_random3ObjectivesPerfTab
Actions             : 7
Criteria            : 7
Size                : 27
Determinateness (%) : 65.67
Valuation domain    : [-1.00;1.00]
>>> print(g.computeDeterminateness())
0.3134920634920634920634920638
>>> print(g.computeDeterminateness(InPercents=True))
65.67460317460317460317460320
>>> g.recodeValuation(0,1)
>>> g
*------- Object instance description ------*
Instance class      : BipolarOutrankingDigraph
Instance name       : rel_random3ObjectivesPerfTab
Actions             : 7
Criteria            : 7
Size                : 27
Determinateness (%) : 65.67
Valuation domain    : [0.00;1.00]
>>> print(g.computeDeterminateness())
0.1567460317460317460317460318
>>> print(g.computeDeterminateness(InPercents=True))
65.67460317460317460317460320
computeDiameter(self, Oriented=True)
Renders the (by default oriented) diameter of the digraph instance
computeDigraphCentres(self, WeakDistances=False, Comments=False)
The centers of a digraph are the nodes with finite minimal shortes path lengths.
 
The maximal neighborhood distances are stored in *self.maximalNeighborhoodDistances*.
 
The corresponding digraph radius and diameter are stored respectively  in *self.radius* and *self.diameter*.
 
With *Comments* = True, all these results are printed out.
 
*Source*: Claude Berge, *The Theory of Graphs*, Dover (2001) pp. 119, original in French Dunod (1958)
computeDynamicProgrammingStages(self, source, sink, Debug=False)
Renders the discrete stages of the optimal substructure for
dynamic pogramming digrahs from a given source node 
to a given sink sink node.
 
Returns a list of list of action identifyers.
computeGoodChoiceVector(self, ker, Comments=False)
| Computing Characteristic values for dominant pre-kernels
| using the von Neumann dual fixoint equation
computeGoodChoices(self, Comments=False)
Computes characteristic values for potentially good choices.
 
..note::
 
     Return a tuple with following content:
 
     [(0)-determ,(1)degirred,(2)degi,(3)degd,(4)dega,(5)str(choice),(6)domvec,(7)cover]
computeGoodPirlotChoices(self, Comments=False)
Characteristic values for potentially good choices
using the Pirlot fixpoint algorithm.
computeIncomparabilityDegree(self, InPercents=False, Comments=False)
Renders the incomparability degree (Decimal), i.e. the relative number of symmetric indeterminate relations of the irreflexive part of a digraph.
computeKemenyIndex(self, otherRelation)
renders the Kemeny index of the self.relation
compared with a given crisp valued relation of a compatible
other digraph (same nodes or actions).
computeKemenyOrder(self, orderLimit=7, Debug=False)
Renders a ordering from worst to best of the actions with maximal Kemeny index.
Return a tuple: kemenyOrder (from worst to best), kemenyIndex
computeKemenyRanking(self, orderLimit=7, seed=None, sampleSize=1000, Debug=False)
Renders a ranking from best to worst of the actions with maximal Kemeny index.
 
.. note::
 
     Returns a tuple: kemenyRanking (from best to worst), kemenyIndex.
computeKernelVector(self, kernel, Initial=True, Comments=False)
| Computing Characteristic values for dominant pre-kernels
| using the von Neumann dual fixpoint equation
computeKohlerOrder(self)
Renders an ordering (worst to best) of the actions following Kohler's rule.
computeKohlerRanking(self)
Renders a ranking (best to worst) of the actions following Kohler's rule.
computeMaxHoleSize(self, Comments=False)
Renders the length of the largest chordless cycle
in the corresponding disjunctive undirected graph.
computeMeanInDegree(self)
Renders the mean indegree of self.
!!! self.size must be set previously !!!
computeMeanOutDegree(self)
Renders the mean degree of self.
!!! self.size must be set previously !!!
computeMeanSymDegree(self)
Renders the mean degree of self.
!!! self.size must be set previously !!!
computeMedianOutDegree(self)
Renders the median outdegree of self.
!!! self.size must be set previously !!!
computeMedianSymDegree(self)
Renders the median symmetric degree of self.
!!! self.size must be set previously !!!
computeMoreOrLessUnrelatedPairs(self)
Renders a list of more or less unrelated pairs.
computeNetFlowsOrder(self)
Renders an ordered list (from best to worst) of the actions
following the net flows ranking rule.
computeNetFlowsOrderDict(self)
Renders an ordered list (from worst to best) of the actions
following the net flows ranking rule.
computeNetFlowsRanking(self)
Renders an ordered list (from best to worst) of the actions
following the net flows ranking rule.
computeNetFlowsRankingDict(self)
Renders an ordered list (from best to worst) of the actions
following the net flows ranking rule.
computeODistance(self, op2, comments=False)
renders the squared normalized distance of
two digraph valuations.
 
.. note::
 
     op2 = digraphs of same order as self.
computeOrbit(self, choice, withListing=False)
renders the set of isomorph copies of a choice following
the automorphism of the digraph self
computeOrderCorrelation(self, order, Debug=False)
Renders the ordinal correlation K of a digraph instance
when compared with a given linear order (from worst to best) of its actions
 
K = sum_{x != y} [ min( max(-self.relation(x,y)),other.relation(x,y), max(self.relation(x,y),-other.relation(x,y)) ]
 
K /= sum_{x!=y} [ min(abs(self.relation(x,y),abs(other.relation(x,y)) ]
 
.. note::
 
     Renders a dictionary with the key 'correlation' containing the actual bipolar correlation index and the key 'determination' containing the minimal determination level D of self and the other relation.
 
     D = sum_{x != y} min(abs(self.relation(x,y)),abs(other.relation(x,y)) / n(n-1)
 
     where n is the number of actions considered.
 
     The correlation index with a completely indeterminate relation
     is by convention 0.0 at determination level 0.0 .
 
.. warning::
 
     self must be a normalized outranking digraph instance !
computeOrdinalCorrelation(self, other, MedianCut=False, filterRelation=None, Debug=False)
Renders the bipolar correlation K of a
self.relation when compared
with a given compatible (same actions set)) digraph or
a [-1,1] valued compatible relation (same actions set).
 
If MedianCut=True, the correlation is computed on the median polarized relations.
 
If filterRelation is not None, the correlation is computed on the partial domain corresponding to the determined part of the filter relation.
 
.. warning::
 
     Notice that the 'other' relation and/or the 'filterRelation',
     the case given, must both be normalized, ie [-1,1]-valued !
 
K = sum_{x != y} [ min( max(-self.relation[x][y]),other.relation[x][y]), max(self.relation[x][y],-other.relation[x][y]) ]
 
K /= sum_{x!=y} [ min(abs(self.relation[x][y]),abs(other.relation[x][y])) ]
 
.. note::
 
     Renders a tuple with at position 0 the actual bipolar correlation index
     and in position 1 the minimal determination level D of self and
     the other relation.
 
     D = sum_{x != y} min(abs(self.relation[x][y]),abs(other.relation[x][y])) / n(n-1)
 
     where n is the number of actions considered.
 
     The correlation index with a completely indeterminate relation
     is by convention 0.0 at determination level 0.0 .
computeOrdinalCorrelationMP(self, other, MedianCut=False, Threading=False, nbrOfCPUs=None, startMethod=None, Comments=False, Debug=False)
Multi processing version of the digraphs.computeOrdinalCorrelation() method.
 
.. note::
     The relation filtering and the MedinaCut option are not implemented in the MP version.
computePairwiseClusterComparison(self, K1, K2, Debug=False)
Computes the pairwise cluster comparison credibility vector
from bipolar-valued digraph g. with K1 and K2 disjoint
lists of action keys from g actions disctionary.
Returns the dictionary
{'I': Decimal(),'P+':Decimal(),'P-':Decimal(),'R' :Decimal()}
where one and only one item is strictly positive.
computePreKernels(self)
computing dominant and absorbent preKernels:
    Result in self.dompreKernels and self.abspreKernels
computePreRankingRelation(self, preRanking, Normalized=True, Debug=False)
Renders the bipolar-valued relation obtained from
a given preRanking in decreasing levels (list of lists) result.
computePreorderRelation(self, preorder, Normalized=True, Debug=False)
Renders the bipolar-valued relation obtained from
a given preordering in increasing levels (list of lists) result.
computePrincipalOrder(self, Colwise=False, Comments=False)
Rendesr an ordering from wrost to best of the decision actions.
computePrincipalRanking(self, Colwise=False, Comments=False)
Rendesr a ranking from best to worst of the decision actions.
computePrincipalScores(self, plotFileName=None, Colwise=False, imageType=None, tempDir=None, bgcolor='cornsilk', Comments=False, Debug=False)
Renders a ordered list of the first principal eigenvector of the covariance of the valued outdegrees of self.
 
.. note::
 
   The method, relying on writing and reading temporary files by default in a temporary directory is threading and multiprocessing safe !
   (see Digraph.exportPrincipalImage method)
computePrudentBetaLevel(self, Debug=False)
computes alpha, ie the lowest valuation level, for which the
bipolarly polarised digraph doesn't contain a chordless circuit.
computeRankingByBestChoosing(self, CoDual=False, Debug=False)
Computes a weak preordering of the self.actions by recursive
best choice elagations.
 
Stores in self.rankingByBestChoosing['result'] a list of (P+,bestChoice) tuples
where P+ gives the best choice complement outranking
average valuation via the computePairwiseClusterComparison
method.
 
If self.rankingByBestChoosing['CoDual'] is True, 
the ranking-by-choosing was computed on the codual of self.
computeRankingByBestChoosingRelation(self, rankingByBestChoosing=None, Debug=False)
Renders the bipolar-valued relation obtained from
the self.rankingByBestChoosing result.
computeRankingByChoosing(self, actionsSubset=None, Debug=False, CoDual=False)
Computes a weak preordring of the self.actions by iterating
jointly first and last choice elagations.
 
Stores in self.rankingByChoosing['result'] a list of ((P+,bestChoice),(P-,worstChoice)) pairs
where P+ (resp. P-) gives the best (resp. worst) choice complement outranking
(resp. outranked) average valuation via the computePairwiseClusterComparison
method.
 
If self.rankingByChoosing['CoDual'] is True, the ranking-by-choosing was computed on the codual of self.
computeRankingByChoosingRelation(self, rankingByChoosing=None, actionsSubset=None, Debug=False)
Renders the bipolar-valued relation obtained from
the self.rankingByChoosing result.
computeRankingByLastChoosing(self, CoDual=False, Debug=False)
Computes a weak preordring of the self.actions by iterating
worst choice elagations.
 
Stores in self.rankingByLastChoosing['result'] a list of (P-,worstChoice) pairs
where P- gives the worst choice complement outranked
average valuation via the computePairwiseClusterComparison
method.
 
If self.rankingByChoosing['CoDual'] is True, the ranking-by-last-chossing 
was computed on the codual of self.
computeRankingByLastChoosingRelation(self, rankingByLastChoosing=None, Debug=False)
Renders the bipolar-valued relation obtained from
the self.rankingByLastChoosing result.
computeRankingCorrelation(self, ranking, Debug=False)
Renders the ordinal correlation K of a digraph instance
when compared with a given linear ranking of its actions
 
K = sum_{x != y} [ min( max(-self.relation(x,y)),other.relation(x,y), max(self.relation(x,y),-other.relation(x,y)) ]
 
K /= sum_{x!=y} [ min(abs(self.relation(x,y),abs(other.relation(x,y)) ]
 
.. note::
 
     Renders a tuple with at position 0 the actual bipolar correlation index
     and in position 1 the minimal determination level D of self and
     the other relation.
 
     D = sum_{x != y} min(abs(self.relation(x,y)),abs(other.relation(x,y)) / n(n-1)
 
     where n is the number of actions considered.
 
     The correlation index with a completely indeterminate relation
     is by convention 0.0 at determination level 0.0 .
computeRelationalStructure(self, Debug=False)
Renders the counted decomposition of the valued relations into
the following type of links:
gt '>', eq '=', lt '<', incomp '<>',
leq '<=', geq '>=', indeterm '?'
computeRubisChoice(self, Comments=False, _OldCoca=False, BrokenCocs=True, Threading=False, nbrOfCPUs=1)
Renders self.strictGoodChoices, self.nullChoices
self.strictBadChoices, self.nonRobustChoices.
 
.. warning::
    Changes in site the outranking digraph by
    adding or braking chordless odd outranking circuits.
computeRubyChoice(self, Comments=False, _OldCoca=False)
dummy for computeRubisChoice()
old versions compatibility.
computeShortestPathLengths(self, WeakPaths=False, Comments=False, Debug=False)
Renders a double dictionary with the directed distances, i.e. the shortest path lengths between all self.actions
 
Equals *None* if there does not exist a directed path between two actions.
 
*Source*: Claude Berge, *The Theory of Graphs*, Dover (2001) pp. 119, original in French Dunod (1958)
computeSingletonRanking(self, Comments=False, Debug=False)
Renders the sorted bipolar net determinatation of outrankingness
minus outrankedness credibilities of all singleton choices.
 
res = ((netdet,singleton,dom,absorb)+)
computeSize(self)
Renders the number of validated non reflexive arcs
computeSizeTransitiveClosure(self)
Renders the size of the transitive closure of a digraph.
computeSlaterOrder(self, isProbabilistic=False, seed=None, sampleSize=1000, Debug=False)
Reversed return from computeSlaterRanking method.
computeSlaterRanking(self, isProbabilistic=False, seed=None, sampleSize=1000, Debug=False)
Renders a ranking of the actions with minimal Slater index.
Return a tuple: slaterOrder, slaterIndex
computeSymmetryDegree(self, InPercents=False, Comments=False)
Renders the symmetry degree (Decimal) of the irreflexive part of a digraph.
 
.. note::
 
   Empty and indeterminate digraphs are considered to be symmetric.
computeTopologicalRanking(self, Debug=False)
Mimetic Wrapper of the topologicalSort() method.
computeTransitivityDegree(self, InPercents=False, Comments=False)
Renders the transitivity degree (Decimal) of a digraph.
 
.. note:: 
 
   An empty or indeterminate digraph is considered to be transitive.
computeUnrelatedPairs(self)
Renders a list of more or less unrelated pairs.
computeValuationLevels(self, choice=None, Debug=False)
renders the symmetric closure of the
apparent valuations levels of self
in an increasingly ordered list.
If parameter choice is given, the
computation is limited to the actions
of the choice.
computeValuationPercentages(self, choice, percentiles, withValues=False)
Parameters: choice and list of percentiles.
renders a series of percentages of the characteristics valuation of
the arcs in the digraph.
computeValuationPercentiles(self, choice, percentages, withValues=False)
Parameters: choice and list of percentages.
renders a series of quantiles of the characteristics valuation of
the arcs in the digraph.
computeValuationStatistics(self, Sampling=False, Comments=False)
Renders the mean and variance of the valuation
of the non reflexive pairs.
computeValuedRankingRelation(self, ranking)
Renders the valued relation characteristics compatible 
with the given linar ranking. Discordant charcateristics 
are set to the indeterminate value.
computeWeakCondorcetLosers(self)
Wrapper for weakCondorcetLosers().
computeWeakCondorcetWinners(self)
Wrapper for weakCondorcetWinners().
computeupdown1(self, s, S)
Help method for show_MIS_HB2 method.
fills self.newmisset, self.upmis, self.downmis.
computeupdown2(self, s, S)
Help method for show_MIS_HB1 method.
Fills self.newmisset, self.upmis, self.downmis.
computeupdown2irred(self, s, S)
Help method for show_MIS_HB1 method.
Fills self.newmisset, self.upmis, self.downmis.
condorcetLosers(self)
Renders the set of decision actions x such that
self.relation[x][y] < self.valuationdomain['med']
for all y != x.
condorcetWinners(self)
Renders the set of decision actions x such that
self.relation[x][y] > self.valuationdomain['med']
for all y != x.
contra(self, v)
Parameter: choice.
Renders the negation of a choice v characteristic's vector.
convertRelationToDecimal(self)
Converts the float valued self.relation in a decimal valued one.
convertValuation2Integer(self, InSite=True, Comments=False)
Converts the self.relation valuation to integer values by converting the Decimals to Fractions and multiply by the least commun multiple of the fraction denominators.
 
*Parameters*:
 
    - If *Insite* == False (True by default) the method returns a modified copy of self.relation without altering the original self.relation, otherwise self.relation and self.valuationdomain is modified.
convertValuationToDecimal(self)
Convert the float valuation limits to Decimals.
coveringIndex(self, choice, direction='out')
Renders the covering index of a given choice in a set of objects,
ie the minimum number of choice members that cover each
non selected object.
crispKDistance(self, digraph, Debug=False)
Renders the crisp Kendall distance between two bipolar valued
digraphs.
 
.. warning::
 
     Obsolete! Is replaced by the self.computeBipolarCorrelation(other, MedianCut=True) Digraph method
detectChordlessCircuits(self, Comments=False, Debug=False)
Detects a chordless circuit in a digraph.
Returns a Boolean
detectChordlessPath(self, Pk, n2, Comments=False, Debug=False)
New procedure from Agrum study April 2009
recursive chordless path extraction starting from path
Pk = [n2, ...., n1] and ending in node n2.
Optimized with marking of visited chordless P1s.
determinateness(self, vec, inPercent=True)
Renders the determinateness of a characteristic vector *vec* = 
[(r(x),x),(r(y),y), ...] of length *n* in valuationdomain [Min,Med,Max]:
 
*result* =  sum_x( abs(r(x)-Med) ) / ( n*(Max-Med) )
 
If inPercent, *result* shifted (+1) and reduced (/2) to [0,1] range.
digraph2Graph(self, valuationDomain={'min': -1, 'med': 0, 'max': 1}, Debug=False, ConjunctiveConversion=True)
Convert a Digraph instance to a Graph instance.
dneighbors(self, node)
Renders the set of dominated out-neighbors of a node.
domin(self, choice)
Renders the dominance degree of a choice.
dominantChoices(self, S)
Generates all minimal dominant choices of a bipolar valued digraph.
 
.. note::
 
     Initiate with S = self.actions.copy().
domirred(self, choice)
Renders the crips +irredundance degree of a choice.
domirredval(self, choice, relation)
Renders the valued +irredundance degree of a choice.
domirredx(self, choice, x)
Renders the crips +irredundance degree of node x in a choice.
domkernelrestrict(self, prekernel)
Parameter: dominant prekernel
Renders dominant prekernel restricted relation.
exportGraphViz(self, fileName=None, actionsSubset=None, bestChoice=set(), worstChoice=set(), firstChoice=set(), lastChoice=set(), Comments=True, graphType='png', pictureFormat=None, graphSize='7,7', relation=None, bgcolor='cornsilk')
export GraphViz dot file  for graph drawing filtering.
exportPrincipalImage(self, plotFileName=None, pictureFormat='pdf', bgcolor='cornsilk', fontcolor='red3', fontsize='0.75', Reduced=False, Colwise=False, tempDir='.', Comments=False)
Export as PDF (default) the principal projection of
the valued relation using the three principal eigen vectors.
 
Implemeted picture formats are: 
'pdf' (default), 'png', 'jpeg' and 'xfig'.
 
The background color is set by default to 'cornsilk'. 
 
Font size and color are set by default to 'red3', resp. '0.75'. 
 
When *Reduced==True*, the valued relation characeteristics are centered and reduced.
 
When *Colwise==True*, the column vectors of the adjacency table are used for the principal projection, otherwise the rows (default) are used. Has no incidence when the *Digraph* instance *self*  is symmetric. 
 
.. warning::
 
    The method, writing and reading temporary files: 
    tempCol.r and rotationCol.csv, resp. tempRow.r and rotationRow.csv,
    by default in the working directory (./),
    is hence not safe for multiprocessing programs, unless a
    temporary directory *tempDir* is provided.
flatChoice(self, ch, Debug=False)
Converts set or list ch recursively to a flat list of items.
forcedBestSingleChoice(self)
Renders the set of most determined outranking singletons in self.
gammaSets(self)
Renders the dictionary of neighborhoods {node: (dx,ax)}
with set *dx* gathering the dominated, and set *ax* gathering
the absorbed neighborhood.
generateAbsPreKernels(self)
Generate all absorbent prekernels from independent choices generator.
generateDomPreKernels(self)
Generate all dominant prekernels from independent choices generator.
htmlChoiceVector(self, ch, ChoiceVector=True, choiceType='good')
Show procedure for annotated bipolar choices.
inDegrees(self)
renders the median cut indegrees
inDegreesDistribution(self)
Renders the distribution of indegrees.
independentChoices(self, U)
Generator for all independent choices with neighborhoods of a bipolar valued digraph:
 
.. note::
 
       * Initiate with U = self.singletons().
       * Yields [(independent choice, domnb, absnb, indnb)].
inner_prod(self, v1, v2)
Parameters: two choice characteristic vectors
Renders the inner product of two characteristic vetors.
intstab(self, choice)
Computes the independence degree of a choice.
irreflex(self, mat)
Puts diagonal entries of mat to valuationdomain['min']
isAsymmetricIndeterminate(self, Debug=False)
Checks the self.relation for assymmetric indeterminateness!!
 
.. warning::
 
    The reflexive links are ignored !!
isComplete(self, Debug=False)
checks the completeness property of self.relation by checking
for the absence of a link between two actions!!
 
.. warning::
 
    The reflexive links are ignored !!
isCyclic(self, Debug=False)
checks the cyclicity of self.relation by checking
for a reflexive loop in its transitive closure-
 
.. warning::
 
     self.relation is supposed to be irreflexive !
isIntegerValued(self, Debug=False)
Checks whether the decimal valuation of self is integer-valued
be using the as_integer_ratio() method of a Decimal 
giving a tuple (numerator,denominator). If denominator == 1, the
number is an integer.
isOutrankingDigraph(self, Comments=True, Debug=False)
Checks the outranking digraph characteristic condition (3.3).
 
relation[x][y] + relation[y][x)[y] >= 0.0
 
.. warning::
 
    The reflexive links are ignored and the valuation must be bipolar !!
isStrictOutrankingDigraph(self, Comments=True, Debug=False)
Checks the strict outranking digraph characteristic condition (3.1).
 
-(relation[x][y] + relation[y][x]) <= 0.0 , x != y
 
.. warning::
 
    The reflexive links are ignored and the valuation must be bipolar !!
isSymmetric(self, Comments=False)
True if symmetry degree == 1.0.
isTransitive(self, Comments=False)
True if transitivity degree == 1.0.
isWeaklyComplete(self, Debug=False)
checks the weakly completeness property of self.relation by checking
for the absence of a link between two actions!!
 
.. warning::
 
    The reflexive links are ignored !!
iterateRankingByChoosing(self, Odd=False, CoDual=False, Comments=True, Debug=False, Limited=None)
Renders a ranking by choosing result when progressively eliminating
all chordless (odd only) circuits with rising valuation cut levels.
 
Parameters
    CoDual = False (default)/True
    Limited = proportion (in [0,1]) * (max - med) valuationdomain
kChoices(self, A, k)
Renders all choices of length k from set A
matmult2(self, m, v)
Parameters: digraph relation and choice characteristic vector
matrix multiply vector by inner production
meanDegree(self)
Renders the mean degree of self.
!!! self.size must be set previously !!!
meanLength(self, Oriented=False)
Renders the (by default non-oriented) mean neighbourhoor depth of self.
!!! self.order must be set previously !!!
minimalChoices(self, S)
Generates all dominant or absorbent choices of a bipolar
valued digraph.
 
.. note:
 
   * Initiate with S = (actions, dict of dominant or absorbent closed neighborhoods)
   * See showMinDom and showMinAbs methods.
minimalValuationLevelForCircuitsElimination(self, Odd=True, Debug=False, Comments=False)
renders the minimal valuation level <lambda> that eliminates all
self.circuitsList stored odd chordless circuits from self.
 
.. warning::
 
    The <lambda> level polarised may still contain newly appearing chordless odd circuits !
neighbourhoodCollection(self, Oriented=False, Potential=False)
Renders the neighbourhood.
neighbourhoodDepthDistribution(self, Oriented=False)
Renders the distribtion of neighbourhood depths.
notGammaSets(self)
Renders the dictionary of neighborhoods {node: (dx,ax)}
with set *dx* gathering the not dominated, and set *ax* gathering
the not absorbed neighborhood.
notaneighbors(self, node)
Renders the set of absorbed not in-neighbors of a node.
notdneighbors(self, node)
Renders the set of not dominated out-neighbors of a node.
outDegrees(self)
renders the median cut outdegrees
outDegreesDistribution(self)
Renders the distribution of outdegrees.
plusirredundant(self, U)
Generates all +irredundant choices of a digraph.
powerset(self, U)
Generates all subsets of a set.
readPerrinMisset(self, file='curd.dat')
read method for 0-1-char-coded MISs by default from the perrinMIS.c curd.dat result file.
readabsvector(self, x, relation)
Parameter: action x
absorbent in vector.
readdomvector(self, x, relation)
Parameter: action x
dominant out vector.
recodeValuation(self, newMin=-1.0, newMax=1.0, ndigits=4, Debug=False)
Recodes the characteristic valuation domain according
to the parameters given. 
 
*ndigits* indicates the number of decimal digits of the valuation.
relationFct(self, x, y)
wrapper for self.relation dictionary access to ensure interoperability
with the sparse and big outranking digraph implementation model.
save(self, fileName='tempdigraph', option=None, DecimalValuation=True, decDigits=2)
Persistent storage of a Digraph class instance in the form of
a python source code file
saveCSV(self, fileName='tempdigraph', Normalized=False, Dual=False, Converse=False, Diagonal=False, Debug=False)
Persistent storage of a Digraph class instance in the form of
a csv file.
saveXMCDA2(self, fileName='temp', fileExt='xmcda2', Comments=True, relationName='R', relationType='binary', category='random', subcategory='valued', author='digraphs Module (RB)', reference='saved from Python', valuationType='standard', digits=2, servingD3=False)
save digraph in XMCDA 2.0 format. Deprecated now.
savedre(self, fileName='temp')
save digraph in nauty format.
sharp(self, x, y)
Paramaters: choice characteristic values.
Renders the sharpest of two characteristic values x and y.
sharpvec(self, v, w)
Paramaters: choice characteristic vectors.
Renders the sharpest of two characteristic vectors v and w.
showActions(self)
presentation methods for digraphs actions
showAll(self)
Detailed show method for genuine digraphs.
showAttributes(self)
Prints out the attributes of self.
showAutomorphismGenerators(self)
Renders the generators of the automorphism group.
showBadChoices(self, Recompute=True)
Characteristic values for potentially bad choices.
showBestChoiceRecommendation(self, Verbose=False, Comments=True, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True)
Shows the RuBis best choice recommendation.
 
.. note::
 
    Computes by default the Rubis best choice recommendation on the corresponding strict (codual) outranking digraph.
 
    By default, with BrokenCocs=True, we brake all chordless circuits at their weakest determined ( abs(r(x>y)) + abs(r(y>x)) ) link.
 
    When BrokenCocs=False we proceed like follows:
 
    In case of chordless circuits, if supporting arcs are more credible
    than the reversed negating arcs, we collapse the circuits into hyper nodes.
    Inversely,  if supporting arcs are not more credible than the reversed negating arcs,
    we brake the circuits on their weakest arc.
 
Usage example:
 
>>> from outrankingDigraphs import *
>>> t = Random3ObjectivesPerformanceTableau(seed=5)
>>> g = BipolarOutrankingDigraph(t)
>>> g.showBestChoiceRecommendation()
***********************
RuBis Best Choice Recommendation (BCR)
(in decreasing order of determinateness)   
Credibility domain:  [-100.0, 100.0]
=== >> potential first choices
* choice              : ['a04', 'a14', 'a19', 'a20']
   independence        : 1.19
   dominance           : 4.76
   absorbency          : -59.52
   covering (%)        : 75.00
   determinateness (%) : 57.86
   - most credible action(s) = { 'a14': 23.81, 'a19': 11.90, 'a04': 2.38, 'a20': 1.19, }  
=== >> potential last choices 
* choice              : ['a03', 'a12', 'a17']
  independence        : 4.76
  dominance           : -76.19
  absorbency          : 4.76
  covering (%)        : 0.00
  determinateness (%) : 65.39
  - most credible action(s) = { 'a03': 38.10, 'a12': 13.10, 'a17': 4.76, }
Execution time: 0.024 seconds
*****************************
showChoiceVector(self, ch, choiceType='good', ChoiceVector=True)
Show procedure for annotated bipolar choices.
showChordlessCircuits(self, Recompute=False)
Show method for chordless circuits observed in a Digraph instance.
 
If previous computation is required, stores the detected circuits in self.circuitsList attribute.
showComponents(self)
Shows the list of connected components of the digraph instance.
showCorrelation(self, corr=None, ndigits=3)
Renders the valued ordinal correlation index, the crisp Kendall tau index and their epistemic determination degree.
showFirstChoiceRecommendation(self, Verbose=False, Comments=True, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True)
Shows the RuBis first choice recommendation.
 
.. note::
 
    Computes by default the Rubis first choice recommendation on the corresponding strict (codual) outranking digraph.
 
    By default, with BrokenCocs=True, we brake all chordless circuits at their weakest determined ( abs(r(x>y)) + abs(r(y>x)) ) link.
 
    When BrokenCocs=False we proceed like follows:
 
    In case of chordless circuits, if supporting arcs are more credible
    than the reversed negating arcs, we collapse the circuits into hyper nodes.
    Inversely,  if supporting arcs are not more credible than the reversed negating arcs,
    we brake the circuits on their weakest arc.
 
Usage example:
 
>>> from outrankingDigraphs import *
>>> t = Random3ObjectivesPerformanceTableau(seed=5)
>>> g = BipolarOutrankingDigraph(t)
>>> g.showFirstChoiceRecommendation()
***********************
RuBis First Choice Recommendation (BCR)
(in decreasing order of determinateness)   
Credibility domain:  [-100.0, 100.0]
=== >> potential first choices
* choice              : ['a04', 'a14', 'a19', 'a20']
   independence        : 1.19
   dominance           : 4.76
   absorbency          : -59.52
   covering (%)        : 75.00
   determinateness (%) : 57.86
   - most credible action(s) = { 'a14': 23.81, 'a19': 11.90, 'a04': 2.38, 'a20': 1.19, }  
=== >> potential last choices 
* choice              : ['a03', 'a12', 'a17']
  independence        : 4.76
  dominance           : -76.19
  absorbency          : 4.76
  covering (%)        : 0.00
  determinateness (%) : 65.39
  - most credible action(s) = { 'a03': 38.10, 'a12': 13.10, 'a17': 4.76, }
Execution time: 0.024 seconds
*****************************
showGoodChoices(self, Recompute=True)
Characteristic values for potentially good choices.
showHTMLBestChoiceRecommendation(self, pageTitle=None, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True, htmlFileName=None)
showHTMLRelationHeatmap(self, actionsList=None, rankingRule='NetFlows', colorLevels=7, tableTitle='Relation Heatmap', relationName='r(x S y)', ndigits=2, fromIndex=None, toIndex=None, htmlFileName=None)
Launches a browser window with the colored relation map of self.
 
See corresponding :py:class:`~digraphs.Digraph.showHTMLRelationMap` method.
 
The *colorLevels* parameter may be set to 3, 5, 7 (default) or 9.
 
When the *actionsList* parameter is *None* (default), the digraphs actions list may be ranked with the *rankingRule* parameter set to the 'Copeland' (default) or to the 'Netlows' ranking rule.
 
When the *htmlFileName* parameter is set to a string value 'xxx', a html file named 'xxx.html' will be generated in the current working directory. Otherwise, a temporary file named 'tmp*.html' will be generated there.
 
Example::
 
    >>> from outrankingDigraphs import *
    >>> t = RandomCBPerformanceTableau(numberOfActions=25,seed=1)
    >>> g = BipolarOutrankingDigraph(t,ndigits=2)
    >>> gcd = ~(-g)  # strict outranking relation
    >>> gcd.showHTMLRelationHeatmap(colorLevels=7,ndigits=2)
    
.. image:: relationHeatmap.png
   :alt: Browser view of a relation map
   :width: 600 px
   :align: center
showHTMLRelationMap(self, actionsList=None, rankingRule='Copeland', Colored=True, tableTitle='Relation Map', relationName='r(x S y)', symbols=['+', '&middot;', '&nbsp;', '&#150;', '&#151'], fromIndex=None, toIndex=None, htmlFileName=None)
Launches a browser window with the colored relation map of self.
See corresponding Digraph.showRelationMap() method.
 
When *htmlFileName* parameter is set to a string value, a html file
with that name will be stored in the current working directory.
 
By default, a temporary file named: tmp*.html will be generated
instead in the current working directory.
 
Example::
 
    >>> from outrankingDigraphs import *
    >>> t = RandomCBPerformanceTableau(numberOfActions=25,seed=1)
    >>> g = BipolarOutrankingDigraph(t,Normalized=True)
    >>> gcd = ~(-g)  # strict outranking relation
    >>> gcd.showHTMLRelationMap(rankingRule="NetFlows")
    
.. image:: relationMap.png
   :alt: Browser view of a relation map
   :width: 600 px
   :align: center
showHTMLRelationTable(self, actionsList=None, relation=None, IntegerValues=False, ndigits=2, Colored=True, tableTitle='Valued Adjacency Matrix', relationName='r(x S y)', ReflexiveTerms=False, htmlFileName=None, fromIndex=None, toIndex=None)
Launches a browser window with the colored relation table of self.
showMIS(self, withListing=True)
Prints all maximal independent choices:
    Result in self.misset.
showMIS_AH(self, withListing=True)
Prints all MIS using the Hertz method.
 
Result saved in self.hertzmisset.
showMIS_HB2(self, withListing=True)
Prints all MIS using the Hertz-Bisdorff method.
 
Result saved in self.newmisset.
showMIS_RB(self, withListing=True)
Prints all MIS using the Bisdorff method.
 
Result saved in self.newmisset.
showMIS_UD(self, withListing=True)
Prints all MIS using the Hertz-Bisdorff method.
 
Result saved in self.newmisset.
showMaxAbsIrred(self, withListing=True)
Computing maximal -irredundant choices:
    Result in self.absirset.
showMaxDomIrred(self, withListing=True)
Computing maximal +irredundant choices:
   Result in self.domirset.
showMinAbs(self, withListing=True)
Prints minimal absorbent choices:
    Result in self.absset.
showMinDom(self, withListing=True)
Prints all minimal dominant choices:
    Result in self.domset.
showNeighborhoods(self)
Lists the gamma and the notGamma function of self.
showOrbits(self, InChoices, withListing=True)
Prints the orbits of Choices along the automorphisms of
the Digraph instance.
 
Example Python session for computing the non isomorphic MISs from the 12-cycle graph:
 
>>> from digraphs import *
>>> c12 = CirculantDigraph(order=12,circulants=[1,-1])
>>> c12.automorphismGenerators()
...
  Permutations
  {'1': '1', '2': '12', '3': '11', '4': '10', '5': 
   '9', '6': '8', '7': '7', '8': '6', '9': '5', '10': 
   '4', '11': '3', '12': '2'}
  {'1': '2', '2': '1', '3': '12', '4': '11', '5': '10', 
   '6': '9', '7': '8', '8': '7', '9': '6', '10': '5', 
   '11': '4', '12': '3'}
  Reflections {}
>>> print('grpsize = ', c12.automorphismGroupSize)
  grpsize = 24
>>> c12.showMIS(withListing=False)
  *---  Maximal independent choices ---*
  number of solutions:  29
  cardinality distribution
  card.:  [0, 1, 2, 3, 4,  5,  6, 7, 8, 9, 10, 11, 12]
  freq.:  [0, 0, 0, 0, 3, 24,  2, 0, 0, 0,  0,  0,  0]
  Results in c12.misset
>>> c12.showOrbits(c12.misset,withListing=False)
...
  *---- Global result ----
  Number of MIS:  29
  Number of orbits :  4
  Labelled representatives:
  1: ['2','4','6','8','10','12']
  2: ['2','5','8','11']
  3: ['2','4','6','9','11']
  4: ['1','4','7','9','11']
  Symmetry vector
  stabilizer size: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, ...]
  frequency      : [0, 2, 0, 0, 0, 0, 0, 1, 0,  0,  0,  1, ...]
 
*Figure*: The symmetry axes of the non isomorphic MISs of the 12-cycle:
 
.. image:: c12.png
   :width: 400 px
   :align: center
   :alt: The 4 non isomorphic MIS of the 12-cycle graph
 
*Reference*: R. Bisdorff and J.L. Marichal (2008). Counting non-isomorphic maximal independent sets of the n-cycle graph. *Journal of Integer Sequences*, Vol. 11 Article 08.5.7 (`openly accessible here <https://www.cs.uwaterloo.ca/journals/JIS/VOL11/Marichal/marichal.html>`_)
showOrbitsFromFile(self, InFile, withListing=True)
Prints the orbits of Choices along the automorphisms of
the digraph self by reading in the 0-1 misset file format.
See the :py:func:`digraphs.Digraph.readPerrinMisset` method.
showPreKernels(self, withListing=True)
Printing dominant and absorbent preKernels:
    Result in self.dompreKernels and self.abspreKernels
showRankingByBestChoosing(self, rankingByBestChoosing=None)
A show method for self.rankinByBestChoosing result.
 
.. warning::
 
     The self.computeRankingByBestChoosing(CoDual=False/True) method instantiating the self.rankingByBestChoosing slot is pre-required !
showRankingByChoosing(self, rankingByChoosing=None, WithCoverCredibility=False)
A show method for self.rankinByChoosing result.
 
When parameter *WithCoverCredibility* is set to True, the credibility of outranking, respectively being outranked is indicated at each selection step. 
 
.. warning::
 
     The self.computeRankingByChoosing(CoDual=False/True) method instantiating the self.rankingByChoosing slot is pre-required !
showRankingByLastChoosing(self, rankingByLastChoosing=None, Debug=None)
A show method for self.rankinByChoosing result.
 
.. warning::
 
     The self.computeRankingByLastChoosing(CoDual=False/True) method instantiating the self.rankingByChoosing slot is pre-required !
showRelation(self)
prints the relation valuation in ##.## format.
showRelationMap(self, symbols=None, rankingRule='Copeland', fromIndex=None, toIndex=None, actionsList=None)
Prints on the console, in text map format, the location of
certainly validated and certainly invalidated outranking situations.
 
By default, symbols = {'max':'┬','positive': '+', 'median': ' ',
                       'negative': '-', 'min': '┴'}
 
The default ordering of the output is following the Copeland ranking rule
from best to worst actions. Further available ranking rule is the 'NetFlows' net flows rule.
 
 
Example::
 
    >>> from outrankingDigraphs import *
    >>> t = RandomCBPerformanceTableau(numberOfActions=25,seed=1)
    >>> g = BipolarOutrankingDigraph(t,Normalized=True)
    >>> gcd = ~(-g)  # strict outranking relation
    >>> gcd.showRelationMap(rankingRule="NetFlows")
     -   ++++++++  +++++┬+┬┬+
    - -   + +++++ ++┬+┬+++┬++
    ┴+  ┴ + ++  ++++┬+┬┬++┬++
    -   ++ - ++++-++++++┬++┬+
       - - - ++- ┬- + -+┬+-┬┬
    -----  -      -┬┬┬-+  -┬┬
    ----    --+-+++++++++++++
    -- --+- --++ ++ +++-┬+-┬┬
    ----  -  -+-- ++--+++++ +
    ----- ++- --- +---++++┬ +
    -- -- ---+ -++-+++-+ +-++
    -- --┴---+  + +-++-+ -  +
    ---- ┴---+-- ++--++++ - +
      --┴┴--  --- -  --+ --┬┬
     ---------+--+ ----- +-┬┬
    -┴---┴- ---+- + ---+++┬ +
    -┴┴--┴---+--- ++ -++--+++
    -----┴--- ---+-+- ++---+ 
    -┴┴--------------- --++┬ 
    --┴---------------- --+┬ 
    ┴--┴┴ -┴--┴┴-┴ --++  ++-+
    ----┴┴--------------- -  
    ┴┴┴----+-┴+┴---┴-+---+ ┴+
    ┴┴-┴┴┴-┴- - -┴┴---┴┴+ ┬ -
    ----┴┴-┴-----┴┴---  - -- 
    Ranking rule: NetFlows
    >>>
showRelationTable(self, Sorted=True, rankingRule=None, IntegerValues=False, actionsSubset=None, relation=None, ndigits=2, ReflexiveTerms=True, fromIndex=None, toIndex=None)
Prints the relation valuation in actions X actions table format.
Copeland and NetFlows rankings my be used.
showRubisBestChoiceRecommendation(self, **kwargs)
Dummy for backward portable showBestChoiceRecommendation().
showRubyChoice(self, Verbose=False, Comments=True, _OldCoca=True)
Dummy for showBestChoiceRecommendation()
needed for older versions compatibility.
showShort(self)
concise presentation method for genuine digraphs.
showSingletonRanking(self, Comments=True, Debug=False)
Calls self.computeSingletonRanking(comments=True,Debug = False).
Renders and prints the sorted bipolar net determinatation of outrankingness
minus outrankedness credibilities of all singleton choices.
 
res = ((netdet,sigleton,dom,absorb)+)
showStatistics(self)
Computes digraph statistics like order, size and arc-density.
showdre(self)
Shows relation in nauty format.
singletons(self)
list of singletons and neighborhoods
[(singx1, +nx1, -nx1, not(+nx1 or -nx1)),.... ]
sizeSubGraph(self, choice)
Output: (size, undeterm,arcDensity).
Renders the arc density of the induced subgraph.
strongComponents(self, setPotential=False)
Renders the set of strong components of self.
symDegreesDistribution(self)
Renders the distribution of symmetric degrees.
topologicalSort(self, Debug=False)
If self is acyclic, adds topological sort number to each node of self
and renders ordered list of nodes. Otherwise renders None.
Source: M. Golumbic Algorithmic Graph heory and Perfect Graphs,
Annals Of Discrete Mathematics 57 2nd Ed. , Elsevier 2004, Algorithm 2.4 p.44.
weakAneighbors(self, node)
Renders the set of absorbed in-neighbors of a node.
weakCondorcetLosers(self)
Renders the set of decision actions x such that
self.relation[x][y] <= self.valuationdomain['med']
for all y != x.
weakCondorcetWinners(self)
Renders the set of decision actions x such that
self.relation[x][y] >= self.valuationdomain['med']
for all y != x.
weakDneighbors(self, node)
Renders the set of dominated out-neighbors of a node.
weakGammaSets(self)
Renders the dictionary of neighborhoods {node: (dx,ax)}
zoomValuation(self, zoomFactor=1.0)
Zooms in or out, depending on the value of the zoomFactor provided,
the bipolar valuation of a digraph.

Data descriptors inherited from Digraph:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class FusionDigraph(Digraph)
    FusionDigraph(dg1, dg2, operator='o-max', weights=None)
 
Instantiates the epistemic fusion of 
two given Digraph instances called dg1 and dg2.
 
Parameter:
 
    * operator := "o-max (default)" | "o-min | o-average" :
      symmetrix disjunctive, resp. conjunctive, resp. avarage
      fusion operator.
    * weights := [a,b]: if None weights = [1,1]
 
 
Method resolution order:
FusionDigraph
Digraph
builtins.object

Methods defined here:
__init__(self, dg1, dg2, operator='o-max', weights=None)
Initialize self.  See help(type(self)) for accurate signature.

Methods inherited from Digraph:
MISgen(self, S, I)
generator of maximal independent choices (voir Byskov 2004):
    * S ::= remaining nodes;
    * I ::= current independent choice
 
.. note::
 
        Inititalize: self.MISgen(self.actions.copy(),set())
__invert__(self)
Make the inverting operator ~self available for Digraph instances. 
 
Returns a ConverseDigraph instance of self.
__neg__(self)
Make the negation operator -self available for Digraph instances. 
 
Returns a DualDigraph instance of self.
__repr__(self)
Default presentation method for Digraph instances.
absirred(self, choice)
Renders the crips -irredundance degree of a choice.
absirredundant(self, U)
Generates all -irredundant choices of a digraph.
absirredval(self, choice, relation)
Renders the valued -irredundance degree of a choice.
absirredx(self, choice, x)
Computes the crips -irredundance degree of node x in a choice.
abskernelrestrict(self, prekernel)
Parameter: prekernel
Renders absorbent prekernel restricted relation.
absorb(self, choice)
Renders the absorbency degree of a choice.
absorbentChoices(self, S)
Generates all minimal absorbent choices of a bipolar valued digraph.
addValuationAttribute(self)
Adds the numpy valuation attribute
agglomerationDistribution(self)
Output: aggloCoeffDistribution, meanCoeff
Renders the distribution of agglomeration coefficients.
aneighbors(self, node)
Renders the set of absorbed in-neighbors of a node.
automorphismGenerators(self)
Adds automorphism group generators to the digraph instance.
 
.. note::
 
    Dependency: Uses the dreadnaut command from the nauty software package. See https://www3.cs.stonybrook.edu/~algorith/implement/nauty/implement.shtml
 
    On Ubuntu Linux:
      ...$ sudo apt-get install nauty
averageCoveringIndex(self, choice, direction='out')
Renders the average covering index of a given choice in a set of objects,
ie the average number of choice members that cover each
non selected object.
bipolarKCorrelation(self, digraph, Debug=False)
Renders the bipolar Kendall correlation between two bipolar valued
digraphs computed from the average valuation of the
XORDigraph(self,digraph) instance.
 
.. warning::
 
     Obsolete! Is replaced by the self.computeBipolarCorrelation(other) Digraph method
bipolarKDistance(self, digraph, Debug=False)
Renders the bipolar crisp Kendall distance between two bipolar valued
digraphs.
 
.. warning::
 
     Obsolete! Is replaced by the self.computeBipolarCorrelation(other, MedianCut=True) Digraph method
chordlessPaths(self, Pk, n2, Odd=False, Comments=False, Debug=False)
New procedure from Agrum study April 2009
recursive chordless path extraction starting from path
Pk = [n2, ...., n1] and ending in node n2.
Optimized with marking of visited chordless P1s.
circuitAverageCredibility(self, circ)
Renders the average linking credibility of a Chordless Circuit.
circuitCredibilities(self, circuit, Debug=False)
Renders the average linking credibilities and the minimal link of a Chordless Circuit.
circuitMaxCredibility(self, circ)
Renders the maximal linking credibility of a Chordless Circuit.
circuitMinCredibility(self, circ)
Renders the minimal linking credibility of a Chordless Circuit.
closeSymmetric(self, InSite=True)
Produces the symmetric closure of self.relation.
closeTransitive(self, Reverse=False, InSite=True, Comments=False)
Produces the transitive closure of self.relation
 
*Parameters*:
 
    - If *Reverse* == True (False default) all transitive links are dropped, otherwise all transitive links are closed with min[r(x,y),r(y,z)];
    - If *Insite* == False (True by default) the methods return a modified copy of self.relation without altering the original self.relation, otherwise self.relation is modified.
components(self)
Renders the list of connected components.
computeAllDensities(self, choice=None)
parameter: choice in self
renders six densitiy parameters:
arc density, double arc density,
single arc density, strict single arc density,
absence arc density, strict absence arc densitiy.
computeArrowRaynaudOrder(self)
Renders a linear ordering from worst to best of the actions following Arrow&Raynaud's rule.
computeArrowRaynaudRanking(self)
renders a linear ranking from best to worst of the actions following Arrow&Raynaud's rule.
computeAverageValuation(self)
Computes the bipolar average correlation between
self and the crisp complete digraph of same order
of the irreflexive and determined arcs of the digraph
computeBadChoices(self, Comments=False)
Computes characteristic values for potentially bad choices.
 
.. note::
 
     Returns a tuple with following content:
 
     [(0)-determ,(1)degirred,(2)degi,(3)degd,(4)dega,(5)str(choice),(6)absvec]
computeBadPirlotChoices(self, Comments=False)
Characteristic values for potentially bad choices
using the Pirlot's fixpoint algorithm.
computeBestChoiceRecommendation(self, Verbose=False, Comments=False, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True)
Sets self.bestChoice, self.bestChoiceData, self.worstChoice and self.worstChoiceData
with the showBestChoiceRecommendation method.
 
First and last choices data is the following:
[(0)-determ,(1)degirred,(2)degi,(3)degd,(4)dega,(5)str(choice),(6)domvec,(7)cover]
 
self.bestChoice = self.bestChoiceData[5]
self.worstChoice = self.worstChoiceData[5]
computeBipolarCorrelation(self, other, MedianCut=False, filterRelation=None, Debug=False)
obsolete: dummy replacement for Digraph.computeOrdinalCorrelation method
computeChordlessCircuits(self, Odd=False, Comments=False, Debug=False)
Renders the set of all chordless circuits detected in a digraph.
Result is stored in <self.circuitsList>
holding a possibly empty list of tuples with at position 0 the
list of adjacent actions of the circuit and at position 1
the set of actions in the stored circuit.
 
When *Odd* is True, only chordless circuits with an odd length
are collected.
computeChordlessCircuitsMP(self, Odd=False, Threading=False, nbrOfCPUs=None, startMethod=None, Comments=False, Debug=False)
Multiprocessing version of computeChordlessCircuits().
 
Renders the set of all chordless odd circuits detected in a digraph.
Result (possible empty list) stored in <self.circuitsList>
holding a possibly empty list tuples with at position 0 the
list of adjacent actions of the circuit and at position 1
the set of actions in the stored circuit.
Inspired by Dias, Castonguay, Longo, Jradi, Algorithmica (2015).
 
Returns a possibly empty list of tuples (circuit,frozenset(circuit)).
 
If Odd == True, only circuits of odd length are retained in the result.
computeCoSize(self)
Renders the number of non validated non reflexive arcs
computeConcentrationIndex(self, X, N)
Renders the Gini concentration index of the X serie.
N contains the partial frequencies.
Based on the triangle summation formula.
computeConcentrationIndexTrapez(self, X, N)
Renders the Gini concentration index of the X serie.
N contains the partial frequencies.
Based on the triangles summation formula.
computeCondorcetLosers(self)
Wrapper for condorcetLosers().
computeCondorcetWinners(self)
Wrapper for condorcetWinners().
computeCopelandOrder(self)
renders a linear ordering from worst to best of the actions following Arrow&Raynaud's rule.
computeCopelandRanking(self)
renders a linear ranking from best to worst of the actions following Arrow&Raynaud's rule.
computeCutLevelDensities(self, choice, level)
parameter: choice in self, robustness level
renders three robust densitiy parameters:
robust double arc density,
robust single arc density,
robust absence arc densitiy.
computeDensities(self, choice)
parameter: choice in self
renders the four densitiy parameters:
arc density, double arc density, single arc density, absence arc density.
computeDeterminateness(self, InPercents=False)
Computes the Kendalll distance of self
with the all median-valued indeterminate digraph of order n.
 
Return the average determination of the irreflexive part of the digraph.
 
*determination* = sum_(x,y) { abs[ r(xRy) - Med ] } / n(n-1)
 
If *InPercents* is True, returns the average determination in percentage of
(Max - Med) difference.
 
>>> from outrankingDigraphs import BipolarOutrankingDigraph
>>> from randomPerfTabs import Random3ObjectivesPerformanceTableau
>>> t = Random3ObjectivesPerformanceTableau(numberOfActions=7,numberOfCriteria=7,seed=101)
>>> g = BipolarOutrankingDigraph(t,Normalized=True)
>>> g
*------- Object instance description ------*
Instance class      : BipolarOutrankingDigraph
Instance name       : rel_random3ObjectivesPerfTab
Actions             : 7
Criteria            : 7
Size                : 27
Determinateness (%) : 65.67
Valuation domain    : [-1.00;1.00]
>>> print(g.computeDeterminateness())
0.3134920634920634920634920638
>>> print(g.computeDeterminateness(InPercents=True))
65.67460317460317460317460320
>>> g.recodeValuation(0,1)
>>> g
*------- Object instance description ------*
Instance class      : BipolarOutrankingDigraph
Instance name       : rel_random3ObjectivesPerfTab
Actions             : 7
Criteria            : 7
Size                : 27
Determinateness (%) : 65.67
Valuation domain    : [0.00;1.00]
>>> print(g.computeDeterminateness())
0.1567460317460317460317460318
>>> print(g.computeDeterminateness(InPercents=True))
65.67460317460317460317460320
computeDiameter(self, Oriented=True)
Renders the (by default oriented) diameter of the digraph instance
computeDigraphCentres(self, WeakDistances=False, Comments=False)
The centers of a digraph are the nodes with finite minimal shortes path lengths.
 
The maximal neighborhood distances are stored in *self.maximalNeighborhoodDistances*.
 
The corresponding digraph radius and diameter are stored respectively  in *self.radius* and *self.diameter*.
 
With *Comments* = True, all these results are printed out.
 
*Source*: Claude Berge, *The Theory of Graphs*, Dover (2001) pp. 119, original in French Dunod (1958)
computeDynamicProgrammingStages(self, source, sink, Debug=False)
Renders the discrete stages of the optimal substructure for
dynamic pogramming digrahs from a given source node 
to a given sink sink node.
 
Returns a list of list of action identifyers.
computeGoodChoiceVector(self, ker, Comments=False)
| Computing Characteristic values for dominant pre-kernels
| using the von Neumann dual fixoint equation
computeGoodChoices(self, Comments=False)
Computes characteristic values for potentially good choices.
 
..note::
 
     Return a tuple with following content:
 
     [(0)-determ,(1)degirred,(2)degi,(3)degd,(4)dega,(5)str(choice),(6)domvec,(7)cover]
computeGoodPirlotChoices(self, Comments=False)
Characteristic values for potentially good choices
using the Pirlot fixpoint algorithm.
computeIncomparabilityDegree(self, InPercents=False, Comments=False)
Renders the incomparability degree (Decimal), i.e. the relative number of symmetric indeterminate relations of the irreflexive part of a digraph.
computeKemenyIndex(self, otherRelation)
renders the Kemeny index of the self.relation
compared with a given crisp valued relation of a compatible
other digraph (same nodes or actions).
computeKemenyOrder(self, orderLimit=7, Debug=False)
Renders a ordering from worst to best of the actions with maximal Kemeny index.
Return a tuple: kemenyOrder (from worst to best), kemenyIndex
computeKemenyRanking(self, orderLimit=7, seed=None, sampleSize=1000, Debug=False)
Renders a ranking from best to worst of the actions with maximal Kemeny index.
 
.. note::
 
     Returns a tuple: kemenyRanking (from best to worst), kemenyIndex.
computeKernelVector(self, kernel, Initial=True, Comments=False)
| Computing Characteristic values for dominant pre-kernels
| using the von Neumann dual fixpoint equation
computeKohlerOrder(self)
Renders an ordering (worst to best) of the actions following Kohler's rule.
computeKohlerRanking(self)
Renders a ranking (best to worst) of the actions following Kohler's rule.
computeMaxHoleSize(self, Comments=False)
Renders the length of the largest chordless cycle
in the corresponding disjunctive undirected graph.
computeMeanInDegree(self)
Renders the mean indegree of self.
!!! self.size must be set previously !!!
computeMeanOutDegree(self)
Renders the mean degree of self.
!!! self.size must be set previously !!!
computeMeanSymDegree(self)
Renders the mean degree of self.
!!! self.size must be set previously !!!
computeMedianOutDegree(self)
Renders the median outdegree of self.
!!! self.size must be set previously !!!
computeMedianSymDegree(self)
Renders the median symmetric degree of self.
!!! self.size must be set previously !!!
computeMoreOrLessUnrelatedPairs(self)
Renders a list of more or less unrelated pairs.
computeNetFlowsOrder(self)
Renders an ordered list (from best to worst) of the actions
following the net flows ranking rule.
computeNetFlowsOrderDict(self)
Renders an ordered list (from worst to best) of the actions
following the net flows ranking rule.
computeNetFlowsRanking(self)
Renders an ordered list (from best to worst) of the actions
following the net flows ranking rule.
computeNetFlowsRankingDict(self)
Renders an ordered list (from best to worst) of the actions
following the net flows ranking rule.
computeODistance(self, op2, comments=False)
renders the squared normalized distance of
two digraph valuations.
 
.. note::
 
     op2 = digraphs of same order as self.
computeOrbit(self, choice, withListing=False)
renders the set of isomorph copies of a choice following
the automorphism of the digraph self
computeOrderCorrelation(self, order, Debug=False)
Renders the ordinal correlation K of a digraph instance
when compared with a given linear order (from worst to best) of its actions
 
K = sum_{x != y} [ min( max(-self.relation(x,y)),other.relation(x,y), max(self.relation(x,y),-other.relation(x,y)) ]
 
K /= sum_{x!=y} [ min(abs(self.relation(x,y),abs(other.relation(x,y)) ]
 
.. note::
 
     Renders a dictionary with the key 'correlation' containing the actual bipolar correlation index and the key 'determination' containing the minimal determination level D of self and the other relation.
 
     D = sum_{x != y} min(abs(self.relation(x,y)),abs(other.relation(x,y)) / n(n-1)
 
     where n is the number of actions considered.
 
     The correlation index with a completely indeterminate relation
     is by convention 0.0 at determination level 0.0 .
 
.. warning::
 
     self must be a normalized outranking digraph instance !
computeOrdinalCorrelation(self, other, MedianCut=False, filterRelation=None, Debug=False)
Renders the bipolar correlation K of a
self.relation when compared
with a given compatible (same actions set)) digraph or
a [-1,1] valued compatible relation (same actions set).
 
If MedianCut=True, the correlation is computed on the median polarized relations.
 
If filterRelation is not None, the correlation is computed on the partial domain corresponding to the determined part of the filter relation.
 
.. warning::
 
     Notice that the 'other' relation and/or the 'filterRelation',
     the case given, must both be normalized, ie [-1,1]-valued !
 
K = sum_{x != y} [ min( max(-self.relation[x][y]),other.relation[x][y]), max(self.relation[x][y],-other.relation[x][y]) ]
 
K /= sum_{x!=y} [ min(abs(self.relation[x][y]),abs(other.relation[x][y])) ]
 
.. note::
 
     Renders a tuple with at position 0 the actual bipolar correlation index
     and in position 1 the minimal determination level D of self and
     the other relation.
 
     D = sum_{x != y} min(abs(self.relation[x][y]),abs(other.relation[x][y])) / n(n-1)
 
     where n is the number of actions considered.
 
     The correlation index with a completely indeterminate relation
     is by convention 0.0 at determination level 0.0 .
computeOrdinalCorrelationMP(self, other, MedianCut=False, Threading=False, nbrOfCPUs=None, startMethod=None, Comments=False, Debug=False)
Multi processing version of the digraphs.computeOrdinalCorrelation() method.
 
.. note::
     The relation filtering and the MedinaCut option are not implemented in the MP version.
computePairwiseClusterComparison(self, K1, K2, Debug=False)
Computes the pairwise cluster comparison credibility vector
from bipolar-valued digraph g. with K1 and K2 disjoint
lists of action keys from g actions disctionary.
Returns the dictionary
{'I': Decimal(),'P+':Decimal(),'P-':Decimal(),'R' :Decimal()}
where one and only one item is strictly positive.
computePreKernels(self)
computing dominant and absorbent preKernels:
    Result in self.dompreKernels and self.abspreKernels
computePreRankingRelation(self, preRanking, Normalized=True, Debug=False)
Renders the bipolar-valued relation obtained from
a given preRanking in decreasing levels (list of lists) result.
computePreorderRelation(self, preorder, Normalized=True, Debug=False)
Renders the bipolar-valued relation obtained from
a given preordering in increasing levels (list of lists) result.
computePrincipalOrder(self, Colwise=False, Comments=False)
Rendesr an ordering from wrost to best of the decision actions.
computePrincipalRanking(self, Colwise=False, Comments=False)
Rendesr a ranking from best to worst of the decision actions.
computePrincipalScores(self, plotFileName=None, Colwise=False, imageType=None, tempDir=None, bgcolor='cornsilk', Comments=False, Debug=False)
Renders a ordered list of the first principal eigenvector of the covariance of the valued outdegrees of self.
 
.. note::
 
   The method, relying on writing and reading temporary files by default in a temporary directory is threading and multiprocessing safe !
   (see Digraph.exportPrincipalImage method)
computePrudentBetaLevel(self, Debug=False)
computes alpha, ie the lowest valuation level, for which the
bipolarly polarised digraph doesn't contain a chordless circuit.
computeRankingByBestChoosing(self, CoDual=False, Debug=False)
Computes a weak preordering of the self.actions by recursive
best choice elagations.
 
Stores in self.rankingByBestChoosing['result'] a list of (P+,bestChoice) tuples
where P+ gives the best choice complement outranking
average valuation via the computePairwiseClusterComparison
method.
 
If self.rankingByBestChoosing['CoDual'] is True, 
the ranking-by-choosing was computed on the codual of self.
computeRankingByBestChoosingRelation(self, rankingByBestChoosing=None, Debug=False)
Renders the bipolar-valued relation obtained from
the self.rankingByBestChoosing result.
computeRankingByChoosing(self, actionsSubset=None, Debug=False, CoDual=False)
Computes a weak preordring of the self.actions by iterating
jointly first and last choice elagations.
 
Stores in self.rankingByChoosing['result'] a list of ((P+,bestChoice),(P-,worstChoice)) pairs
where P+ (resp. P-) gives the best (resp. worst) choice complement outranking
(resp. outranked) average valuation via the computePairwiseClusterComparison
method.
 
If self.rankingByChoosing['CoDual'] is True, the ranking-by-choosing was computed on the codual of self.
computeRankingByChoosingRelation(self, rankingByChoosing=None, actionsSubset=None, Debug=False)
Renders the bipolar-valued relation obtained from
the self.rankingByChoosing result.
computeRankingByLastChoosing(self, CoDual=False, Debug=False)
Computes a weak preordring of the self.actions by iterating
worst choice elagations.
 
Stores in self.rankingByLastChoosing['result'] a list of (P-,worstChoice) pairs
where P- gives the worst choice complement outranked
average valuation via the computePairwiseClusterComparison
method.
 
If self.rankingByChoosing['CoDual'] is True, the ranking-by-last-chossing 
was computed on the codual of self.
computeRankingByLastChoosingRelation(self, rankingByLastChoosing=None, Debug=False)
Renders the bipolar-valued relation obtained from
the self.rankingByLastChoosing result.
computeRankingCorrelation(self, ranking, Debug=False)
Renders the ordinal correlation K of a digraph instance
when compared with a given linear ranking of its actions
 
K = sum_{x != y} [ min( max(-self.relation(x,y)),other.relation(x,y), max(self.relation(x,y),-other.relation(x,y)) ]
 
K /= sum_{x!=y} [ min(abs(self.relation(x,y),abs(other.relation(x,y)) ]
 
.. note::
 
     Renders a tuple with at position 0 the actual bipolar correlation index
     and in position 1 the minimal determination level D of self and
     the other relation.
 
     D = sum_{x != y} min(abs(self.relation(x,y)),abs(other.relation(x,y)) / n(n-1)
 
     where n is the number of actions considered.
 
     The correlation index with a completely indeterminate relation
     is by convention 0.0 at determination level 0.0 .
computeRelationalStructure(self, Debug=False)
Renders the counted decomposition of the valued relations into
the following type of links:
gt '>', eq '=', lt '<', incomp '<>',
leq '<=', geq '>=', indeterm '?'
computeRubisChoice(self, Comments=False, _OldCoca=False, BrokenCocs=True, Threading=False, nbrOfCPUs=1)
Renders self.strictGoodChoices, self.nullChoices
self.strictBadChoices, self.nonRobustChoices.
 
.. warning::
    Changes in site the outranking digraph by
    adding or braking chordless odd outranking circuits.
computeRubyChoice(self, Comments=False, _OldCoca=False)
dummy for computeRubisChoice()
old versions compatibility.
computeShortestPathLengths(self, WeakPaths=False, Comments=False, Debug=False)
Renders a double dictionary with the directed distances, i.e. the shortest path lengths between all self.actions
 
Equals *None* if there does not exist a directed path between two actions.
 
*Source*: Claude Berge, *The Theory of Graphs*, Dover (2001) pp. 119, original in French Dunod (1958)
computeSingletonRanking(self, Comments=False, Debug=False)
Renders the sorted bipolar net determinatation of outrankingness
minus outrankedness credibilities of all singleton choices.
 
res = ((netdet,singleton,dom,absorb)+)
computeSize(self)
Renders the number of validated non reflexive arcs
computeSizeTransitiveClosure(self)
Renders the size of the transitive closure of a digraph.
computeSlaterOrder(self, isProbabilistic=False, seed=None, sampleSize=1000, Debug=False)
Reversed return from computeSlaterRanking method.
computeSlaterRanking(self, isProbabilistic=False, seed=None, sampleSize=1000, Debug=False)
Renders a ranking of the actions with minimal Slater index.
Return a tuple: slaterOrder, slaterIndex
computeSymmetryDegree(self, InPercents=False, Comments=False)
Renders the symmetry degree (Decimal) of the irreflexive part of a digraph.
 
.. note::
 
   Empty and indeterminate digraphs are considered to be symmetric.
computeTopologicalRanking(self, Debug=False)
Mimetic Wrapper of the topologicalSort() method.
computeTransitivityDegree(self, InPercents=False, Comments=False)
Renders the transitivity degree (Decimal) of a digraph.
 
.. note:: 
 
   An empty or indeterminate digraph is considered to be transitive.
computeUnrelatedPairs(self)
Renders a list of more or less unrelated pairs.
computeValuationLevels(self, choice=None, Debug=False)
renders the symmetric closure of the
apparent valuations levels of self
in an increasingly ordered list.
If parameter choice is given, the
computation is limited to the actions
of the choice.
computeValuationPercentages(self, choice, percentiles, withValues=False)
Parameters: choice and list of percentiles.
renders a series of percentages of the characteristics valuation of
the arcs in the digraph.
computeValuationPercentiles(self, choice, percentages, withValues=False)
Parameters: choice and list of percentages.
renders a series of quantiles of the characteristics valuation of
the arcs in the digraph.
computeValuationStatistics(self, Sampling=False, Comments=False)
Renders the mean and variance of the valuation
of the non reflexive pairs.
computeValuedRankingRelation(self, ranking)
Renders the valued relation characteristics compatible 
with the given linar ranking. Discordant charcateristics 
are set to the indeterminate value.
computeWeakCondorcetLosers(self)
Wrapper for weakCondorcetLosers().
computeWeakCondorcetWinners(self)
Wrapper for weakCondorcetWinners().
computeupdown1(self, s, S)
Help method for show_MIS_HB2 method.
fills self.newmisset, self.upmis, self.downmis.
computeupdown2(self, s, S)
Help method for show_MIS_HB1 method.
Fills self.newmisset, self.upmis, self.downmis.
computeupdown2irred(self, s, S)
Help method for show_MIS_HB1 method.
Fills self.newmisset, self.upmis, self.downmis.
condorcetLosers(self)
Renders the set of decision actions x such that
self.relation[x][y] < self.valuationdomain['med']
for all y != x.
condorcetWinners(self)
Renders the set of decision actions x such that
self.relation[x][y] > self.valuationdomain['med']
for all y != x.
contra(self, v)
Parameter: choice.
Renders the negation of a choice v characteristic's vector.
convertRelationToDecimal(self)
Converts the float valued self.relation in a decimal valued one.
convertValuation2Integer(self, InSite=True, Comments=False)
Converts the self.relation valuation to integer values by converting the Decimals to Fractions and multiply by the least commun multiple of the fraction denominators.
 
*Parameters*:
 
    - If *Insite* == False (True by default) the method returns a modified copy of self.relation without altering the original self.relation, otherwise self.relation and self.valuationdomain is modified.
convertValuationToDecimal(self)
Convert the float valuation limits to Decimals.
coveringIndex(self, choice, direction='out')
Renders the covering index of a given choice in a set of objects,
ie the minimum number of choice members that cover each
non selected object.
crispKDistance(self, digraph, Debug=False)
Renders the crisp Kendall distance between two bipolar valued
digraphs.
 
.. warning::
 
     Obsolete! Is replaced by the self.computeBipolarCorrelation(other, MedianCut=True) Digraph method
detectChordlessCircuits(self, Comments=False, Debug=False)
Detects a chordless circuit in a digraph.
Returns a Boolean
detectChordlessPath(self, Pk, n2, Comments=False, Debug=False)
New procedure from Agrum study April 2009
recursive chordless path extraction starting from path
Pk = [n2, ...., n1] and ending in node n2.
Optimized with marking of visited chordless P1s.
determinateness(self, vec, inPercent=True)
Renders the determinateness of a characteristic vector *vec* = 
[(r(x),x),(r(y),y), ...] of length *n* in valuationdomain [Min,Med,Max]:
 
*result* =  sum_x( abs(r(x)-Med) ) / ( n*(Max-Med) )
 
If inPercent, *result* shifted (+1) and reduced (/2) to [0,1] range.
digraph2Graph(self, valuationDomain={'min': -1, 'med': 0, 'max': 1}, Debug=False, ConjunctiveConversion=True)
Convert a Digraph instance to a Graph instance.
dneighbors(self, node)
Renders the set of dominated out-neighbors of a node.
domin(self, choice)
Renders the dominance degree of a choice.
dominantChoices(self, S)
Generates all minimal dominant choices of a bipolar valued digraph.
 
.. note::
 
     Initiate with S = self.actions.copy().
domirred(self, choice)
Renders the crips +irredundance degree of a choice.
domirredval(self, choice, relation)
Renders the valued +irredundance degree of a choice.
domirredx(self, choice, x)
Renders the crips +irredundance degree of node x in a choice.
domkernelrestrict(self, prekernel)
Parameter: dominant prekernel
Renders dominant prekernel restricted relation.
exportGraphViz(self, fileName=None, actionsSubset=None, bestChoice=set(), worstChoice=set(), firstChoice=set(), lastChoice=set(), Comments=True, graphType='png', pictureFormat=None, graphSize='7,7', relation=None, bgcolor='cornsilk')
export GraphViz dot file  for graph drawing filtering.
exportPrincipalImage(self, plotFileName=None, pictureFormat='pdf', bgcolor='cornsilk', fontcolor='red3', fontsize='0.75', Reduced=False, Colwise=False, tempDir='.', Comments=False)
Export as PDF (default) the principal projection of
the valued relation using the three principal eigen vectors.
 
Implemeted picture formats are: 
'pdf' (default), 'png', 'jpeg' and 'xfig'.
 
The background color is set by default to 'cornsilk'. 
 
Font size and color are set by default to 'red3', resp. '0.75'. 
 
When *Reduced==True*, the valued relation characeteristics are centered and reduced.
 
When *Colwise==True*, the column vectors of the adjacency table are used for the principal projection, otherwise the rows (default) are used. Has no incidence when the *Digraph* instance *self*  is symmetric. 
 
.. warning::
 
    The method, writing and reading temporary files: 
    tempCol.r and rotationCol.csv, resp. tempRow.r and rotationRow.csv,
    by default in the working directory (./),
    is hence not safe for multiprocessing programs, unless a
    temporary directory *tempDir* is provided.
flatChoice(self, ch, Debug=False)
Converts set or list ch recursively to a flat list of items.
forcedBestSingleChoice(self)
Renders the set of most determined outranking singletons in self.
gammaSets(self)
Renders the dictionary of neighborhoods {node: (dx,ax)}
with set *dx* gathering the dominated, and set *ax* gathering
the absorbed neighborhood.
generateAbsPreKernels(self)
Generate all absorbent prekernels from independent choices generator.
generateDomPreKernels(self)
Generate all dominant prekernels from independent choices generator.
htmlChoiceVector(self, ch, ChoiceVector=True, choiceType='good')
Show procedure for annotated bipolar choices.
inDegrees(self)
renders the median cut indegrees
inDegreesDistribution(self)
Renders the distribution of indegrees.
independentChoices(self, U)
Generator for all independent choices with neighborhoods of a bipolar valued digraph:
 
.. note::
 
       * Initiate with U = self.singletons().
       * Yields [(independent choice, domnb, absnb, indnb)].
inner_prod(self, v1, v2)
Parameters: two choice characteristic vectors
Renders the inner product of two characteristic vetors.
intstab(self, choice)
Computes the independence degree of a choice.
irreflex(self, mat)
Puts diagonal entries of mat to valuationdomain['min']
isAsymmetricIndeterminate(self, Debug=False)
Checks the self.relation for assymmetric indeterminateness!!
 
.. warning::
 
    The reflexive links are ignored !!
isComplete(self, Debug=False)
checks the completeness property of self.relation by checking
for the absence of a link between two actions!!
 
.. warning::
 
    The reflexive links are ignored !!
isCyclic(self, Debug=False)
checks the cyclicity of self.relation by checking
for a reflexive loop in its transitive closure-
 
.. warning::
 
     self.relation is supposed to be irreflexive !
isIntegerValued(self, Debug=False)
Checks whether the decimal valuation of self is integer-valued
be using the as_integer_ratio() method of a Decimal 
giving a tuple (numerator,denominator). If denominator == 1, the
number is an integer.
isOutrankingDigraph(self, Comments=True, Debug=False)
Checks the outranking digraph characteristic condition (3.3).
 
relation[x][y] + relation[y][x)[y] >= 0.0
 
.. warning::
 
    The reflexive links are ignored and the valuation must be bipolar !!
isStrictOutrankingDigraph(self, Comments=True, Debug=False)
Checks the strict outranking digraph characteristic condition (3.1).
 
-(relation[x][y] + relation[y][x]) <= 0.0 , x != y
 
.. warning::
 
    The reflexive links are ignored and the valuation must be bipolar !!
isSymmetric(self, Comments=False)
True if symmetry degree == 1.0.
isTransitive(self, Comments=False)
True if transitivity degree == 1.0.
isWeaklyComplete(self, Debug=False)
checks the weakly completeness property of self.relation by checking
for the absence of a link between two actions!!
 
.. warning::
 
    The reflexive links are ignored !!
iterateRankingByChoosing(self, Odd=False, CoDual=False, Comments=True, Debug=False, Limited=None)
Renders a ranking by choosing result when progressively eliminating
all chordless (odd only) circuits with rising valuation cut levels.
 
Parameters
    CoDual = False (default)/True
    Limited = proportion (in [0,1]) * (max - med) valuationdomain
kChoices(self, A, k)
Renders all choices of length k from set A
matmult2(self, m, v)
Parameters: digraph relation and choice characteristic vector
matrix multiply vector by inner production
meanDegree(self)
Renders the mean degree of self.
!!! self.size must be set previously !!!
meanLength(self, Oriented=False)
Renders the (by default non-oriented) mean neighbourhoor depth of self.
!!! self.order must be set previously !!!
minimalChoices(self, S)
Generates all dominant or absorbent choices of a bipolar
valued digraph.
 
.. note:
 
   * Initiate with S = (actions, dict of dominant or absorbent closed neighborhoods)
   * See showMinDom and showMinAbs methods.
minimalValuationLevelForCircuitsElimination(self, Odd=True, Debug=False, Comments=False)
renders the minimal valuation level <lambda> that eliminates all
self.circuitsList stored odd chordless circuits from self.
 
.. warning::
 
    The <lambda> level polarised may still contain newly appearing chordless odd circuits !
neighbourhoodCollection(self, Oriented=False, Potential=False)
Renders the neighbourhood.
neighbourhoodDepthDistribution(self, Oriented=False)
Renders the distribtion of neighbourhood depths.
notGammaSets(self)
Renders the dictionary of neighborhoods {node: (dx,ax)}
with set *dx* gathering the not dominated, and set *ax* gathering
the not absorbed neighborhood.
notaneighbors(self, node)
Renders the set of absorbed not in-neighbors of a node.
notdneighbors(self, node)
Renders the set of not dominated out-neighbors of a node.
outDegrees(self)
renders the median cut outdegrees
outDegreesDistribution(self)
Renders the distribution of outdegrees.
plusirredundant(self, U)
Generates all +irredundant choices of a digraph.
powerset(self, U)
Generates all subsets of a set.
readPerrinMisset(self, file='curd.dat')
read method for 0-1-char-coded MISs by default from the perrinMIS.c curd.dat result file.
readabsvector(self, x, relation)
Parameter: action x
absorbent in vector.
readdomvector(self, x, relation)
Parameter: action x
dominant out vector.
recodeValuation(self, newMin=-1.0, newMax=1.0, ndigits=4, Debug=False)
Recodes the characteristic valuation domain according
to the parameters given. 
 
*ndigits* indicates the number of decimal digits of the valuation.
relationFct(self, x, y)
wrapper for self.relation dictionary access to ensure interoperability
with the sparse and big outranking digraph implementation model.
save(self, fileName='tempdigraph', option=None, DecimalValuation=True, decDigits=2)
Persistent storage of a Digraph class instance in the form of
a python source code file
saveCSV(self, fileName='tempdigraph', Normalized=False, Dual=False, Converse=False, Diagonal=False, Debug=False)
Persistent storage of a Digraph class instance in the form of
a csv file.
saveXMCDA2(self, fileName='temp', fileExt='xmcda2', Comments=True, relationName='R', relationType='binary', category='random', subcategory='valued', author='digraphs Module (RB)', reference='saved from Python', valuationType='standard', digits=2, servingD3=False)
save digraph in XMCDA 2.0 format. Deprecated now.
savedre(self, fileName='temp')
save digraph in nauty format.
sharp(self, x, y)
Paramaters: choice characteristic values.
Renders the sharpest of two characteristic values x and y.
sharpvec(self, v, w)
Paramaters: choice characteristic vectors.
Renders the sharpest of two characteristic vectors v and w.
showActions(self)
presentation methods for digraphs actions
showAll(self)
Detailed show method for genuine digraphs.
showAttributes(self)
Prints out the attributes of self.
showAutomorphismGenerators(self)
Renders the generators of the automorphism group.
showBadChoices(self, Recompute=True)
Characteristic values for potentially bad choices.
showBestChoiceRecommendation(self, Verbose=False, Comments=True, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True)
Shows the RuBis best choice recommendation.
 
.. note::
 
    Computes by default the Rubis best choice recommendation on the corresponding strict (codual) outranking digraph.
 
    By default, with BrokenCocs=True, we brake all chordless circuits at their weakest determined ( abs(r(x>y)) + abs(r(y>x)) ) link.
 
    When BrokenCocs=False we proceed like follows:
 
    In case of chordless circuits, if supporting arcs are more credible
    than the reversed negating arcs, we collapse the circuits into hyper nodes.
    Inversely,  if supporting arcs are not more credible than the reversed negating arcs,
    we brake the circuits on their weakest arc.
 
Usage example:
 
>>> from outrankingDigraphs import *
>>> t = Random3ObjectivesPerformanceTableau(seed=5)
>>> g = BipolarOutrankingDigraph(t)
>>> g.showBestChoiceRecommendation()
***********************
RuBis Best Choice Recommendation (BCR)
(in decreasing order of determinateness)   
Credibility domain:  [-100.0, 100.0]
=== >> potential first choices
* choice              : ['a04', 'a14', 'a19', 'a20']
   independence        : 1.19
   dominance           : 4.76
   absorbency          : -59.52
   covering (%)        : 75.00
   determinateness (%) : 57.86
   - most credible action(s) = { 'a14': 23.81, 'a19': 11.90, 'a04': 2.38, 'a20': 1.19, }  
=== >> potential last choices 
* choice              : ['a03', 'a12', 'a17']
  independence        : 4.76
  dominance           : -76.19
  absorbency          : 4.76
  covering (%)        : 0.00
  determinateness (%) : 65.39
  - most credible action(s) = { 'a03': 38.10, 'a12': 13.10, 'a17': 4.76, }
Execution time: 0.024 seconds
*****************************
showChoiceVector(self, ch, choiceType='good', ChoiceVector=True)
Show procedure for annotated bipolar choices.
showChordlessCircuits(self, Recompute=False)
Show method for chordless circuits observed in a Digraph instance.
 
If previous computation is required, stores the detected circuits in self.circuitsList attribute.
showComponents(self)
Shows the list of connected components of the digraph instance.
showCorrelation(self, corr=None, ndigits=3)
Renders the valued ordinal correlation index, the crisp Kendall tau index and their epistemic determination degree.
showFirstChoiceRecommendation(self, Verbose=False, Comments=True, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True)
Shows the RuBis first choice recommendation.
 
.. note::
 
    Computes by default the Rubis first choice recommendation on the corresponding strict (codual) outranking digraph.
 
    By default, with BrokenCocs=True, we brake all chordless circuits at their weakest determined ( abs(r(x>y)) + abs(r(y>x)) ) link.
 
    When BrokenCocs=False we proceed like follows:
 
    In case of chordless circuits, if supporting arcs are more credible
    than the reversed negating arcs, we collapse the circuits into hyper nodes.
    Inversely,  if supporting arcs are not more credible than the reversed negating arcs,
    we brake the circuits on their weakest arc.
 
Usage example:
 
>>> from outrankingDigraphs import *
>>> t = Random3ObjectivesPerformanceTableau(seed=5)
>>> g = BipolarOutrankingDigraph(t)
>>> g.showFirstChoiceRecommendation()
***********************
RuBis First Choice Recommendation (BCR)
(in decreasing order of determinateness)   
Credibility domain:  [-100.0, 100.0]
=== >> potential first choices
* choice              : ['a04', 'a14', 'a19', 'a20']
   independence        : 1.19
   dominance           : 4.76
   absorbency          : -59.52
   covering (%)        : 75.00
   determinateness (%) : 57.86
   - most credible action(s) = { 'a14': 23.81, 'a19': 11.90, 'a04': 2.38, 'a20': 1.19, }  
=== >> potential last choices 
* choice              : ['a03', 'a12', 'a17']
  independence        : 4.76
  dominance           : -76.19
  absorbency          : 4.76
  covering (%)        : 0.00
  determinateness (%) : 65.39
  - most credible action(s) = { 'a03': 38.10, 'a12': 13.10, 'a17': 4.76, }
Execution time: 0.024 seconds
*****************************
showGoodChoices(self, Recompute=True)
Characteristic values for potentially good choices.
showHTMLBestChoiceRecommendation(self, pageTitle=None, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True, htmlFileName=None)
showHTMLRelationHeatmap(self, actionsList=None, rankingRule='NetFlows', colorLevels=7, tableTitle='Relation Heatmap', relationName='r(x S y)', ndigits=2, fromIndex=None, toIndex=None, htmlFileName=None)
Launches a browser window with the colored relation map of self.
 
See corresponding :py:class:`~digraphs.Digraph.showHTMLRelationMap` method.
 
The *colorLevels* parameter may be set to 3, 5, 7 (default) or 9.
 
When the *actionsList* parameter is *None* (default), the digraphs actions list may be ranked with the *rankingRule* parameter set to the 'Copeland' (default) or to the 'Netlows' ranking rule.
 
When the *htmlFileName* parameter is set to a string value 'xxx', a html file named 'xxx.html' will be generated in the current working directory. Otherwise, a temporary file named 'tmp*.html' will be generated there.
 
Example::
 
    >>> from outrankingDigraphs import *
    >>> t = RandomCBPerformanceTableau(numberOfActions=25,seed=1)
    >>> g = BipolarOutrankingDigraph(t,ndigits=2)
    >>> gcd = ~(-g)  # strict outranking relation
    >>> gcd.showHTMLRelationHeatmap(colorLevels=7,ndigits=2)
    
.. image:: relationHeatmap.png
   :alt: Browser view of a relation map
   :width: 600 px
   :align: center
showHTMLRelationMap(self, actionsList=None, rankingRule='Copeland', Colored=True, tableTitle='Relation Map', relationName='r(x S y)', symbols=['+', '&middot;', '&nbsp;', '&#150;', '&#151'], fromIndex=None, toIndex=None, htmlFileName=None)
Launches a browser window with the colored relation map of self.
See corresponding Digraph.showRelationMap() method.
 
When *htmlFileName* parameter is set to a string value, a html file
with that name will be stored in the current working directory.
 
By default, a temporary file named: tmp*.html will be generated
instead in the current working directory.
 
Example::
 
    >>> from outrankingDigraphs import *
    >>> t = RandomCBPerformanceTableau(numberOfActions=25,seed=1)
    >>> g = BipolarOutrankingDigraph(t,Normalized=True)
    >>> gcd = ~(-g)  # strict outranking relation
    >>> gcd.showHTMLRelationMap(rankingRule="NetFlows")
    
.. image:: relationMap.png
   :alt: Browser view of a relation map
   :width: 600 px
   :align: center
showHTMLRelationTable(self, actionsList=None, relation=None, IntegerValues=False, ndigits=2, Colored=True, tableTitle='Valued Adjacency Matrix', relationName='r(x S y)', ReflexiveTerms=False, htmlFileName=None, fromIndex=None, toIndex=None)
Launches a browser window with the colored relation table of self.
showMIS(self, withListing=True)
Prints all maximal independent choices:
    Result in self.misset.
showMIS_AH(self, withListing=True)
Prints all MIS using the Hertz method.
 
Result saved in self.hertzmisset.
showMIS_HB2(self, withListing=True)
Prints all MIS using the Hertz-Bisdorff method.
 
Result saved in self.newmisset.
showMIS_RB(self, withListing=True)
Prints all MIS using the Bisdorff method.
 
Result saved in self.newmisset.
showMIS_UD(self, withListing=True)
Prints all MIS using the Hertz-Bisdorff method.
 
Result saved in self.newmisset.
showMaxAbsIrred(self, withListing=True)
Computing maximal -irredundant choices:
    Result in self.absirset.
showMaxDomIrred(self, withListing=True)
Computing maximal +irredundant choices:
   Result in self.domirset.
showMinAbs(self, withListing=True)
Prints minimal absorbent choices:
    Result in self.absset.
showMinDom(self, withListing=True)
Prints all minimal dominant choices:
    Result in self.domset.
showNeighborhoods(self)
Lists the gamma and the notGamma function of self.
showOrbits(self, InChoices, withListing=True)
Prints the orbits of Choices along the automorphisms of
the Digraph instance.
 
Example Python session for computing the non isomorphic MISs from the 12-cycle graph:
 
>>> from digraphs import *
>>> c12 = CirculantDigraph(order=12,circulants=[1,-1])
>>> c12.automorphismGenerators()
...
  Permutations
  {'1': '1', '2': '12', '3': '11', '4': '10', '5': 
   '9', '6': '8', '7': '7', '8': '6', '9': '5', '10': 
   '4', '11': '3', '12': '2'}
  {'1': '2', '2': '1', '3': '12', '4': '11', '5': '10', 
   '6': '9', '7': '8', '8': '7', '9': '6', '10': '5', 
   '11': '4', '12': '3'}
  Reflections {}
>>> print('grpsize = ', c12.automorphismGroupSize)
  grpsize = 24
>>> c12.showMIS(withListing=False)
  *---  Maximal independent choices ---*
  number of solutions:  29
  cardinality distribution
  card.:  [0, 1, 2, 3, 4,  5,  6, 7, 8, 9, 10, 11, 12]
  freq.:  [0, 0, 0, 0, 3, 24,  2, 0, 0, 0,  0,  0,  0]
  Results in c12.misset
>>> c12.showOrbits(c12.misset,withListing=False)
...
  *---- Global result ----
  Number of MIS:  29
  Number of orbits :  4
  Labelled representatives:
  1: ['2','4','6','8','10','12']
  2: ['2','5','8','11']
  3: ['2','4','6','9','11']
  4: ['1','4','7','9','11']
  Symmetry vector
  stabilizer size: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, ...]
  frequency      : [0, 2, 0, 0, 0, 0, 0, 1, 0,  0,  0,  1, ...]
 
*Figure*: The symmetry axes of the non isomorphic MISs of the 12-cycle:
 
.. image:: c12.png
   :width: 400 px
   :align: center
   :alt: The 4 non isomorphic MIS of the 12-cycle graph
 
*Reference*: R. Bisdorff and J.L. Marichal (2008). Counting non-isomorphic maximal independent sets of the n-cycle graph. *Journal of Integer Sequences*, Vol. 11 Article 08.5.7 (`openly accessible here <https://www.cs.uwaterloo.ca/journals/JIS/VOL11/Marichal/marichal.html>`_)
showOrbitsFromFile(self, InFile, withListing=True)
Prints the orbits of Choices along the automorphisms of
the digraph self by reading in the 0-1 misset file format.
See the :py:func:`digraphs.Digraph.readPerrinMisset` method.
showPreKernels(self, withListing=True)
Printing dominant and absorbent preKernels:
    Result in self.dompreKernels and self.abspreKernels
showRankingByBestChoosing(self, rankingByBestChoosing=None)
A show method for self.rankinByBestChoosing result.
 
.. warning::
 
     The self.computeRankingByBestChoosing(CoDual=False/True) method instantiating the self.rankingByBestChoosing slot is pre-required !
showRankingByChoosing(self, rankingByChoosing=None, WithCoverCredibility=False)
A show method for self.rankinByChoosing result.
 
When parameter *WithCoverCredibility* is set to True, the credibility of outranking, respectively being outranked is indicated at each selection step. 
 
.. warning::
 
     The self.computeRankingByChoosing(CoDual=False/True) method instantiating the self.rankingByChoosing slot is pre-required !
showRankingByLastChoosing(self, rankingByLastChoosing=None, Debug=None)
A show method for self.rankinByChoosing result.
 
.. warning::
 
     The self.computeRankingByLastChoosing(CoDual=False/True) method instantiating the self.rankingByChoosing slot is pre-required !
showRelation(self)
prints the relation valuation in ##.## format.
showRelationMap(self, symbols=None, rankingRule='Copeland', fromIndex=None, toIndex=None, actionsList=None)
Prints on the console, in text map format, the location of
certainly validated and certainly invalidated outranking situations.
 
By default, symbols = {'max':'┬','positive': '+', 'median': ' ',
                       'negative': '-', 'min': '┴'}
 
The default ordering of the output is following the Copeland ranking rule
from best to worst actions. Further available ranking rule is the 'NetFlows' net flows rule.
 
 
Example::
 
    >>> from outrankingDigraphs import *
    >>> t = RandomCBPerformanceTableau(numberOfActions=25,seed=1)
    >>> g = BipolarOutrankingDigraph(t,Normalized=True)
    >>> gcd = ~(-g)  # strict outranking relation
    >>> gcd.showRelationMap(rankingRule="NetFlows")
     -   ++++++++  +++++┬+┬┬+
    - -   + +++++ ++┬+┬+++┬++
    ┴+  ┴ + ++  ++++┬+┬┬++┬++
    -   ++ - ++++-++++++┬++┬+
       - - - ++- ┬- + -+┬+-┬┬
    -----  -      -┬┬┬-+  -┬┬
    ----    --+-+++++++++++++
    -- --+- --++ ++ +++-┬+-┬┬
    ----  -  -+-- ++--+++++ +
    ----- ++- --- +---++++┬ +
    -- -- ---+ -++-+++-+ +-++
    -- --┴---+  + +-++-+ -  +
    ---- ┴---+-- ++--++++ - +
      --┴┴--  --- -  --+ --┬┬
     ---------+--+ ----- +-┬┬
    -┴---┴- ---+- + ---+++┬ +
    -┴┴--┴---+--- ++ -++--+++
    -----┴--- ---+-+- ++---+ 
    -┴┴--------------- --++┬ 
    --┴---------------- --+┬ 
    ┴--┴┴ -┴--┴┴-┴ --++  ++-+
    ----┴┴--------------- -  
    ┴┴┴----+-┴+┴---┴-+---+ ┴+
    ┴┴-┴┴┴-┴- - -┴┴---┴┴+ ┬ -
    ----┴┴-┴-----┴┴---  - -- 
    Ranking rule: NetFlows
    >>>
showRelationTable(self, Sorted=True, rankingRule=None, IntegerValues=False, actionsSubset=None, relation=None, ndigits=2, ReflexiveTerms=True, fromIndex=None, toIndex=None)
Prints the relation valuation in actions X actions table format.
Copeland and NetFlows rankings my be used.
showRubisBestChoiceRecommendation(self, **kwargs)
Dummy for backward portable showBestChoiceRecommendation().
showRubyChoice(self, Verbose=False, Comments=True, _OldCoca=True)
Dummy for showBestChoiceRecommendation()
needed for older versions compatibility.
showShort(self)
concise presentation method for genuine digraphs.
showSingletonRanking(self, Comments=True, Debug=False)
Calls self.computeSingletonRanking(comments=True,Debug = False).
Renders and prints the sorted bipolar net determinatation of outrankingness
minus outrankedness credibilities of all singleton choices.
 
res = ((netdet,sigleton,dom,absorb)+)
showStatistics(self)
Computes digraph statistics like order, size and arc-density.
showdre(self)
Shows relation in nauty format.
singletons(self)
list of singletons and neighborhoods
[(singx1, +nx1, -nx1, not(+nx1 or -nx1)),.... ]
sizeSubGraph(self, choice)
Output: (size, undeterm,arcDensity).
Renders the arc density of the induced subgraph.
strongComponents(self, setPotential=False)
Renders the set of strong components of self.
symDegreesDistribution(self)
Renders the distribution of symmetric degrees.
topologicalSort(self, Debug=False)
If self is acyclic, adds topological sort number to each node of self
and renders ordered list of nodes. Otherwise renders None.
Source: M. Golumbic Algorithmic Graph heory and Perfect Graphs,
Annals Of Discrete Mathematics 57 2nd Ed. , Elsevier 2004, Algorithm 2.4 p.44.
weakAneighbors(self, node)
Renders the set of absorbed in-neighbors of a node.
weakCondorcetLosers(self)
Renders the set of decision actions x such that
self.relation[x][y] <= self.valuationdomain['med']
for all y != x.
weakCondorcetWinners(self)
Renders the set of decision actions x such that
self.relation[x][y] >= self.valuationdomain['med']
for all y != x.
weakDneighbors(self, node)
Renders the set of dominated out-neighbors of a node.
weakGammaSets(self)
Renders the dictionary of neighborhoods {node: (dx,ax)}
zoomValuation(self, zoomFactor=1.0)
Zooms in or out, depending on the value of the zoomFactor provided,
the bipolar valuation of a digraph.

Data descriptors inherited from Digraph:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class FusionLDigraph(Digraph)
    FusionLDigraph(L, operator='o-max', weights=None)
 
Instantiates the epistemic fusion a list L of Digraph instances.
 
Parameter:
 
    * operator := "o-max" (default) | "o-min" | "o-average:
      epistemic disjunctive, conjunctive or symmetric average fusion.
    * weights := [a,b, ...]: len(weights) matching len(L).
      If None, weights = [1 for i in range(len(L))].
 
 
Method resolution order:
FusionLDigraph
Digraph
builtins.object

Methods defined here:
__init__(self, L, operator='o-max', weights=None)
Initialize self.  See help(type(self)) for accurate signature.

Methods inherited from Digraph:
MISgen(self, S, I)
generator of maximal independent choices (voir Byskov 2004):
    * S ::= remaining nodes;
    * I ::= current independent choice
 
.. note::
 
        Inititalize: self.MISgen(self.actions.copy(),set())
__invert__(self)
Make the inverting operator ~self available for Digraph instances. 
 
Returns a ConverseDigraph instance of self.
__neg__(self)
Make the negation operator -self available for Digraph instances. 
 
Returns a DualDigraph instance of self.
__repr__(self)
Default presentation method for Digraph instances.
absirred(self, choice)
Renders the crips -irredundance degree of a choice.
absirredundant(self, U)
Generates all -irredundant choices of a digraph.
absirredval(self, choice, relation)
Renders the valued -irredundance degree of a choice.
absirredx(self, choice, x)
Computes the crips -irredundance degree of node x in a choice.
abskernelrestrict(self, prekernel)
Parameter: prekernel
Renders absorbent prekernel restricted relation.
absorb(self, choice)
Renders the absorbency degree of a choice.
absorbentChoices(self, S)
Generates all minimal absorbent choices of a bipolar valued digraph.
addValuationAttribute(self)
Adds the numpy valuation attribute
agglomerationDistribution(self)
Output: aggloCoeffDistribution, meanCoeff
Renders the distribution of agglomeration coefficients.
aneighbors(self, node)
Renders the set of absorbed in-neighbors of a node.
automorphismGenerators(self)
Adds automorphism group generators to the digraph instance.
 
.. note::
 
    Dependency: Uses the dreadnaut command from the nauty software package. See https://www3.cs.stonybrook.edu/~algorith/implement/nauty/implement.shtml
 
    On Ubuntu Linux:
      ...$ sudo apt-get install nauty
averageCoveringIndex(self, choice, direction='out')
Renders the average covering index of a given choice in a set of objects,
ie the average number of choice members that cover each
non selected object.
bipolarKCorrelation(self, digraph, Debug=False)
Renders the bipolar Kendall correlation between two bipolar valued
digraphs computed from the average valuation of the
XORDigraph(self,digraph) instance.
 
.. warning::
 
     Obsolete! Is replaced by the self.computeBipolarCorrelation(other) Digraph method
bipolarKDistance(self, digraph, Debug=False)
Renders the bipolar crisp Kendall distance between two bipolar valued
digraphs.
 
.. warning::
 
     Obsolete! Is replaced by the self.computeBipolarCorrelation(other, MedianCut=True) Digraph method
chordlessPaths(self, Pk, n2, Odd=False, Comments=False, Debug=False)
New procedure from Agrum study April 2009
recursive chordless path extraction starting from path
Pk = [n2, ...., n1] and ending in node n2.
Optimized with marking of visited chordless P1s.
circuitAverageCredibility(self, circ)
Renders the average linking credibility of a Chordless Circuit.
circuitCredibilities(self, circuit, Debug=False)
Renders the average linking credibilities and the minimal link of a Chordless Circuit.
circuitMaxCredibility(self, circ)
Renders the maximal linking credibility of a Chordless Circuit.
circuitMinCredibility(self, circ)
Renders the minimal linking credibility of a Chordless Circuit.
closeSymmetric(self, InSite=True)
Produces the symmetric closure of self.relation.
closeTransitive(self, Reverse=False, InSite=True, Comments=False)
Produces the transitive closure of self.relation
 
*Parameters*:
 
    - If *Reverse* == True (False default) all transitive links are dropped, otherwise all transitive links are closed with min[r(x,y),r(y,z)];
    - If *Insite* == False (True by default) the methods return a modified copy of self.relation without altering the original self.relation, otherwise self.relation is modified.
components(self)
Renders the list of connected components.
computeAllDensities(self, choice=None)
parameter: choice in self
renders six densitiy parameters:
arc density, double arc density,
single arc density, strict single arc density,
absence arc density, strict absence arc densitiy.
computeArrowRaynaudOrder(self)
Renders a linear ordering from worst to best of the actions following Arrow&Raynaud's rule.
computeArrowRaynaudRanking(self)
renders a linear ranking from best to worst of the actions following Arrow&Raynaud's rule.
computeAverageValuation(self)
Computes the bipolar average correlation between
self and the crisp complete digraph of same order
of the irreflexive and determined arcs of the digraph
computeBadChoices(self, Comments=False)
Computes characteristic values for potentially bad choices.
 
.. note::
 
     Returns a tuple with following content:
 
     [(0)-determ,(1)degirred,(2)degi,(3)degd,(4)dega,(5)str(choice),(6)absvec]
computeBadPirlotChoices(self, Comments=False)
Characteristic values for potentially bad choices
using the Pirlot's fixpoint algorithm.
computeBestChoiceRecommendation(self, Verbose=False, Comments=False, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True)
Sets self.bestChoice, self.bestChoiceData, self.worstChoice and self.worstChoiceData
with the showBestChoiceRecommendation method.
 
First and last choices data is the following:
[(0)-determ,(1)degirred,(2)degi,(3)degd,(4)dega,(5)str(choice),(6)domvec,(7)cover]
 
self.bestChoice = self.bestChoiceData[5]
self.worstChoice = self.worstChoiceData[5]
computeBipolarCorrelation(self, other, MedianCut=False, filterRelation=None, Debug=False)
obsolete: dummy replacement for Digraph.computeOrdinalCorrelation method
computeChordlessCircuits(self, Odd=False, Comments=False, Debug=False)
Renders the set of all chordless circuits detected in a digraph.
Result is stored in <self.circuitsList>
holding a possibly empty list of tuples with at position 0 the
list of adjacent actions of the circuit and at position 1
the set of actions in the stored circuit.
 
When *Odd* is True, only chordless circuits with an odd length
are collected.
computeChordlessCircuitsMP(self, Odd=False, Threading=False, nbrOfCPUs=None, startMethod=None, Comments=False, Debug=False)
Multiprocessing version of computeChordlessCircuits().
 
Renders the set of all chordless odd circuits detected in a digraph.
Result (possible empty list) stored in <self.circuitsList>
holding a possibly empty list tuples with at position 0 the
list of adjacent actions of the circuit and at position 1
the set of actions in the stored circuit.
Inspired by Dias, Castonguay, Longo, Jradi, Algorithmica (2015).
 
Returns a possibly empty list of tuples (circuit,frozenset(circuit)).
 
If Odd == True, only circuits of odd length are retained in the result.
computeCoSize(self)
Renders the number of non validated non reflexive arcs
computeConcentrationIndex(self, X, N)
Renders the Gini concentration index of the X serie.
N contains the partial frequencies.
Based on the triangle summation formula.
computeConcentrationIndexTrapez(self, X, N)
Renders the Gini concentration index of the X serie.
N contains the partial frequencies.
Based on the triangles summation formula.
computeCondorcetLosers(self)
Wrapper for condorcetLosers().
computeCondorcetWinners(self)
Wrapper for condorcetWinners().
computeCopelandOrder(self)
renders a linear ordering from worst to best of the actions following Arrow&Raynaud's rule.
computeCopelandRanking(self)
renders a linear ranking from best to worst of the actions following Arrow&Raynaud's rule.
computeCutLevelDensities(self, choice, level)
parameter: choice in self, robustness level
renders three robust densitiy parameters:
robust double arc density,
robust single arc density,
robust absence arc densitiy.
computeDensities(self, choice)
parameter: choice in self
renders the four densitiy parameters:
arc density, double arc density, single arc density, absence arc density.
computeDeterminateness(self, InPercents=False)
Computes the Kendalll distance of self
with the all median-valued indeterminate digraph of order n.
 
Return the average determination of the irreflexive part of the digraph.
 
*determination* = sum_(x,y) { abs[ r(xRy) - Med ] } / n(n-1)
 
If *InPercents* is True, returns the average determination in percentage of
(Max - Med) difference.
 
>>> from outrankingDigraphs import BipolarOutrankingDigraph
>>> from randomPerfTabs import Random3ObjectivesPerformanceTableau
>>> t = Random3ObjectivesPerformanceTableau(numberOfActions=7,numberOfCriteria=7,seed=101)
>>> g = BipolarOutrankingDigraph(t,Normalized=True)
>>> g
*------- Object instance description ------*
Instance class      : BipolarOutrankingDigraph
Instance name       : rel_random3ObjectivesPerfTab
Actions             : 7
Criteria            : 7
Size                : 27
Determinateness (%) : 65.67
Valuation domain    : [-1.00;1.00]
>>> print(g.computeDeterminateness())
0.3134920634920634920634920638
>>> print(g.computeDeterminateness(InPercents=True))
65.67460317460317460317460320
>>> g.recodeValuation(0,1)
>>> g
*------- Object instance description ------*
Instance class      : BipolarOutrankingDigraph
Instance name       : rel_random3ObjectivesPerfTab
Actions             : 7
Criteria            : 7
Size                : 27
Determinateness (%) : 65.67
Valuation domain    : [0.00;1.00]
>>> print(g.computeDeterminateness())
0.1567460317460317460317460318
>>> print(g.computeDeterminateness(InPercents=True))
65.67460317460317460317460320
computeDiameter(self, Oriented=True)
Renders the (by default oriented) diameter of the digraph instance
computeDigraphCentres(self, WeakDistances=False, Comments=False)
The centers of a digraph are the nodes with finite minimal shortes path lengths.
 
The maximal neighborhood distances are stored in *self.maximalNeighborhoodDistances*.
 
The corresponding digraph radius and diameter are stored respectively  in *self.radius* and *self.diameter*.
 
With *Comments* = True, all these results are printed out.
 
*Source*: Claude Berge, *The Theory of Graphs*, Dover (2001) pp. 119, original in French Dunod (1958)
computeDynamicProgrammingStages(self, source, sink, Debug=False)
Renders the discrete stages of the optimal substructure for
dynamic pogramming digrahs from a given source node 
to a given sink sink node.
 
Returns a list of list of action identifyers.
computeGoodChoiceVector(self, ker, Comments=False)
| Computing Characteristic values for dominant pre-kernels
| using the von Neumann dual fixoint equation
computeGoodChoices(self, Comments=False)
Computes characteristic values for potentially good choices.
 
..note::
 
     Return a tuple with following content:
 
     [(0)-determ,(1)degirred,(2)degi,(3)degd,(4)dega,(5)str(choice),(6)domvec,(7)cover]
computeGoodPirlotChoices(self, Comments=False)
Characteristic values for potentially good choices
using the Pirlot fixpoint algorithm.
computeIncomparabilityDegree(self, InPercents=False, Comments=False)
Renders the incomparability degree (Decimal), i.e. the relative number of symmetric indeterminate relations of the irreflexive part of a digraph.
computeKemenyIndex(self, otherRelation)
renders the Kemeny index of the self.relation
compared with a given crisp valued relation of a compatible
other digraph (same nodes or actions).
computeKemenyOrder(self, orderLimit=7, Debug=False)
Renders a ordering from worst to best of the actions with maximal Kemeny index.
Return a tuple: kemenyOrder (from worst to best), kemenyIndex
computeKemenyRanking(self, orderLimit=7, seed=None, sampleSize=1000, Debug=False)
Renders a ranking from best to worst of the actions with maximal Kemeny index.
 
.. note::
 
     Returns a tuple: kemenyRanking (from best to worst), kemenyIndex.
computeKernelVector(self, kernel, Initial=True, Comments=False)
| Computing Characteristic values for dominant pre-kernels
| using the von Neumann dual fixpoint equation
computeKohlerOrder(self)
Renders an ordering (worst to best) of the actions following Kohler's rule.
computeKohlerRanking(self)
Renders a ranking (best to worst) of the actions following Kohler's rule.
computeMaxHoleSize(self, Comments=False)
Renders the length of the largest chordless cycle
in the corresponding disjunctive undirected graph.
computeMeanInDegree(self)
Renders the mean indegree of self.
!!! self.size must be set previously !!!
computeMeanOutDegree(self)
Renders the mean degree of self.
!!! self.size must be set previously !!!
computeMeanSymDegree(self)
Renders the mean degree of self.
!!! self.size must be set previously !!!
computeMedianOutDegree(self)
Renders the median outdegree of self.
!!! self.size must be set previously !!!
computeMedianSymDegree(self)
Renders the median symmetric degree of self.
!!! self.size must be set previously !!!
computeMoreOrLessUnrelatedPairs(self)
Renders a list of more or less unrelated pairs.
computeNetFlowsOrder(self)
Renders an ordered list (from best to worst) of the actions
following the net flows ranking rule.
computeNetFlowsOrderDict(self)
Renders an ordered list (from worst to best) of the actions
following the net flows ranking rule.
computeNetFlowsRanking(self)
Renders an ordered list (from best to worst) of the actions
following the net flows ranking rule.
computeNetFlowsRankingDict(self)
Renders an ordered list (from best to worst) of the actions
following the net flows ranking rule.
computeODistance(self, op2, comments=False)
renders the squared normalized distance of
two digraph valuations.
 
.. note::
 
     op2 = digraphs of same order as self.
computeOrbit(self, choice, withListing=False)
renders the set of isomorph copies of a choice following
the automorphism of the digraph self
computeOrderCorrelation(self, order, Debug=False)
Renders the ordinal correlation K of a digraph instance
when compared with a given linear order (from worst to best) of its actions
 
K = sum_{x != y} [ min( max(-self.relation(x,y)),other.relation(x,y), max(self.relation(x,y),-other.relation(x,y)) ]
 
K /= sum_{x!=y} [ min(abs(self.relation(x,y),abs(other.relation(x,y)) ]
 
.. note::
 
     Renders a dictionary with the key 'correlation' containing the actual bipolar correlation index and the key 'determination' containing the minimal determination level D of self and the other relation.
 
     D = sum_{x != y} min(abs(self.relation(x,y)),abs(other.relation(x,y)) / n(n-1)
 
     where n is the number of actions considered.
 
     The correlation index with a completely indeterminate relation
     is by convention 0.0 at determination level 0.0 .
 
.. warning::
 
     self must be a normalized outranking digraph instance !
computeOrdinalCorrelation(self, other, MedianCut=False, filterRelation=None, Debug=False)
Renders the bipolar correlation K of a
self.relation when compared
with a given compatible (same actions set)) digraph or
a [-1,1] valued compatible relation (same actions set).
 
If MedianCut=True, the correlation is computed on the median polarized relations.
 
If filterRelation is not None, the correlation is computed on the partial domain corresponding to the determined part of the filter relation.
 
.. warning::
 
     Notice that the 'other' relation and/or the 'filterRelation',
     the case given, must both be normalized, ie [-1,1]-valued !
 
K = sum_{x != y} [ min( max(-self.relation[x][y]),other.relation[x][y]), max(self.relation[x][y],-other.relation[x][y]) ]
 
K /= sum_{x!=y} [ min(abs(self.relation[x][y]),abs(other.relation[x][y])) ]
 
.. note::
 
     Renders a tuple with at position 0 the actual bipolar correlation index
     and in position 1 the minimal determination level D of self and
     the other relation.
 
     D = sum_{x != y} min(abs(self.relation[x][y]),abs(other.relation[x][y])) / n(n-1)
 
     where n is the number of actions considered.
 
     The correlation index with a completely indeterminate relation
     is by convention 0.0 at determination level 0.0 .
computeOrdinalCorrelationMP(self, other, MedianCut=False, Threading=False, nbrOfCPUs=None, startMethod=None, Comments=False, Debug=False)
Multi processing version of the digraphs.computeOrdinalCorrelation() method.
 
.. note::
     The relation filtering and the MedinaCut option are not implemented in the MP version.
computePairwiseClusterComparison(self, K1, K2, Debug=False)
Computes the pairwise cluster comparison credibility vector
from bipolar-valued digraph g. with K1 and K2 disjoint
lists of action keys from g actions disctionary.
Returns the dictionary
{'I': Decimal(),'P+':Decimal(),'P-':Decimal(),'R' :Decimal()}
where one and only one item is strictly positive.
computePreKernels(self)
computing dominant and absorbent preKernels:
    Result in self.dompreKernels and self.abspreKernels
computePreRankingRelation(self, preRanking, Normalized=True, Debug=False)
Renders the bipolar-valued relation obtained from
a given preRanking in decreasing levels (list of lists) result.
computePreorderRelation(self, preorder, Normalized=True, Debug=False)
Renders the bipolar-valued relation obtained from
a given preordering in increasing levels (list of lists) result.
computePrincipalOrder(self, Colwise=False, Comments=False)
Rendesr an ordering from wrost to best of the decision actions.
computePrincipalRanking(self, Colwise=False, Comments=False)
Rendesr a ranking from best to worst of the decision actions.
computePrincipalScores(self, plotFileName=None, Colwise=False, imageType=None, tempDir=None, bgcolor='cornsilk', Comments=False, Debug=False)
Renders a ordered list of the first principal eigenvector of the covariance of the valued outdegrees of self.
 
.. note::
 
   The method, relying on writing and reading temporary files by default in a temporary directory is threading and multiprocessing safe !
   (see Digraph.exportPrincipalImage method)
computePrudentBetaLevel(self, Debug=False)
computes alpha, ie the lowest valuation level, for which the
bipolarly polarised digraph doesn't contain a chordless circuit.
computeRankingByBestChoosing(self, CoDual=False, Debug=False)
Computes a weak preordering of the self.actions by recursive
best choice elagations.
 
Stores in self.rankingByBestChoosing['result'] a list of (P+,bestChoice) tuples
where P+ gives the best choice complement outranking
average valuation via the computePairwiseClusterComparison
method.
 
If self.rankingByBestChoosing['CoDual'] is True, 
the ranking-by-choosing was computed on the codual of self.
computeRankingByBestChoosingRelation(self, rankingByBestChoosing=None, Debug=False)
Renders the bipolar-valued relation obtained from
the self.rankingByBestChoosing result.
computeRankingByChoosing(self, actionsSubset=None, Debug=False, CoDual=False)
Computes a weak preordring of the self.actions by iterating
jointly first and last choice elagations.
 
Stores in self.rankingByChoosing['result'] a list of ((P+,bestChoice),(P-,worstChoice)) pairs
where P+ (resp. P-) gives the best (resp. worst) choice complement outranking
(resp. outranked) average valuation via the computePairwiseClusterComparison
method.
 
If self.rankingByChoosing['CoDual'] is True, the ranking-by-choosing was computed on the codual of self.
computeRankingByChoosingRelation(self, rankingByChoosing=None, actionsSubset=None, Debug=False)
Renders the bipolar-valued relation obtained from
the self.rankingByChoosing result.
computeRankingByLastChoosing(self, CoDual=False, Debug=False)
Computes a weak preordring of the self.actions by iterating
worst choice elagations.
 
Stores in self.rankingByLastChoosing['result'] a list of (P-,worstChoice) pairs
where P- gives the worst choice complement outranked
average valuation via the computePairwiseClusterComparison
method.
 
If self.rankingByChoosing['CoDual'] is True, the ranking-by-last-chossing 
was computed on the codual of self.
computeRankingByLastChoosingRelation(self, rankingByLastChoosing=None, Debug=False)
Renders the bipolar-valued relation obtained from
the self.rankingByLastChoosing result.
computeRankingCorrelation(self, ranking, Debug=False)
Renders the ordinal correlation K of a digraph instance
when compared with a given linear ranking of its actions
 
K = sum_{x != y} [ min( max(-self.relation(x,y)),other.relation(x,y), max(self.relation(x,y),-other.relation(x,y)) ]
 
K /= sum_{x!=y} [ min(abs(self.relation(x,y),abs(other.relation(x,y)) ]
 
.. note::
 
     Renders a tuple with at position 0 the actual bipolar correlation index
     and in position 1 the minimal determination level D of self and
     the other relation.
 
     D = sum_{x != y} min(abs(self.relation(x,y)),abs(other.relation(x,y)) / n(n-1)
 
     where n is the number of actions considered.
 
     The correlation index with a completely indeterminate relation
     is by convention 0.0 at determination level 0.0 .
computeRelationalStructure(self, Debug=False)
Renders the counted decomposition of the valued relations into
the following type of links:
gt '>', eq '=', lt '<', incomp '<>',
leq '<=', geq '>=', indeterm '?'
computeRubisChoice(self, Comments=False, _OldCoca=False, BrokenCocs=True, Threading=False, nbrOfCPUs=1)
Renders self.strictGoodChoices, self.nullChoices
self.strictBadChoices, self.nonRobustChoices.
 
.. warning::
    Changes in site the outranking digraph by
    adding or braking chordless odd outranking circuits.
computeRubyChoice(self, Comments=False, _OldCoca=False)
dummy for computeRubisChoice()
old versions compatibility.
computeShortestPathLengths(self, WeakPaths=False, Comments=False, Debug=False)
Renders a double dictionary with the directed distances, i.e. the shortest path lengths between all self.actions
 
Equals *None* if there does not exist a directed path between two actions.
 
*Source*: Claude Berge, *The Theory of Graphs*, Dover (2001) pp. 119, original in French Dunod (1958)
computeSingletonRanking(self, Comments=False, Debug=False)
Renders the sorted bipolar net determinatation of outrankingness
minus outrankedness credibilities of all singleton choices.
 
res = ((netdet,singleton,dom,absorb)+)
computeSize(self)
Renders the number of validated non reflexive arcs
computeSizeTransitiveClosure(self)
Renders the size of the transitive closure of a digraph.
computeSlaterOrder(self, isProbabilistic=False, seed=None, sampleSize=1000, Debug=False)
Reversed return from computeSlaterRanking method.
computeSlaterRanking(self, isProbabilistic=False, seed=None, sampleSize=1000, Debug=False)
Renders a ranking of the actions with minimal Slater index.
Return a tuple: slaterOrder, slaterIndex
computeSymmetryDegree(self, InPercents=False, Comments=False)
Renders the symmetry degree (Decimal) of the irreflexive part of a digraph.
 
.. note::
 
   Empty and indeterminate digraphs are considered to be symmetric.
computeTopologicalRanking(self, Debug=False)
Mimetic Wrapper of the topologicalSort() method.
computeTransitivityDegree(self, InPercents=False, Comments=False)
Renders the transitivity degree (Decimal) of a digraph.
 
.. note:: 
 
   An empty or indeterminate digraph is considered to be transitive.
computeUnrelatedPairs(self)
Renders a list of more or less unrelated pairs.
computeValuationLevels(self, choice=None, Debug=False)
renders the symmetric closure of the
apparent valuations levels of self
in an increasingly ordered list.
If parameter choice is given, the
computation is limited to the actions
of the choice.
computeValuationPercentages(self, choice, percentiles, withValues=False)
Parameters: choice and list of percentiles.
renders a series of percentages of the characteristics valuation of
the arcs in the digraph.
computeValuationPercentiles(self, choice, percentages, withValues=False)
Parameters: choice and list of percentages.
renders a series of quantiles of the characteristics valuation of
the arcs in the digraph.
computeValuationStatistics(self, Sampling=False, Comments=False)
Renders the mean and variance of the valuation
of the non reflexive pairs.
computeValuedRankingRelation(self, ranking)
Renders the valued relation characteristics compatible 
with the given linar ranking. Discordant charcateristics 
are set to the indeterminate value.
computeWeakCondorcetLosers(self)
Wrapper for weakCondorcetLosers().
computeWeakCondorcetWinners(self)
Wrapper for weakCondorcetWinners().
computeupdown1(self, s, S)
Help method for show_MIS_HB2 method.
fills self.newmisset, self.upmis, self.downmis.
computeupdown2(self, s, S)
Help method for show_MIS_HB1 method.
Fills self.newmisset, self.upmis, self.downmis.
computeupdown2irred(self, s, S)
Help method for show_MIS_HB1 method.
Fills self.newmisset, self.upmis, self.downmis.
condorcetLosers(self)
Renders the set of decision actions x such that
self.relation[x][y] < self.valuationdomain['med']
for all y != x.
condorcetWinners(self)
Renders the set of decision actions x such that
self.relation[x][y] > self.valuationdomain['med']
for all y != x.
contra(self, v)
Parameter: choice.
Renders the negation of a choice v characteristic's vector.
convertRelationToDecimal(self)
Converts the float valued self.relation in a decimal valued one.
convertValuation2Integer(self, InSite=True, Comments=False)
Converts the self.relation valuation to integer values by converting the Decimals to Fractions and multiply by the least commun multiple of the fraction denominators.
 
*Parameters*:
 
    - If *Insite* == False (True by default) the method returns a modified copy of self.relation without altering the original self.relation, otherwise self.relation and self.valuationdomain is modified.
convertValuationToDecimal(self)
Convert the float valuation limits to Decimals.
coveringIndex(self, choice, direction='out')
Renders the covering index of a given choice in a set of objects,
ie the minimum number of choice members that cover each
non selected object.
crispKDistance(self, digraph, Debug=False)
Renders the crisp Kendall distance between two bipolar valued
digraphs.
 
.. warning::
 
     Obsolete! Is replaced by the self.computeBipolarCorrelation(other, MedianCut=True) Digraph method
detectChordlessCircuits(self, Comments=False, Debug=False)
Detects a chordless circuit in a digraph.
Returns a Boolean
detectChordlessPath(self, Pk, n2, Comments=False, Debug=False)
New procedure from Agrum study April 2009
recursive chordless path extraction starting from path
Pk = [n2, ...., n1] and ending in node n2.
Optimized with marking of visited chordless P1s.
determinateness(self, vec, inPercent=True)
Renders the determinateness of a characteristic vector *vec* = 
[(r(x),x),(r(y),y), ...] of length *n* in valuationdomain [Min,Med,Max]:
 
*result* =  sum_x( abs(r(x)-Med) ) / ( n*(Max-Med) )
 
If inPercent, *result* shifted (+1) and reduced (/2) to [0,1] range.
digraph2Graph(self, valuationDomain={'min': -1, 'med': 0, 'max': 1}, Debug=False, ConjunctiveConversion=True)
Convert a Digraph instance to a Graph instance.
dneighbors(self, node)
Renders the set of dominated out-neighbors of a node.
domin(self, choice)
Renders the dominance degree of a choice.
dominantChoices(self, S)
Generates all minimal dominant choices of a bipolar valued digraph.
 
.. note::
 
     Initiate with S = self.actions.copy().
domirred(self, choice)
Renders the crips +irredundance degree of a choice.
domirredval(self, choice, relation)
Renders the valued +irredundance degree of a choice.
domirredx(self, choice, x)
Renders the crips +irredundance degree of node x in a choice.
domkernelrestrict(self, prekernel)
Parameter: dominant prekernel
Renders dominant prekernel restricted relation.
exportGraphViz(self, fileName=None, actionsSubset=None, bestChoice=set(), worstChoice=set(), firstChoice=set(), lastChoice=set(), Comments=True, graphType='png', pictureFormat=None, graphSize='7,7', relation=None, bgcolor='cornsilk')
export GraphViz dot file  for graph drawing filtering.
exportPrincipalImage(self, plotFileName=None, pictureFormat='pdf', bgcolor='cornsilk', fontcolor='red3', fontsize='0.75', Reduced=False, Colwise=False, tempDir='.', Comments=False)
Export as PDF (default) the principal projection of
the valued relation using the three principal eigen vectors.
 
Implemeted picture formats are: 
'pdf' (default), 'png', 'jpeg' and 'xfig'.
 
The background color is set by default to 'cornsilk'. 
 
Font size and color are set by default to 'red3', resp. '0.75'. 
 
When *Reduced==True*, the valued relation characeteristics are centered and reduced.
 
When *Colwise==True*, the column vectors of the adjacency table are used for the principal projection, otherwise the rows (default) are used. Has no incidence when the *Digraph* instance *self*  is symmetric. 
 
.. warning::
 
    The method, writing and reading temporary files: 
    tempCol.r and rotationCol.csv, resp. tempRow.r and rotationRow.csv,
    by default in the working directory (./),
    is hence not safe for multiprocessing programs, unless a
    temporary directory *tempDir* is provided.
flatChoice(self, ch, Debug=False)
Converts set or list ch recursively to a flat list of items.
forcedBestSingleChoice(self)
Renders the set of most determined outranking singletons in self.
gammaSets(self)
Renders the dictionary of neighborhoods {node: (dx,ax)}
with set *dx* gathering the dominated, and set *ax* gathering
the absorbed neighborhood.
generateAbsPreKernels(self)
Generate all absorbent prekernels from independent choices generator.
generateDomPreKernels(self)
Generate all dominant prekernels from independent choices generator.
htmlChoiceVector(self, ch, ChoiceVector=True, choiceType='good')
Show procedure for annotated bipolar choices.
inDegrees(self)
renders the median cut indegrees
inDegreesDistribution(self)
Renders the distribution of indegrees.
independentChoices(self, U)
Generator for all independent choices with neighborhoods of a bipolar valued digraph:
 
.. note::
 
       * Initiate with U = self.singletons().
       * Yields [(independent choice, domnb, absnb, indnb)].
inner_prod(self, v1, v2)
Parameters: two choice characteristic vectors
Renders the inner product of two characteristic vetors.
intstab(self, choice)
Computes the independence degree of a choice.
irreflex(self, mat)
Puts diagonal entries of mat to valuationdomain['min']
isAsymmetricIndeterminate(self, Debug=False)
Checks the self.relation for assymmetric indeterminateness!!
 
.. warning::
 
    The reflexive links are ignored !!
isComplete(self, Debug=False)
checks the completeness property of self.relation by checking
for the absence of a link between two actions!!
 
.. warning::
 
    The reflexive links are ignored !!
isCyclic(self, Debug=False)
checks the cyclicity of self.relation by checking
for a reflexive loop in its transitive closure-
 
.. warning::
 
     self.relation is supposed to be irreflexive !
isIntegerValued(self, Debug=False)
Checks whether the decimal valuation of self is integer-valued
be using the as_integer_ratio() method of a Decimal 
giving a tuple (numerator,denominator). If denominator == 1, the
number is an integer.
isOutrankingDigraph(self, Comments=True, Debug=False)
Checks the outranking digraph characteristic condition (3.3).
 
relation[x][y] + relation[y][x)[y] >= 0.0
 
.. warning::
 
    The reflexive links are ignored and the valuation must be bipolar !!
isStrictOutrankingDigraph(self, Comments=True, Debug=False)
Checks the strict outranking digraph characteristic condition (3.1).
 
-(relation[x][y] + relation[y][x]) <= 0.0 , x != y
 
.. warning::
 
    The reflexive links are ignored and the valuation must be bipolar !!
isSymmetric(self, Comments=False)
True if symmetry degree == 1.0.
isTransitive(self, Comments=False)
True if transitivity degree == 1.0.
isWeaklyComplete(self, Debug=False)
checks the weakly completeness property of self.relation by checking
for the absence of a link between two actions!!
 
.. warning::
 
    The reflexive links are ignored !!
iterateRankingByChoosing(self, Odd=False, CoDual=False, Comments=True, Debug=False, Limited=None)
Renders a ranking by choosing result when progressively eliminating
all chordless (odd only) circuits with rising valuation cut levels.
 
Parameters
    CoDual = False (default)/True
    Limited = proportion (in [0,1]) * (max - med) valuationdomain
kChoices(self, A, k)
Renders all choices of length k from set A
matmult2(self, m, v)
Parameters: digraph relation and choice characteristic vector
matrix multiply vector by inner production
meanDegree(self)
Renders the mean degree of self.
!!! self.size must be set previously !!!
meanLength(self, Oriented=False)
Renders the (by default non-oriented) mean neighbourhoor depth of self.
!!! self.order must be set previously !!!
minimalChoices(self, S)
Generates all dominant or absorbent choices of a bipolar
valued digraph.
 
.. note:
 
   * Initiate with S = (actions, dict of dominant or absorbent closed neighborhoods)
   * See showMinDom and showMinAbs methods.
minimalValuationLevelForCircuitsElimination(self, Odd=True, Debug=False, Comments=False)
renders the minimal valuation level <lambda> that eliminates all
self.circuitsList stored odd chordless circuits from self.
 
.. warning::
 
    The <lambda> level polarised may still contain newly appearing chordless odd circuits !
neighbourhoodCollection(self, Oriented=False, Potential=False)
Renders the neighbourhood.
neighbourhoodDepthDistribution(self, Oriented=False)
Renders the distribtion of neighbourhood depths.
notGammaSets(self)
Renders the dictionary of neighborhoods {node: (dx,ax)}
with set *dx* gathering the not dominated, and set *ax* gathering
the not absorbed neighborhood.
notaneighbors(self, node)
Renders the set of absorbed not in-neighbors of a node.
notdneighbors(self, node)
Renders the set of not dominated out-neighbors of a node.
outDegrees(self)
renders the median cut outdegrees
outDegreesDistribution(self)
Renders the distribution of outdegrees.
plusirredundant(self, U)
Generates all +irredundant choices of a digraph.
powerset(self, U)
Generates all subsets of a set.
readPerrinMisset(self, file='curd.dat')
read method for 0-1-char-coded MISs by default from the perrinMIS.c curd.dat result file.
readabsvector(self, x, relation)
Parameter: action x
absorbent in vector.
readdomvector(self, x, relation)
Parameter: action x
dominant out vector.
recodeValuation(self, newMin=-1.0, newMax=1.0, ndigits=4, Debug=False)
Recodes the characteristic valuation domain according
to the parameters given. 
 
*ndigits* indicates the number of decimal digits of the valuation.
relationFct(self, x, y)
wrapper for self.relation dictionary access to ensure interoperability
with the sparse and big outranking digraph implementation model.
save(self, fileName='tempdigraph', option=None, DecimalValuation=True, decDigits=2)
Persistent storage of a Digraph class instance in the form of
a python source code file
saveCSV(self, fileName='tempdigraph', Normalized=False, Dual=False, Converse=False, Diagonal=False, Debug=False)
Persistent storage of a Digraph class instance in the form of
a csv file.
saveXMCDA2(self, fileName='temp', fileExt='xmcda2', Comments=True, relationName='R', relationType='binary', category='random', subcategory='valued', author='digraphs Module (RB)', reference='saved from Python', valuationType='standard', digits=2, servingD3=False)
save digraph in XMCDA 2.0 format. Deprecated now.
savedre(self, fileName='temp')
save digraph in nauty format.
sharp(self, x, y)
Paramaters: choice characteristic values.
Renders the sharpest of two characteristic values x and y.
sharpvec(self, v, w)
Paramaters: choice characteristic vectors.
Renders the sharpest of two characteristic vectors v and w.
showActions(self)
presentation methods for digraphs actions
showAll(self)
Detailed show method for genuine digraphs.
showAttributes(self)
Prints out the attributes of self.
showAutomorphismGenerators(self)
Renders the generators of the automorphism group.
showBadChoices(self, Recompute=True)
Characteristic values for potentially bad choices.
showBestChoiceRecommendation(self, Verbose=False, Comments=True, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True)
Shows the RuBis best choice recommendation.
 
.. note::
 
    Computes by default the Rubis best choice recommendation on the corresponding strict (codual) outranking digraph.
 
    By default, with BrokenCocs=True, we brake all chordless circuits at their weakest determined ( abs(r(x>y)) + abs(r(y>x)) ) link.
 
    When BrokenCocs=False we proceed like follows:
 
    In case of chordless circuits, if supporting arcs are more credible
    than the reversed negating arcs, we collapse the circuits into hyper nodes.
    Inversely,  if supporting arcs are not more credible than the reversed negating arcs,
    we brake the circuits on their weakest arc.
 
Usage example:
 
>>> from outrankingDigraphs import *
>>> t = Random3ObjectivesPerformanceTableau(seed=5)
>>> g = BipolarOutrankingDigraph(t)
>>> g.showBestChoiceRecommendation()
***********************
RuBis Best Choice Recommendation (BCR)
(in decreasing order of determinateness)   
Credibility domain:  [-100.0, 100.0]
=== >> potential first choices
* choice              : ['a04', 'a14', 'a19', 'a20']
   independence        : 1.19
   dominance           : 4.76
   absorbency          : -59.52
   covering (%)        : 75.00
   determinateness (%) : 57.86
   - most credible action(s) = { 'a14': 23.81, 'a19': 11.90, 'a04': 2.38, 'a20': 1.19, }  
=== >> potential last choices 
* choice              : ['a03', 'a12', 'a17']
  independence        : 4.76
  dominance           : -76.19
  absorbency          : 4.76
  covering (%)        : 0.00
  determinateness (%) : 65.39
  - most credible action(s) = { 'a03': 38.10, 'a12': 13.10, 'a17': 4.76, }
Execution time: 0.024 seconds
*****************************
showChoiceVector(self, ch, choiceType='good', ChoiceVector=True)
Show procedure for annotated bipolar choices.
showChordlessCircuits(self, Recompute=False)
Show method for chordless circuits observed in a Digraph instance.
 
If previous computation is required, stores the detected circuits in self.circuitsList attribute.
showComponents(self)
Shows the list of connected components of the digraph instance.
showCorrelation(self, corr=None, ndigits=3)
Renders the valued ordinal correlation index, the crisp Kendall tau index and their epistemic determination degree.
showFirstChoiceRecommendation(self, Verbose=False, Comments=True, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True)
Shows the RuBis first choice recommendation.
 
.. note::
 
    Computes by default the Rubis first choice recommendation on the corresponding strict (codual) outranking digraph.
 
    By default, with BrokenCocs=True, we brake all chordless circuits at their weakest determined ( abs(r(x>y)) + abs(r(y>x)) ) link.
 
    When BrokenCocs=False we proceed like follows:
 
    In case of chordless circuits, if supporting arcs are more credible
    than the reversed negating arcs, we collapse the circuits into hyper nodes.
    Inversely,  if supporting arcs are not more credible than the reversed negating arcs,
    we brake the circuits on their weakest arc.
 
Usage example:
 
>>> from outrankingDigraphs import *
>>> t = Random3ObjectivesPerformanceTableau(seed=5)
>>> g = BipolarOutrankingDigraph(t)
>>> g.showFirstChoiceRecommendation()
***********************
RuBis First Choice Recommendation (BCR)
(in decreasing order of determinateness)   
Credibility domain:  [-100.0, 100.0]
=== >> potential first choices
* choice              : ['a04', 'a14', 'a19', 'a20']
   independence        : 1.19
   dominance           : 4.76
   absorbency          : -59.52
   covering (%)        : 75.00
   determinateness (%) : 57.86
   - most credible action(s) = { 'a14': 23.81, 'a19': 11.90, 'a04': 2.38, 'a20': 1.19, }  
=== >> potential last choices 
* choice              : ['a03', 'a12', 'a17']
  independence        : 4.76
  dominance           : -76.19
  absorbency          : 4.76
  covering (%)        : 0.00
  determinateness (%) : 65.39
  - most credible action(s) = { 'a03': 38.10, 'a12': 13.10, 'a17': 4.76, }
Execution time: 0.024 seconds
*****************************
showGoodChoices(self, Recompute=True)
Characteristic values for potentially good choices.
showHTMLBestChoiceRecommendation(self, pageTitle=None, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True, htmlFileName=None)
showHTMLRelationHeatmap(self, actionsList=None, rankingRule='NetFlows', colorLevels=7, tableTitle='Relation Heatmap', relationName='r(x S y)', ndigits=2, fromIndex=None, toIndex=None, htmlFileName=None)
Launches a browser window with the colored relation map of self.
 
See corresponding :py:class:`~digraphs.Digraph.showHTMLRelationMap` method.
 
The *colorLevels* parameter may be set to 3, 5, 7 (default) or 9.
 
When the *actionsList* parameter is *None* (default), the digraphs actions list may be ranked with the *rankingRule* parameter set to the 'Copeland' (default) or to the 'Netlows' ranking rule.
 
When the *htmlFileName* parameter is set to a string value 'xxx', a html file named 'xxx.html' will be generated in the current working directory. Otherwise, a temporary file named 'tmp*.html' will be generated there.
 
Example::
 
    >>> from outrankingDigraphs import *
    >>> t = RandomCBPerformanceTableau(numberOfActions=25,seed=1)
    >>> g = BipolarOutrankingDigraph(t,ndigits=2)
    >>> gcd = ~(-g)  # strict outranking relation
    >>> gcd.showHTMLRelationHeatmap(colorLevels=7,ndigits=2)
    
.. image:: relationHeatmap.png
   :alt: Browser view of a relation map
   :width: 600 px
   :align: center
showHTMLRelationMap(self, actionsList=None, rankingRule='Copeland', Colored=True, tableTitle='Relation Map', relationName='r(x S y)', symbols=['+', '&middot;', '&nbsp;', '&#150;', '&#151'], fromIndex=None, toIndex=None, htmlFileName=None)
Launches a browser window with the colored relation map of self.
See corresponding Digraph.showRelationMap() method.
 
When *htmlFileName* parameter is set to a string value, a html file
with that name will be stored in the current working directory.
 
By default, a temporary file named: tmp*.html will be generated
instead in the current working directory.
 
Example::
 
    >>> from outrankingDigraphs import *
    >>> t = RandomCBPerformanceTableau(numberOfActions=25,seed=1)
    >>> g = BipolarOutrankingDigraph(t,Normalized=True)
    >>> gcd = ~(-g)  # strict outranking relation
    >>> gcd.showHTMLRelationMap(rankingRule="NetFlows")
    
.. image:: relationMap.png
   :alt: Browser view of a relation map
   :width: 600 px
   :align: center
showHTMLRelationTable(self, actionsList=None, relation=None, IntegerValues=False, ndigits=2, Colored=True, tableTitle='Valued Adjacency Matrix', relationName='r(x S y)', ReflexiveTerms=False, htmlFileName=None, fromIndex=None, toIndex=None)
Launches a browser window with the colored relation table of self.
showMIS(self, withListing=True)
Prints all maximal independent choices:
    Result in self.misset.
showMIS_AH(self, withListing=True)
Prints all MIS using the Hertz method.
 
Result saved in self.hertzmisset.
showMIS_HB2(self, withListing=True)
Prints all MIS using the Hertz-Bisdorff method.
 
Result saved in self.newmisset.
showMIS_RB(self, withListing=True)
Prints all MIS using the Bisdorff method.
 
Result saved in self.newmisset.
showMIS_UD(self, withListing=True)
Prints all MIS using the Hertz-Bisdorff method.
 
Result saved in self.newmisset.
showMaxAbsIrred(self, withListing=True)
Computing maximal -irredundant choices:
    Result in self.absirset.
showMaxDomIrred(self, withListing=True)
Computing maximal +irredundant choices:
   Result in self.domirset.
showMinAbs(self, withListing=True)
Prints minimal absorbent choices:
    Result in self.absset.
showMinDom(self, withListing=True)
Prints all minimal dominant choices:
    Result in self.domset.
showNeighborhoods(self)
Lists the gamma and the notGamma function of self.
showOrbits(self, InChoices, withListing=True)
Prints the orbits of Choices along the automorphisms of
the Digraph instance.
 
Example Python session for computing the non isomorphic MISs from the 12-cycle graph:
 
>>> from digraphs import *
>>> c12 = CirculantDigraph(order=12,circulants=[1,-1])
>>> c12.automorphismGenerators()
...
  Permutations
  {'1': '1', '2': '12', '3': '11', '4': '10', '5': 
   '9', '6': '8', '7': '7', '8': '6', '9': '5', '10': 
   '4', '11': '3', '12': '2'}
  {'1': '2', '2': '1', '3': '12', '4': '11', '5': '10', 
   '6': '9', '7': '8', '8': '7', '9': '6', '10': '5', 
   '11': '4', '12': '3'}
  Reflections {}
>>> print('grpsize = ', c12.automorphismGroupSize)
  grpsize = 24
>>> c12.showMIS(withListing=False)
  *---  Maximal independent choices ---*
  number of solutions:  29
  cardinality distribution
  card.:  [0, 1, 2, 3, 4,  5,  6, 7, 8, 9, 10, 11, 12]
  freq.:  [0, 0, 0, 0, 3, 24,  2, 0, 0, 0,  0,  0,  0]
  Results in c12.misset
>>> c12.showOrbits(c12.misset,withListing=False)
...
  *---- Global result ----
  Number of MIS:  29
  Number of orbits :  4
  Labelled representatives:
  1: ['2','4','6','8','10','12']
  2: ['2','5','8','11']
  3: ['2','4','6','9','11']
  4: ['1','4','7','9','11']
  Symmetry vector
  stabilizer size: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, ...]
  frequency      : [0, 2, 0, 0, 0, 0, 0, 1, 0,  0,  0,  1, ...]
 
*Figure*: The symmetry axes of the non isomorphic MISs of the 12-cycle:
 
.. image:: c12.png
   :width: 400 px
   :align: center
   :alt: The 4 non isomorphic MIS of the 12-cycle graph
 
*Reference*: R. Bisdorff and J.L. Marichal (2008). Counting non-isomorphic maximal independent sets of the n-cycle graph. *Journal of Integer Sequences*, Vol. 11 Article 08.5.7 (`openly accessible here <https://www.cs.uwaterloo.ca/journals/JIS/VOL11/Marichal/marichal.html>`_)
showOrbitsFromFile(self, InFile, withListing=True)
Prints the orbits of Choices along the automorphisms of
the digraph self by reading in the 0-1 misset file format.
See the :py:func:`digraphs.Digraph.readPerrinMisset` method.
showPreKernels(self, withListing=True)
Printing dominant and absorbent preKernels:
    Result in self.dompreKernels and self.abspreKernels
showRankingByBestChoosing(self, rankingByBestChoosing=None)
A show method for self.rankinByBestChoosing result.
 
.. warning::
 
     The self.computeRankingByBestChoosing(CoDual=False/True) method instantiating the self.rankingByBestChoosing slot is pre-required !
showRankingByChoosing(self, rankingByChoosing=None, WithCoverCredibility=False)
A show method for self.rankinByChoosing result.
 
When parameter *WithCoverCredibility* is set to True, the credibility of outranking, respectively being outranked is indicated at each selection step. 
 
.. warning::
 
     The self.computeRankingByChoosing(CoDual=False/True) method instantiating the self.rankingByChoosing slot is pre-required !
showRankingByLastChoosing(self, rankingByLastChoosing=None, Debug=None)
A show method for self.rankinByChoosing result.
 
.. warning::
 
     The self.computeRankingByLastChoosing(CoDual=False/True) method instantiating the self.rankingByChoosing slot is pre-required !
showRelation(self)
prints the relation valuation in ##.## format.
showRelationMap(self, symbols=None, rankingRule='Copeland', fromIndex=None, toIndex=None, actionsList=None)
Prints on the console, in text map format, the location of
certainly validated and certainly invalidated outranking situations.
 
By default, symbols = {'max':'┬','positive': '+', 'median': ' ',
                       'negative': '-', 'min': '┴'}
 
The default ordering of the output is following the Copeland ranking rule
from best to worst actions. Further available ranking rule is the 'NetFlows' net flows rule.
 
 
Example::
 
    >>> from outrankingDigraphs import *
    >>> t = RandomCBPerformanceTableau(numberOfActions=25,seed=1)
    >>> g = BipolarOutrankingDigraph(t,Normalized=True)
    >>> gcd = ~(-g)  # strict outranking relation
    >>> gcd.showRelationMap(rankingRule="NetFlows")
     -   ++++++++  +++++┬+┬┬+
    - -   + +++++ ++┬+┬+++┬++
    ┴+  ┴ + ++  ++++┬+┬┬++┬++
    -   ++ - ++++-++++++┬++┬+
       - - - ++- ┬- + -+┬+-┬┬
    -----  -      -┬┬┬-+  -┬┬
    ----    --+-+++++++++++++
    -- --+- --++ ++ +++-┬+-┬┬
    ----  -  -+-- ++--+++++ +
    ----- ++- --- +---++++┬ +
    -- -- ---+ -++-+++-+ +-++
    -- --┴---+  + +-++-+ -  +
    ---- ┴---+-- ++--++++ - +
      --┴┴--  --- -  --+ --┬┬
     ---------+--+ ----- +-┬┬
    -┴---┴- ---+- + ---+++┬ +
    -┴┴--┴---+--- ++ -++--+++
    -----┴--- ---+-+- ++---+ 
    -┴┴--------------- --++┬ 
    --┴---------------- --+┬ 
    ┴--┴┴ -┴--┴┴-┴ --++  ++-+
    ----┴┴--------------- -  
    ┴┴┴----+-┴+┴---┴-+---+ ┴+
    ┴┴-┴┴┴-┴- - -┴┴---┴┴+ ┬ -
    ----┴┴-┴-----┴┴---  - -- 
    Ranking rule: NetFlows
    >>>
showRelationTable(self, Sorted=True, rankingRule=None, IntegerValues=False, actionsSubset=None, relation=None, ndigits=2, ReflexiveTerms=True, fromIndex=None, toIndex=None)
Prints the relation valuation in actions X actions table format.
Copeland and NetFlows rankings my be used.
showRubisBestChoiceRecommendation(self, **kwargs)
Dummy for backward portable showBestChoiceRecommendation().
showRubyChoice(self, Verbose=False, Comments=True, _OldCoca=True)
Dummy for showBestChoiceRecommendation()
needed for older versions compatibility.
showShort(self)
concise presentation method for genuine digraphs.
showSingletonRanking(self, Comments=True, Debug=False)
Calls self.computeSingletonRanking(comments=True,Debug = False).
Renders and prints the sorted bipolar net determinatation of outrankingness
minus outrankedness credibilities of all singleton choices.
 
res = ((netdet,sigleton,dom,absorb)+)
showStatistics(self)
Computes digraph statistics like order, size and arc-density.
showdre(self)
Shows relation in nauty format.
singletons(self)
list of singletons and neighborhoods
[(singx1, +nx1, -nx1, not(+nx1 or -nx1)),.... ]
sizeSubGraph(self, choice)
Output: (size, undeterm,arcDensity).
Renders the arc density of the induced subgraph.
strongComponents(self, setPotential=False)
Renders the set of strong components of self.
symDegreesDistribution(self)
Renders the distribution of symmetric degrees.
topologicalSort(self, Debug=False)
If self is acyclic, adds topological sort number to each node of self
and renders ordered list of nodes. Otherwise renders None.
Source: M. Golumbic Algorithmic Graph heory and Perfect Graphs,
Annals Of Discrete Mathematics 57 2nd Ed. , Elsevier 2004, Algorithm 2.4 p.44.
weakAneighbors(self, node)
Renders the set of absorbed in-neighbors of a node.
weakCondorcetLosers(self)
Renders the set of decision actions x such that
self.relation[x][y] <= self.valuationdomain['med']
for all y != x.
weakCondorcetWinners(self)
Renders the set of decision actions x such that
self.relation[x][y] >= self.valuationdomain['med']
for all y != x.
weakDneighbors(self, node)
Renders the set of dominated out-neighbors of a node.
weakGammaSets(self)
Renders the dictionary of neighborhoods {node: (dx,ax)}
zoomValuation(self, zoomFactor=1.0)
Zooms in or out, depending on the value of the zoomFactor provided,
the bipolar valuation of a digraph.

Data descriptors inherited from Digraph:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class GraphBorder(Digraph)
    GraphBorder(other, Debug=False)
 
Instantiates the partial digraph induced by its border,
i.e. be the union of its initial and terminal kernels.
 
 
Method resolution order:
GraphBorder
Digraph
builtins.object

Methods defined here:
__init__(self, other, Debug=False)
Initialize self.  See help(type(self)) for accurate signature.

Methods inherited from Digraph:
MISgen(self, S, I)
generator of maximal independent choices (voir Byskov 2004):
    * S ::= remaining nodes;
    * I ::= current independent choice
 
.. note::
 
        Inititalize: self.MISgen(self.actions.copy(),set())
__invert__(self)
Make the inverting operator ~self available for Digraph instances. 
 
Returns a ConverseDigraph instance of self.
__neg__(self)
Make the negation operator -self available for Digraph instances. 
 
Returns a DualDigraph instance of self.
__repr__(self)
Default presentation method for Digraph instances.
absirred(self, choice)
Renders the crips -irredundance degree of a choice.
absirredundant(self, U)
Generates all -irredundant choices of a digraph.
absirredval(self, choice, relation)
Renders the valued -irredundance degree of a choice.
absirredx(self, choice, x)
Computes the crips -irredundance degree of node x in a choice.
abskernelrestrict(self, prekernel)
Parameter: prekernel
Renders absorbent prekernel restricted relation.
absorb(self, choice)
Renders the absorbency degree of a choice.
absorbentChoices(self, S)
Generates all minimal absorbent choices of a bipolar valued digraph.
addValuationAttribute(self)
Adds the numpy valuation attribute
agglomerationDistribution(self)
Output: aggloCoeffDistribution, meanCoeff
Renders the distribution of agglomeration coefficients.
aneighbors(self, node)
Renders the set of absorbed in-neighbors of a node.
automorphismGenerators(self)
Adds automorphism group generators to the digraph instance.
 
.. note::
 
    Dependency: Uses the dreadnaut command from the nauty software package. See https://www3.cs.stonybrook.edu/~algorith/implement/nauty/implement.shtml
 
    On Ubuntu Linux:
      ...$ sudo apt-get install nauty
averageCoveringIndex(self, choice, direction='out')
Renders the average covering index of a given choice in a set of objects,
ie the average number of choice members that cover each
non selected object.
bipolarKCorrelation(self, digraph, Debug=False)
Renders the bipolar Kendall correlation between two bipolar valued
digraphs computed from the average valuation of the
XORDigraph(self,digraph) instance.
 
.. warning::
 
     Obsolete! Is replaced by the self.computeBipolarCorrelation(other) Digraph method
bipolarKDistance(self, digraph, Debug=False)
Renders the bipolar crisp Kendall distance between two bipolar valued
digraphs.
 
.. warning::
 
     Obsolete! Is replaced by the self.computeBipolarCorrelation(other, MedianCut=True) Digraph method
chordlessPaths(self, Pk, n2, Odd=False, Comments=False, Debug=False)
New procedure from Agrum study April 2009
recursive chordless path extraction starting from path
Pk = [n2, ...., n1] and ending in node n2.
Optimized with marking of visited chordless P1s.
circuitAverageCredibility(self, circ)
Renders the average linking credibility of a Chordless Circuit.
circuitCredibilities(self, circuit, Debug=False)
Renders the average linking credibilities and the minimal link of a Chordless Circuit.
circuitMaxCredibility(self, circ)
Renders the maximal linking credibility of a Chordless Circuit.
circuitMinCredibility(self, circ)
Renders the minimal linking credibility of a Chordless Circuit.
closeSymmetric(self, InSite=True)
Produces the symmetric closure of self.relation.
closeTransitive(self, Reverse=False, InSite=True, Comments=False)
Produces the transitive closure of self.relation
 
*Parameters*:
 
    - If *Reverse* == True (False default) all transitive links are dropped, otherwise all transitive links are closed with min[r(x,y),r(y,z)];
    - If *Insite* == False (True by default) the methods return a modified copy of self.relation without altering the original self.relation, otherwise self.relation is modified.
components(self)
Renders the list of connected components.
computeAllDensities(self, choice=None)
parameter: choice in self
renders six densitiy parameters:
arc density, double arc density,
single arc density, strict single arc density,
absence arc density, strict absence arc densitiy.
computeArrowRaynaudOrder(self)
Renders a linear ordering from worst to best of the actions following Arrow&Raynaud's rule.
computeArrowRaynaudRanking(self)
renders a linear ranking from best to worst of the actions following Arrow&Raynaud's rule.
computeAverageValuation(self)
Computes the bipolar average correlation between
self and the crisp complete digraph of same order
of the irreflexive and determined arcs of the digraph
computeBadChoices(self, Comments=False)
Computes characteristic values for potentially bad choices.
 
.. note::
 
     Returns a tuple with following content:
 
     [(0)-determ,(1)degirred,(2)degi,(3)degd,(4)dega,(5)str(choice),(6)absvec]
computeBadPirlotChoices(self, Comments=False)
Characteristic values for potentially bad choices
using the Pirlot's fixpoint algorithm.
computeBestChoiceRecommendation(self, Verbose=False, Comments=False, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True)
Sets self.bestChoice, self.bestChoiceData, self.worstChoice and self.worstChoiceData
with the showBestChoiceRecommendation method.
 
First and last choices data is the following:
[(0)-determ,(1)degirred,(2)degi,(3)degd,(4)dega,(5)str(choice),(6)domvec,(7)cover]
 
self.bestChoice = self.bestChoiceData[5]
self.worstChoice = self.worstChoiceData[5]
computeBipolarCorrelation(self, other, MedianCut=False, filterRelation=None, Debug=False)
obsolete: dummy replacement for Digraph.computeOrdinalCorrelation method
computeChordlessCircuits(self, Odd=False, Comments=False, Debug=False)
Renders the set of all chordless circuits detected in a digraph.
Result is stored in <self.circuitsList>
holding a possibly empty list of tuples with at position 0 the
list of adjacent actions of the circuit and at position 1
the set of actions in the stored circuit.
 
When *Odd* is True, only chordless circuits with an odd length
are collected.
computeChordlessCircuitsMP(self, Odd=False, Threading=False, nbrOfCPUs=None, startMethod=None, Comments=False, Debug=False)
Multiprocessing version of computeChordlessCircuits().
 
Renders the set of all chordless odd circuits detected in a digraph.
Result (possible empty list) stored in <self.circuitsList>
holding a possibly empty list tuples with at position 0 the
list of adjacent actions of the circuit and at position 1
the set of actions in the stored circuit.
Inspired by Dias, Castonguay, Longo, Jradi, Algorithmica (2015).
 
Returns a possibly empty list of tuples (circuit,frozenset(circuit)).
 
If Odd == True, only circuits of odd length are retained in the result.
computeCoSize(self)
Renders the number of non validated non reflexive arcs
computeConcentrationIndex(self, X, N)
Renders the Gini concentration index of the X serie.
N contains the partial frequencies.
Based on the triangle summation formula.
computeConcentrationIndexTrapez(self, X, N)
Renders the Gini concentration index of the X serie.
N contains the partial frequencies.
Based on the triangles summation formula.
computeCondorcetLosers(self)
Wrapper for condorcetLosers().
computeCondorcetWinners(self)
Wrapper for condorcetWinners().
computeCopelandOrder(self)
renders a linear ordering from worst to best of the actions following Arrow&Raynaud's rule.
computeCopelandRanking(self)
renders a linear ranking from best to worst of the actions following Arrow&Raynaud's rule.
computeCutLevelDensities(self, choice, level)
parameter: choice in self, robustness level
renders three robust densitiy parameters:
robust double arc density,
robust single arc density,
robust absence arc densitiy.
computeDensities(self, choice)
parameter: choice in self
renders the four densitiy parameters:
arc density, double arc density, single arc density, absence arc density.
computeDeterminateness(self, InPercents=False)
Computes the Kendalll distance of self
with the all median-valued indeterminate digraph of order n.
 
Return the average determination of the irreflexive part of the digraph.
 
*determination* = sum_(x,y) { abs[ r(xRy) - Med ] } / n(n-1)
 
If *InPercents* is True, returns the average determination in percentage of
(Max - Med) difference.
 
>>> from outrankingDigraphs import BipolarOutrankingDigraph
>>> from randomPerfTabs import Random3ObjectivesPerformanceTableau
>>> t = Random3ObjectivesPerformanceTableau(numberOfActions=7,numberOfCriteria=7,seed=101)
>>> g = BipolarOutrankingDigraph(t,Normalized=True)
>>> g
*------- Object instance description ------*
Instance class      : BipolarOutrankingDigraph
Instance name       : rel_random3ObjectivesPerfTab
Actions             : 7
Criteria            : 7
Size                : 27
Determinateness (%) : 65.67
Valuation domain    : [-1.00;1.00]
>>> print(g.computeDeterminateness())
0.3134920634920634920634920638
>>> print(g.computeDeterminateness(InPercents=True))
65.67460317460317460317460320
>>> g.recodeValuation(0,1)
>>> g
*------- Object instance description ------*
Instance class      : BipolarOutrankingDigraph
Instance name       : rel_random3ObjectivesPerfTab
Actions             : 7
Criteria            : 7
Size                : 27
Determinateness (%) : 65.67
Valuation domain    : [0.00;1.00]
>>> print(g.computeDeterminateness())
0.1567460317460317460317460318
>>> print(g.computeDeterminateness(InPercents=True))
65.67460317460317460317460320
computeDiameter(self, Oriented=True)
Renders the (by default oriented) diameter of the digraph instance
computeDigraphCentres(self, WeakDistances=False, Comments=False)
The centers of a digraph are the nodes with finite minimal shortes path lengths.
 
The maximal neighborhood distances are stored in *self.maximalNeighborhoodDistances*.
 
The corresponding digraph radius and diameter are stored respectively  in *self.radius* and *self.diameter*.
 
With *Comments* = True, all these results are printed out.
 
*Source*: Claude Berge, *The Theory of Graphs*, Dover (2001) pp. 119, original in French Dunod (1958)
computeDynamicProgrammingStages(self, source, sink, Debug=False)
Renders the discrete stages of the optimal substructure for
dynamic pogramming digrahs from a given source node 
to a given sink sink node.
 
Returns a list of list of action identifyers.
computeGoodChoiceVector(self, ker, Comments=False)
| Computing Characteristic values for dominant pre-kernels
| using the von Neumann dual fixoint equation
computeGoodChoices(self, Comments=False)
Computes characteristic values for potentially good choices.
 
..note::
 
     Return a tuple with following content:
 
     [(0)-determ,(1)degirred,(2)degi,(3)degd,(4)dega,(5)str(choice),(6)domvec,(7)cover]
computeGoodPirlotChoices(self, Comments=False)
Characteristic values for potentially good choices
using the Pirlot fixpoint algorithm.
computeIncomparabilityDegree(self, InPercents=False, Comments=False)
Renders the incomparability degree (Decimal), i.e. the relative number of symmetric indeterminate relations of the irreflexive part of a digraph.
computeKemenyIndex(self, otherRelation)
renders the Kemeny index of the self.relation
compared with a given crisp valued relation of a compatible
other digraph (same nodes or actions).
computeKemenyOrder(self, orderLimit=7, Debug=False)
Renders a ordering from worst to best of the actions with maximal Kemeny index.
Return a tuple: kemenyOrder (from worst to best), kemenyIndex
computeKemenyRanking(self, orderLimit=7, seed=None, sampleSize=1000, Debug=False)
Renders a ranking from best to worst of the actions with maximal Kemeny index.
 
.. note::
 
     Returns a tuple: kemenyRanking (from best to worst), kemenyIndex.
computeKernelVector(self, kernel, Initial=True, Comments=False)
| Computing Characteristic values for dominant pre-kernels
| using the von Neumann dual fixpoint equation
computeKohlerOrder(self)
Renders an ordering (worst to best) of the actions following Kohler's rule.
computeKohlerRanking(self)
Renders a ranking (best to worst) of the actions following Kohler's rule.
computeMaxHoleSize(self, Comments=False)
Renders the length of the largest chordless cycle
in the corresponding disjunctive undirected graph.
computeMeanInDegree(self)
Renders the mean indegree of self.
!!! self.size must be set previously !!!
computeMeanOutDegree(self)
Renders the mean degree of self.
!!! self.size must be set previously !!!
computeMeanSymDegree(self)
Renders the mean degree of self.
!!! self.size must be set previously !!!
computeMedianOutDegree(self)
Renders the median outdegree of self.
!!! self.size must be set previously !!!
computeMedianSymDegree(self)
Renders the median symmetric degree of self.
!!! self.size must be set previously !!!
computeMoreOrLessUnrelatedPairs(self)
Renders a list of more or less unrelated pairs.
computeNetFlowsOrder(self)
Renders an ordered list (from best to worst) of the actions
following the net flows ranking rule.
computeNetFlowsOrderDict(self)
Renders an ordered list (from worst to best) of the actions
following the net flows ranking rule.
computeNetFlowsRanking(self)
Renders an ordered list (from best to worst) of the actions
following the net flows ranking rule.
computeNetFlowsRankingDict(self)
Renders an ordered list (from best to worst) of the actions
following the net flows ranking rule.
computeODistance(self, op2, comments=False)
renders the squared normalized distance of
two digraph valuations.
 
.. note::
 
     op2 = digraphs of same order as self.
computeOrbit(self, choice, withListing=False)
renders the set of isomorph copies of a choice following
the automorphism of the digraph self
computeOrderCorrelation(self, order, Debug=False)
Renders the ordinal correlation K of a digraph instance
when compared with a given linear order (from worst to best) of its actions
 
K = sum_{x != y} [ min( max(-self.relation(x,y)),other.relation(x,y), max(self.relation(x,y),-other.relation(x,y)) ]
 
K /= sum_{x!=y} [ min(abs(self.relation(x,y),abs(other.relation(x,y)) ]
 
.. note::
 
     Renders a dictionary with the key 'correlation' containing the actual bipolar correlation index and the key 'determination' containing the minimal determination level D of self and the other relation.
 
     D = sum_{x != y} min(abs(self.relation(x,y)),abs(other.relation(x,y)) / n(n-1)
 
     where n is the number of actions considered.
 
     The correlation index with a completely indeterminate relation
     is by convention 0.0 at determination level 0.0 .
 
.. warning::
 
     self must be a normalized outranking digraph instance !
computeOrdinalCorrelation(self, other, MedianCut=False, filterRelation=None, Debug=False)
Renders the bipolar correlation K of a
self.relation when compared
with a given compatible (same actions set)) digraph or
a [-1,1] valued compatible relation (same actions set).
 
If MedianCut=True, the correlation is computed on the median polarized relations.
 
If filterRelation is not None, the correlation is computed on the partial domain corresponding to the determined part of the filter relation.
 
.. warning::
 
     Notice that the 'other' relation and/or the 'filterRelation',
     the case given, must both be normalized, ie [-1,1]-valued !
 
K = sum_{x != y} [ min( max(-self.relation[x][y]),other.relation[x][y]), max(self.relation[x][y],-other.relation[x][y]) ]
 
K /= sum_{x!=y} [ min(abs(self.relation[x][y]),abs(other.relation[x][y])) ]
 
.. note::
 
     Renders a tuple with at position 0 the actual bipolar correlation index
     and in position 1 the minimal determination level D of self and
     the other relation.
 
     D = sum_{x != y} min(abs(self.relation[x][y]),abs(other.relation[x][y])) / n(n-1)
 
     where n is the number of actions considered.
 
     The correlation index with a completely indeterminate relation
     is by convention 0.0 at determination level 0.0 .
computeOrdinalCorrelationMP(self, other, MedianCut=False, Threading=False, nbrOfCPUs=None, startMethod=None, Comments=False, Debug=False)
Multi processing version of the digraphs.computeOrdinalCorrelation() method.
 
.. note::
     The relation filtering and the MedinaCut option are not implemented in the MP version.
computePairwiseClusterComparison(self, K1, K2, Debug=False)
Computes the pairwise cluster comparison credibility vector
from bipolar-valued digraph g. with K1 and K2 disjoint
lists of action keys from g actions disctionary.
Returns the dictionary
{'I': Decimal(),'P+':Decimal(),'P-':Decimal(),'R' :Decimal()}
where one and only one item is strictly positive.
computePreKernels(self)
computing dominant and absorbent preKernels:
    Result in self.dompreKernels and self.abspreKernels
computePreRankingRelation(self, preRanking, Normalized=True, Debug=False)
Renders the bipolar-valued relation obtained from
a given preRanking in decreasing levels (list of lists) result.
computePreorderRelation(self, preorder, Normalized=True, Debug=False)
Renders the bipolar-valued relation obtained from
a given preordering in increasing levels (list of lists) result.
computePrincipalOrder(self, Colwise=False, Comments=False)
Rendesr an ordering from wrost to best of the decision actions.
computePrincipalRanking(self, Colwise=False, Comments=False)
Rendesr a ranking from best to worst of the decision actions.
computePrincipalScores(self, plotFileName=None, Colwise=False, imageType=None, tempDir=None, bgcolor='cornsilk', Comments=False, Debug=False)
Renders a ordered list of the first principal eigenvector of the covariance of the valued outdegrees of self.
 
.. note::
 
   The method, relying on writing and reading temporary files by default in a temporary directory is threading and multiprocessing safe !
   (see Digraph.exportPrincipalImage method)
computePrudentBetaLevel(self, Debug=False)
computes alpha, ie the lowest valuation level, for which the
bipolarly polarised digraph doesn't contain a chordless circuit.
computeRankingByBestChoosing(self, CoDual=False, Debug=False)
Computes a weak preordering of the self.actions by recursive
best choice elagations.
 
Stores in self.rankingByBestChoosing['result'] a list of (P+,bestChoice) tuples
where P+ gives the best choice complement outranking
average valuation via the computePairwiseClusterComparison
method.
 
If self.rankingByBestChoosing['CoDual'] is True, 
the ranking-by-choosing was computed on the codual of self.
computeRankingByBestChoosingRelation(self, rankingByBestChoosing=None, Debug=False)
Renders the bipolar-valued relation obtained from
the self.rankingByBestChoosing result.
computeRankingByChoosing(self, actionsSubset=None, Debug=False, CoDual=False)
Computes a weak preordring of the self.actions by iterating
jointly first and last choice elagations.
 
Stores in self.rankingByChoosing['result'] a list of ((P+,bestChoice),(P-,worstChoice)) pairs
where P+ (resp. P-) gives the best (resp. worst) choice complement outranking
(resp. outranked) average valuation via the computePairwiseClusterComparison
method.
 
If self.rankingByChoosing['CoDual'] is True, the ranking-by-choosing was computed on the codual of self.
computeRankingByChoosingRelation(self, rankingByChoosing=None, actionsSubset=None, Debug=False)
Renders the bipolar-valued relation obtained from
the self.rankingByChoosing result.
computeRankingByLastChoosing(self, CoDual=False, Debug=False)
Computes a weak preordring of the self.actions by iterating
worst choice elagations.
 
Stores in self.rankingByLastChoosing['result'] a list of (P-,worstChoice) pairs
where P- gives the worst choice complement outranked
average valuation via the computePairwiseClusterComparison
method.
 
If self.rankingByChoosing['CoDual'] is True, the ranking-by-last-chossing 
was computed on the codual of self.
computeRankingByLastChoosingRelation(self, rankingByLastChoosing=None, Debug=False)
Renders the bipolar-valued relation obtained from
the self.rankingByLastChoosing result.
computeRankingCorrelation(self, ranking, Debug=False)
Renders the ordinal correlation K of a digraph instance
when compared with a given linear ranking of its actions
 
K = sum_{x != y} [ min( max(-self.relation(x,y)),other.relation(x,y), max(self.relation(x,y),-other.relation(x,y)) ]
 
K /= sum_{x!=y} [ min(abs(self.relation(x,y),abs(other.relation(x,y)) ]
 
.. note::
 
     Renders a tuple with at position 0 the actual bipolar correlation index
     and in position 1 the minimal determination level D of self and
     the other relation.
 
     D = sum_{x != y} min(abs(self.relation(x,y)),abs(other.relation(x,y)) / n(n-1)
 
     where n is the number of actions considered.
 
     The correlation index with a completely indeterminate relation
     is by convention 0.0 at determination level 0.0 .
computeRelationalStructure(self, Debug=False)
Renders the counted decomposition of the valued relations into
the following type of links:
gt '>', eq '=', lt '<', incomp '<>',
leq '<=', geq '>=', indeterm '?'
computeRubisChoice(self, Comments=False, _OldCoca=False, BrokenCocs=True, Threading=False, nbrOfCPUs=1)
Renders self.strictGoodChoices, self.nullChoices
self.strictBadChoices, self.nonRobustChoices.
 
.. warning::
    Changes in site the outranking digraph by
    adding or braking chordless odd outranking circuits.
computeRubyChoice(self, Comments=False, _OldCoca=False)
dummy for computeRubisChoice()
old versions compatibility.
computeShortestPathLengths(self, WeakPaths=False, Comments=False, Debug=False)
Renders a double dictionary with the directed distances, i.e. the shortest path lengths between all self.actions
 
Equals *None* if there does not exist a directed path between two actions.
 
*Source*: Claude Berge, *The Theory of Graphs*, Dover (2001) pp. 119, original in French Dunod (1958)
computeSingletonRanking(self, Comments=False, Debug=False)
Renders the sorted bipolar net determinatation of outrankingness
minus outrankedness credibilities of all singleton choices.
 
res = ((netdet,singleton,dom,absorb)+)
computeSize(self)
Renders the number of validated non reflexive arcs
computeSizeTransitiveClosure(self)
Renders the size of the transitive closure of a digraph.
computeSlaterOrder(self, isProbabilistic=False, seed=None, sampleSize=1000, Debug=False)
Reversed return from computeSlaterRanking method.
computeSlaterRanking(self, isProbabilistic=False, seed=None, sampleSize=1000, Debug=False)
Renders a ranking of the actions with minimal Slater index.
Return a tuple: slaterOrder, slaterIndex
computeSymmetryDegree(self, InPercents=False, Comments=False)
Renders the symmetry degree (Decimal) of the irreflexive part of a digraph.
 
.. note::
 
   Empty and indeterminate digraphs are considered to be symmetric.
computeTopologicalRanking(self, Debug=False)
Mimetic Wrapper of the topologicalSort() method.
computeTransitivityDegree(self, InPercents=False, Comments=False)
Renders the transitivity degree (Decimal) of a digraph.
 
.. note:: 
 
   An empty or indeterminate digraph is considered to be transitive.
computeUnrelatedPairs(self)
Renders a list of more or less unrelated pairs.
computeValuationLevels(self, choice=None, Debug=False)
renders the symmetric closure of the
apparent valuations levels of self
in an increasingly ordered list.
If parameter choice is given, the
computation is limited to the actions
of the choice.
computeValuationPercentages(self, choice, percentiles, withValues=False)
Parameters: choice and list of percentiles.
renders a series of percentages of the characteristics valuation of
the arcs in the digraph.
computeValuationPercentiles(self, choice, percentages, withValues=False)
Parameters: choice and list of percentages.
renders a series of quantiles of the characteristics valuation of
the arcs in the digraph.
computeValuationStatistics(self, Sampling=False, Comments=False)
Renders the mean and variance of the valuation
of the non reflexive pairs.
computeValuedRankingRelation(self, ranking)
Renders the valued relation characteristics compatible 
with the given linar ranking. Discordant charcateristics 
are set to the indeterminate value.
computeWeakCondorcetLosers(self)
Wrapper for weakCondorcetLosers().
computeWeakCondorcetWinners(self)
Wrapper for weakCondorcetWinners().
computeupdown1(self, s, S)
Help method for show_MIS_HB2 method.
fills self.newmisset, self.upmis, self.downmis.
computeupdown2(self, s, S)
Help method for show_MIS_HB1 method.
Fills self.newmisset, self.upmis, self.downmis.
computeupdown2irred(self, s, S)
Help method for show_MIS_HB1 method.
Fills self.newmisset, self.upmis, self.downmis.
condorcetLosers(self)
Renders the set of decision actions x such that
self.relation[x][y] < self.valuationdomain['med']
for all y != x.
condorcetWinners(self)
Renders the set of decision actions x such that
self.relation[x][y] > self.valuationdomain['med']
for all y != x.
contra(self, v)
Parameter: choice.
Renders the negation of a choice v characteristic's vector.
convertRelationToDecimal(self)
Converts the float valued self.relation in a decimal valued one.
convertValuation2Integer(self, InSite=True, Comments=False)
Converts the self.relation valuation to integer values by converting the Decimals to Fractions and multiply by the least commun multiple of the fraction denominators.
 
*Parameters*:
 
    - If *Insite* == False (True by default) the method returns a modified copy of self.relation without altering the original self.relation, otherwise self.relation and self.valuationdomain is modified.
convertValuationToDecimal(self)
Convert the float valuation limits to Decimals.
coveringIndex(self, choice, direction='out')
Renders the covering index of a given choice in a set of objects,
ie the minimum number of choice members that cover each
non selected object.
crispKDistance(self, digraph, Debug=False)
Renders the crisp Kendall distance between two bipolar valued
digraphs.
 
.. warning::
 
     Obsolete! Is replaced by the self.computeBipolarCorrelation(other, MedianCut=True) Digraph method
detectChordlessCircuits(self, Comments=False, Debug=False)
Detects a chordless circuit in a digraph.
Returns a Boolean
detectChordlessPath(self, Pk, n2, Comments=False, Debug=False)
New procedure from Agrum study April 2009
recursive chordless path extraction starting from path
Pk = [n2, ...., n1] and ending in node n2.
Optimized with marking of visited chordless P1s.
determinateness(self, vec, inPercent=True)
Renders the determinateness of a characteristic vector *vec* = 
[(r(x),x),(r(y),y), ...] of length *n* in valuationdomain [Min,Med,Max]:
 
*result* =  sum_x( abs(r(x)-Med) ) / ( n*(Max-Med) )
 
If inPercent, *result* shifted (+1) and reduced (/2) to [0,1] range.
digraph2Graph(self, valuationDomain={'min': -1, 'med': 0, 'max': 1}, Debug=False, ConjunctiveConversion=True)
Convert a Digraph instance to a Graph instance.
dneighbors(self, node)
Renders the set of dominated out-neighbors of a node.
domin(self, choice)
Renders the dominance degree of a choice.
dominantChoices(self, S)
Generates all minimal dominant choices of a bipolar valued digraph.
 
.. note::
 
     Initiate with S = self.actions.copy().
domirred(self, choice)
Renders the crips +irredundance degree of a choice.
domirredval(self, choice, relation)
Renders the valued +irredundance degree of a choice.
domirredx(self, choice, x)
Renders the crips +irredundance degree of node x in a choice.
domkernelrestrict(self, prekernel)
Parameter: dominant prekernel
Renders dominant prekernel restricted relation.
exportGraphViz(self, fileName=None, actionsSubset=None, bestChoice=set(), worstChoice=set(), firstChoice=set(), lastChoice=set(), Comments=True, graphType='png', pictureFormat=None, graphSize='7,7', relation=None, bgcolor='cornsilk')
export GraphViz dot file  for graph drawing filtering.
exportPrincipalImage(self, plotFileName=None, pictureFormat='pdf', bgcolor='cornsilk', fontcolor='red3', fontsize='0.75', Reduced=False, Colwise=False, tempDir='.', Comments=False)
Export as PDF (default) the principal projection of
the valued relation using the three principal eigen vectors.
 
Implemeted picture formats are: 
'pdf' (default), 'png', 'jpeg' and 'xfig'.
 
The background color is set by default to 'cornsilk'. 
 
Font size and color are set by default to 'red3', resp. '0.75'. 
 
When *Reduced==True*, the valued relation characeteristics are centered and reduced.
 
When *Colwise==True*, the column vectors of the adjacency table are used for the principal projection, otherwise the rows (default) are used. Has no incidence when the *Digraph* instance *self*  is symmetric. 
 
.. warning::
 
    The method, writing and reading temporary files: 
    tempCol.r and rotationCol.csv, resp. tempRow.r and rotationRow.csv,
    by default in the working directory (./),
    is hence not safe for multiprocessing programs, unless a
    temporary directory *tempDir* is provided.
flatChoice(self, ch, Debug=False)
Converts set or list ch recursively to a flat list of items.
forcedBestSingleChoice(self)
Renders the set of most determined outranking singletons in self.
gammaSets(self)
Renders the dictionary of neighborhoods {node: (dx,ax)}
with set *dx* gathering the dominated, and set *ax* gathering
the absorbed neighborhood.
generateAbsPreKernels(self)
Generate all absorbent prekernels from independent choices generator.
generateDomPreKernels(self)
Generate all dominant prekernels from independent choices generator.
htmlChoiceVector(self, ch, ChoiceVector=True, choiceType='good')
Show procedure for annotated bipolar choices.
inDegrees(self)
renders the median cut indegrees
inDegreesDistribution(self)
Renders the distribution of indegrees.
independentChoices(self, U)
Generator for all independent choices with neighborhoods of a bipolar valued digraph:
 
.. note::
 
       * Initiate with U = self.singletons().
       * Yields [(independent choice, domnb, absnb, indnb)].
inner_prod(self, v1, v2)
Parameters: two choice characteristic vectors
Renders the inner product of two characteristic vetors.
intstab(self, choice)
Computes the independence degree of a choice.
irreflex(self, mat)
Puts diagonal entries of mat to valuationdomain['min']
isAsymmetricIndeterminate(self, Debug=False)
Checks the self.relation for assymmetric indeterminateness!!
 
.. warning::
 
    The reflexive links are ignored !!
isComplete(self, Debug=False)
checks the completeness property of self.relation by checking
for the absence of a link between two actions!!
 
.. warning::
 
    The reflexive links are ignored !!
isCyclic(self, Debug=False)
checks the cyclicity of self.relation by checking
for a reflexive loop in its transitive closure-
 
.. warning::
 
     self.relation is supposed to be irreflexive !
isIntegerValued(self, Debug=False)
Checks whether the decimal valuation of self is integer-valued
be using the as_integer_ratio() method of a Decimal 
giving a tuple (numerator,denominator). If denominator == 1, the
number is an integer.
isOutrankingDigraph(self, Comments=True, Debug=False)
Checks the outranking digraph characteristic condition (3.3).
 
relation[x][y] + relation[y][x)[y] >= 0.0
 
.. warning::
 
    The reflexive links are ignored and the valuation must be bipolar !!
isStrictOutrankingDigraph(self, Comments=True, Debug=False)
Checks the strict outranking digraph characteristic condition (3.1).
 
-(relation[x][y] + relation[y][x]) <= 0.0 , x != y
 
.. warning::
 
    The reflexive links are ignored and the valuation must be bipolar !!
isSymmetric(self, Comments=False)
True if symmetry degree == 1.0.
isTransitive(self, Comments=False)
True if transitivity degree == 1.0.
isWeaklyComplete(self, Debug=False)
checks the weakly completeness property of self.relation by checking
for the absence of a link between two actions!!
 
.. warning::
 
    The reflexive links are ignored !!
iterateRankingByChoosing(self, Odd=False, CoDual=False, Comments=True, Debug=False, Limited=None)
Renders a ranking by choosing result when progressively eliminating
all chordless (odd only) circuits with rising valuation cut levels.
 
Parameters
    CoDual = False (default)/True
    Limited = proportion (in [0,1]) * (max - med) valuationdomain
kChoices(self, A, k)
Renders all choices of length k from set A
matmult2(self, m, v)
Parameters: digraph relation and choice characteristic vector
matrix multiply vector by inner production
meanDegree(self)
Renders the mean degree of self.
!!! self.size must be set previously !!!
meanLength(self, Oriented=False)
Renders the (by default non-oriented) mean neighbourhoor depth of self.
!!! self.order must be set previously !!!
minimalChoices(self, S)
Generates all dominant or absorbent choices of a bipolar
valued digraph.
 
.. note:
 
   * Initiate with S = (actions, dict of dominant or absorbent closed neighborhoods)
   * See showMinDom and showMinAbs methods.
minimalValuationLevelForCircuitsElimination(self, Odd=True, Debug=False, Comments=False)
renders the minimal valuation level <lambda> that eliminates all
self.circuitsList stored odd chordless circuits from self.
 
.. warning::
 
    The <lambda> level polarised may still contain newly appearing chordless odd circuits !
neighbourhoodCollection(self, Oriented=False, Potential=False)
Renders the neighbourhood.
neighbourhoodDepthDistribution(self, Oriented=False)
Renders the distribtion of neighbourhood depths.
notGammaSets(self)
Renders the dictionary of neighborhoods {node: (dx,ax)}
with set *dx* gathering the not dominated, and set *ax* gathering
the not absorbed neighborhood.
notaneighbors(self, node)
Renders the set of absorbed not in-neighbors of a node.
notdneighbors(self, node)
Renders the set of not dominated out-neighbors of a node.
outDegrees(self)
renders the median cut outdegrees
outDegreesDistribution(self)
Renders the distribution of outdegrees.
plusirredundant(self, U)
Generates all +irredundant choices of a digraph.
powerset(self, U)
Generates all subsets of a set.
readPerrinMisset(self, file='curd.dat')
read method for 0-1-char-coded MISs by default from the perrinMIS.c curd.dat result file.
readabsvector(self, x, relation)
Parameter: action x
absorbent in vector.
readdomvector(self, x, relation)
Parameter: action x
dominant out vector.
recodeValuation(self, newMin=-1.0, newMax=1.0, ndigits=4, Debug=False)
Recodes the characteristic valuation domain according
to the parameters given. 
 
*ndigits* indicates the number of decimal digits of the valuation.
relationFct(self, x, y)
wrapper for self.relation dictionary access to ensure interoperability
with the sparse and big outranking digraph implementation model.
save(self, fileName='tempdigraph', option=None, DecimalValuation=True, decDigits=2)
Persistent storage of a Digraph class instance in the form of
a python source code file
saveCSV(self, fileName='tempdigraph', Normalized=False, Dual=False, Converse=False, Diagonal=False, Debug=False)
Persistent storage of a Digraph class instance in the form of
a csv file.
saveXMCDA2(self, fileName='temp', fileExt='xmcda2', Comments=True, relationName='R', relationType='binary', category='random', subcategory='valued', author='digraphs Module (RB)', reference='saved from Python', valuationType='standard', digits=2, servingD3=False)
save digraph in XMCDA 2.0 format. Deprecated now.
savedre(self, fileName='temp')
save digraph in nauty format.
sharp(self, x, y)
Paramaters: choice characteristic values.
Renders the sharpest of two characteristic values x and y.
sharpvec(self, v, w)
Paramaters: choice characteristic vectors.
Renders the sharpest of two characteristic vectors v and w.
showActions(self)
presentation methods for digraphs actions
showAll(self)
Detailed show method for genuine digraphs.
showAttributes(self)
Prints out the attributes of self.
showAutomorphismGenerators(self)
Renders the generators of the automorphism group.
showBadChoices(self, Recompute=True)
Characteristic values for potentially bad choices.
showBestChoiceRecommendation(self, Verbose=False, Comments=True, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True)
Shows the RuBis best choice recommendation.
 
.. note::
 
    Computes by default the Rubis best choice recommendation on the corresponding strict (codual) outranking digraph.
 
    By default, with BrokenCocs=True, we brake all chordless circuits at their weakest determined ( abs(r(x>y)) + abs(r(y>x)) ) link.
 
    When BrokenCocs=False we proceed like follows:
 
    In case of chordless circuits, if supporting arcs are more credible
    than the reversed negating arcs, we collapse the circuits into hyper nodes.
    Inversely,  if supporting arcs are not more credible than the reversed negating arcs,
    we brake the circuits on their weakest arc.
 
Usage example:
 
>>> from outrankingDigraphs import *
>>> t = Random3ObjectivesPerformanceTableau(seed=5)
>>> g = BipolarOutrankingDigraph(t)
>>> g.showBestChoiceRecommendation()
***********************
RuBis Best Choice Recommendation (BCR)
(in decreasing order of determinateness)   
Credibility domain:  [-100.0, 100.0]
=== >> potential first choices
* choice              : ['a04', 'a14', 'a19', 'a20']
   independence        : 1.19
   dominance           : 4.76
   absorbency          : -59.52
   covering (%)        : 75.00
   determinateness (%) : 57.86
   - most credible action(s) = { 'a14': 23.81, 'a19': 11.90, 'a04': 2.38, 'a20': 1.19, }  
=== >> potential last choices 
* choice              : ['a03', 'a12', 'a17']
  independence        : 4.76
  dominance           : -76.19
  absorbency          : 4.76
  covering (%)        : 0.00
  determinateness (%) : 65.39
  - most credible action(s) = { 'a03': 38.10, 'a12': 13.10, 'a17': 4.76, }
Execution time: 0.024 seconds
*****************************
showChoiceVector(self, ch, choiceType='good', ChoiceVector=True)
Show procedure for annotated bipolar choices.
showChordlessCircuits(self, Recompute=False)
Show method for chordless circuits observed in a Digraph instance.
 
If previous computation is required, stores the detected circuits in self.circuitsList attribute.
showComponents(self)
Shows the list of connected components of the digraph instance.
showCorrelation(self, corr=None, ndigits=3)
Renders the valued ordinal correlation index, the crisp Kendall tau index and their epistemic determination degree.
showFirstChoiceRecommendation(self, Verbose=False, Comments=True, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True)
Shows the RuBis first choice recommendation.
 
.. note::
 
    Computes by default the Rubis first choice recommendation on the corresponding strict (codual) outranking digraph.
 
    By default, with BrokenCocs=True, we brake all chordless circuits at their weakest determined ( abs(r(x>y)) + abs(r(y>x)) ) link.
 
    When BrokenCocs=False we proceed like follows:
 
    In case of chordless circuits, if supporting arcs are more credible
    than the reversed negating arcs, we collapse the circuits into hyper nodes.
    Inversely,  if supporting arcs are not more credible than the reversed negating arcs,
    we brake the circuits on their weakest arc.
 
Usage example:
 
>>> from outrankingDigraphs import *
>>> t = Random3ObjectivesPerformanceTableau(seed=5)
>>> g = BipolarOutrankingDigraph(t)
>>> g.showFirstChoiceRecommendation()
***********************
RuBis First Choice Recommendation (BCR)
(in decreasing order of determinateness)   
Credibility domain:  [-100.0, 100.0]
=== >> potential first choices
* choice              : ['a04', 'a14', 'a19', 'a20']
   independence        : 1.19
   dominance           : 4.76
   absorbency          : -59.52
   covering (%)        : 75.00
   determinateness (%) : 57.86
   - most credible action(s) = { 'a14': 23.81, 'a19': 11.90, 'a04': 2.38, 'a20': 1.19, }  
=== >> potential last choices 
* choice              : ['a03', 'a12', 'a17']
  independence        : 4.76
  dominance           : -76.19
  absorbency          : 4.76
  covering (%)        : 0.00
  determinateness (%) : 65.39
  - most credible action(s) = { 'a03': 38.10, 'a12': 13.10, 'a17': 4.76, }
Execution time: 0.024 seconds
*****************************
showGoodChoices(self, Recompute=True)
Characteristic values for potentially good choices.
showHTMLBestChoiceRecommendation(self, pageTitle=None, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True, htmlFileName=None)
showHTMLRelationHeatmap(self, actionsList=None, rankingRule='NetFlows', colorLevels=7, tableTitle='Relation Heatmap', relationName='r(x S y)', ndigits=2, fromIndex=None, toIndex=None, htmlFileName=None)
Launches a browser window with the colored relation map of self.
 
See corresponding :py:class:`~digraphs.Digraph.showHTMLRelationMap` method.
 
The *colorLevels* parameter may be set to 3, 5, 7 (default) or 9.
 
When the *actionsList* parameter is *None* (default), the digraphs actions list may be ranked with the *rankingRule* parameter set to the 'Copeland' (default) or to the 'Netlows' ranking rule.
 
When the *htmlFileName* parameter is set to a string value 'xxx', a html file named 'xxx.html' will be generated in the current working directory. Otherwise, a temporary file named 'tmp*.html' will be generated there.
 
Example::
 
    >>> from outrankingDigraphs import *
    >>> t = RandomCBPerformanceTableau(numberOfActions=25,seed=1)
    >>> g = BipolarOutrankingDigraph(t,ndigits=2)
    >>> gcd = ~(-g)  # strict outranking relation
    >>> gcd.showHTMLRelationHeatmap(colorLevels=7,ndigits=2)
    
.. image:: relationHeatmap.png
   :alt: Browser view of a relation map
   :width: 600 px
   :align: center
showHTMLRelationMap(self, actionsList=None, rankingRule='Copeland', Colored=True, tableTitle='Relation Map', relationName='r(x S y)', symbols=['+', '&middot;', '&nbsp;', '&#150;', '&#151'], fromIndex=None, toIndex=None, htmlFileName=None)
Launches a browser window with the colored relation map of self.
See corresponding Digraph.showRelationMap() method.
 
When *htmlFileName* parameter is set to a string value, a html file
with that name will be stored in the current working directory.
 
By default, a temporary file named: tmp*.html will be generated
instead in the current working directory.
 
Example::
 
    >>> from outrankingDigraphs import *
    >>> t = RandomCBPerformanceTableau(numberOfActions=25,seed=1)
    >>> g = BipolarOutrankingDigraph(t,Normalized=True)
    >>> gcd = ~(-g)  # strict outranking relation
    >>> gcd.showHTMLRelationMap(rankingRule="NetFlows")
    
.. image:: relationMap.png
   :alt: Browser view of a relation map
   :width: 600 px
   :align: center
showHTMLRelationTable(self, actionsList=None, relation=None, IntegerValues=False, ndigits=2, Colored=True, tableTitle='Valued Adjacency Matrix', relationName='r(x S y)', ReflexiveTerms=False, htmlFileName=None, fromIndex=None, toIndex=None)
Launches a browser window with the colored relation table of self.
showMIS(self, withListing=True)
Prints all maximal independent choices:
    Result in self.misset.
showMIS_AH(self, withListing=True)
Prints all MIS using the Hertz method.
 
Result saved in self.hertzmisset.
showMIS_HB2(self, withListing=True)
Prints all MIS using the Hertz-Bisdorff method.
 
Result saved in self.newmisset.
showMIS_RB(self, withListing=True)
Prints all MIS using the Bisdorff method.
 
Result saved in self.newmisset.
showMIS_UD(self, withListing=True)
Prints all MIS using the Hertz-Bisdorff method.
 
Result saved in self.newmisset.
showMaxAbsIrred(self, withListing=True)
Computing maximal -irredundant choices:
    Result in self.absirset.
showMaxDomIrred(self, withListing=True)
Computing maximal +irredundant choices:
   Result in self.domirset.
showMinAbs(self, withListing=True)
Prints minimal absorbent choices:
    Result in self.absset.
showMinDom(self, withListing=True)
Prints all minimal dominant choices:
    Result in self.domset.
showNeighborhoods(self)
Lists the gamma and the notGamma function of self.
showOrbits(self, InChoices, withListing=True)
Prints the orbits of Choices along the automorphisms of
the Digraph instance.
 
Example Python session for computing the non isomorphic MISs from the 12-cycle graph:
 
>>> from digraphs import *
>>> c12 = CirculantDigraph(order=12,circulants=[1,-1])
>>> c12.automorphismGenerators()
...
  Permutations
  {'1': '1', '2': '12', '3': '11', '4': '10', '5': 
   '9', '6': '8', '7': '7', '8': '6', '9': '5', '10': 
   '4', '11': '3', '12': '2'}
  {'1': '2', '2': '1', '3': '12', '4': '11', '5': '10', 
   '6': '9', '7': '8', '8': '7', '9': '6', '10': '5', 
   '11': '4', '12': '3'}
  Reflections {}
>>> print('grpsize = ', c12.automorphismGroupSize)
  grpsize = 24
>>> c12.showMIS(withListing=False)
  *---  Maximal independent choices ---*
  number of solutions:  29
  cardinality distribution
  card.:  [0, 1, 2, 3, 4,  5,  6, 7, 8, 9, 10, 11, 12]
  freq.:  [0, 0, 0, 0, 3, 24,  2, 0, 0, 0,  0,  0,  0]
  Results in c12.misset
>>> c12.showOrbits(c12.misset,withListing=False)
...
  *---- Global result ----
  Number of MIS:  29
  Number of orbits :  4
  Labelled representatives:
  1: ['2','4','6','8','10','12']
  2: ['2','5','8','11']
  3: ['2','4','6','9','11']
  4: ['1','4','7','9','11']
  Symmetry vector
  stabilizer size: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, ...]
  frequency      : [0, 2, 0, 0, 0, 0, 0, 1, 0,  0,  0,  1, ...]
 
*Figure*: The symmetry axes of the non isomorphic MISs of the 12-cycle:
 
.. image:: c12.png
   :width: 400 px
   :align: center
   :alt: The 4 non isomorphic MIS of the 12-cycle graph
 
*Reference*: R. Bisdorff and J.L. Marichal (2008). Counting non-isomorphic maximal independent sets of the n-cycle graph. *Journal of Integer Sequences*, Vol. 11 Article 08.5.7 (`openly accessible here <https://www.cs.uwaterloo.ca/journals/JIS/VOL11/Marichal/marichal.html>`_)
showOrbitsFromFile(self, InFile, withListing=True)
Prints the orbits of Choices along the automorphisms of
the digraph self by reading in the 0-1 misset file format.
See the :py:func:`digraphs.Digraph.readPerrinMisset` method.
showPreKernels(self, withListing=True)
Printing dominant and absorbent preKernels:
    Result in self.dompreKernels and self.abspreKernels
showRankingByBestChoosing(self, rankingByBestChoosing=None)
A show method for self.rankinByBestChoosing result.
 
.. warning::
 
     The self.computeRankingByBestChoosing(CoDual=False/True) method instantiating the self.rankingByBestChoosing slot is pre-required !
showRankingByChoosing(self, rankingByChoosing=None, WithCoverCredibility=False)
A show method for self.rankinByChoosing result.
 
When parameter *WithCoverCredibility* is set to True, the credibility of outranking, respectively being outranked is indicated at each selection step. 
 
.. warning::
 
     The self.computeRankingByChoosing(CoDual=False/True) method instantiating the self.rankingByChoosing slot is pre-required !
showRankingByLastChoosing(self, rankingByLastChoosing=None, Debug=None)
A show method for self.rankinByChoosing result.
 
.. warning::
 
     The self.computeRankingByLastChoosing(CoDual=False/True) method instantiating the self.rankingByChoosing slot is pre-required !
showRelation(self)
prints the relation valuation in ##.## format.
showRelationMap(self, symbols=None, rankingRule='Copeland', fromIndex=None, toIndex=None, actionsList=None)
Prints on the console, in text map format, the location of
certainly validated and certainly invalidated outranking situations.
 
By default, symbols = {'max':'┬','positive': '+', 'median': ' ',
                       'negative': '-', 'min': '┴'}
 
The default ordering of the output is following the Copeland ranking rule
from best to worst actions. Further available ranking rule is the 'NetFlows' net flows rule.
 
 
Example::
 
    >>> from outrankingDigraphs import *
    >>> t = RandomCBPerformanceTableau(numberOfActions=25,seed=1)
    >>> g = BipolarOutrankingDigraph(t,Normalized=True)
    >>> gcd = ~(-g)  # strict outranking relation
    >>> gcd.showRelationMap(rankingRule="NetFlows")
     -   ++++++++  +++++┬+┬┬+
    - -   + +++++ ++┬+┬+++┬++
    ┴+  ┴ + ++  ++++┬+┬┬++┬++
    -   ++ - ++++-++++++┬++┬+
       - - - ++- ┬- + -+┬+-┬┬
    -----  -      -┬┬┬-+  -┬┬
    ----    --+-+++++++++++++
    -- --+- --++ ++ +++-┬+-┬┬
    ----  -  -+-- ++--+++++ +
    ----- ++- --- +---++++┬ +
    -- -- ---+ -++-+++-+ +-++
    -- --┴---+  + +-++-+ -  +
    ---- ┴---+-- ++--++++ - +
      --┴┴--  --- -  --+ --┬┬
     ---------+--+ ----- +-┬┬
    -┴---┴- ---+- + ---+++┬ +
    -┴┴--┴---+--- ++ -++--+++
    -----┴--- ---+-+- ++---+ 
    -┴┴--------------- --++┬ 
    --┴---------------- --+┬ 
    ┴--┴┴ -┴--┴┴-┴ --++  ++-+
    ----┴┴--------------- -  
    ┴┴┴----+-┴+┴---┴-+---+ ┴+
    ┴┴-┴┴┴-┴- - -┴┴---┴┴+ ┬ -
    ----┴┴-┴-----┴┴---  - -- 
    Ranking rule: NetFlows
    >>>
showRelationTable(self, Sorted=True, rankingRule=None, IntegerValues=False, actionsSubset=None, relation=None, ndigits=2, ReflexiveTerms=True, fromIndex=None, toIndex=None)
Prints the relation valuation in actions X actions table format.
Copeland and NetFlows rankings my be used.
showRubisBestChoiceRecommendation(self, **kwargs)
Dummy for backward portable showBestChoiceRecommendation().
showRubyChoice(self, Verbose=False, Comments=True, _OldCoca=True)
Dummy for showBestChoiceRecommendation()
needed for older versions compatibility.
showShort(self)
concise presentation method for genuine digraphs.
showSingletonRanking(self, Comments=True, Debug=False)
Calls self.computeSingletonRanking(comments=True,Debug = False).
Renders and prints the sorted bipolar net determinatation of outrankingness
minus outrankedness credibilities of all singleton choices.
 
res = ((netdet,sigleton,dom,absorb)+)
showStatistics(self)
Computes digraph statistics like order, size and arc-density.
showdre(self)
Shows relation in nauty format.
singletons(self)
list of singletons and neighborhoods
[(singx1, +nx1, -nx1, not(+nx1 or -nx1)),.... ]
sizeSubGraph(self, choice)
Output: (size, undeterm,arcDensity).
Renders the arc density of the induced subgraph.
strongComponents(self, setPotential=False)
Renders the set of strong components of self.
symDegreesDistribution(self)
Renders the distribution of symmetric degrees.
topologicalSort(self, Debug=False)
If self is acyclic, adds topological sort number to each node of self
and renders ordered list of nodes. Otherwise renders None.
Source: M. Golumbic Algorithmic Graph heory and Perfect Graphs,
Annals Of Discrete Mathematics 57 2nd Ed. , Elsevier 2004, Algorithm 2.4 p.44.
weakAneighbors(self, node)
Renders the set of absorbed in-neighbors of a node.
weakCondorcetLosers(self)
Renders the set of decision actions x such that
self.relation[x][y] <= self.valuationdomain['med']
for all y != x.
weakCondorcetWinners(self)
Renders the set of decision actions x such that
self.relation[x][y] >= self.valuationdomain['med']
for all y != x.
weakDneighbors(self, node)
Renders the set of dominated out-neighbors of a node.
weakGammaSets(self)
Renders the dictionary of neighborhoods {node: (dx,ax)}
zoomValuation(self, zoomFactor=1.0)
Zooms in or out, depending on the value of the zoomFactor provided,
the bipolar valuation of a digraph.

Data descriptors inherited from Digraph:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class GraphInner(Digraph)
    GraphInner(other, Debug=False)
 
Instantiates the partial digraph induced by the complement of its border,
i.e. the nodes not included in the union of its initial and terminal kernels.
 
 
Method resolution order:
GraphInner
Digraph
builtins.object

Methods defined here:
__init__(self, other, Debug=False)
Initialize self.  See help(type(self)) for accurate signature.

Methods inherited from Digraph:
MISgen(self, S, I)
generator of maximal independent choices (voir Byskov 2004):
    * S ::= remaining nodes;
    * I ::= current independent choice
 
.. note::
 
        Inititalize: self.MISgen(self.actions.copy(),set())
__invert__(self)
Make the inverting operator ~self available for Digraph instances. 
 
Returns a ConverseDigraph instance of self.
__neg__(self)
Make the negation operator -self available for Digraph instances. 
 
Returns a DualDigraph instance of self.
__repr__(self)
Default presentation method for Digraph instances.
absirred(self, choice)
Renders the crips -irredundance degree of a choice.
absirredundant(self, U)
Generates all -irredundant choices of a digraph.
absirredval(self, choice, relation)
Renders the valued -irredundance degree of a choice.
absirredx(self, choice, x)
Computes the crips -irredundance degree of node x in a choice.
abskernelrestrict(self, prekernel)
Parameter: prekernel
Renders absorbent prekernel restricted relation.
absorb(self, choice)
Renders the absorbency degree of a choice.
absorbentChoices(self, S)
Generates all minimal absorbent choices of a bipolar valued digraph.
addValuationAttribute(self)
Adds the numpy valuation attribute
agglomerationDistribution(self)
Output: aggloCoeffDistribution, meanCoeff
Renders the distribution of agglomeration coefficients.
aneighbors(self, node)
Renders the set of absorbed in-neighbors of a node.
automorphismGenerators(self)
Adds automorphism group generators to the digraph instance.
 
.. note::
 
    Dependency: Uses the dreadnaut command from the nauty software package. See https://www3.cs.stonybrook.edu/~algorith/implement/nauty/implement.shtml
 
    On Ubuntu Linux:
      ...$ sudo apt-get install nauty
averageCoveringIndex(self, choice, direction='out')
Renders the average covering index of a given choice in a set of objects,
ie the average number of choice members that cover each
non selected object.
bipolarKCorrelation(self, digraph, Debug=False)
Renders the bipolar Kendall correlation between two bipolar valued
digraphs computed from the average valuation of the
XORDigraph(self,digraph) instance.
 
.. warning::
 
     Obsolete! Is replaced by the self.computeBipolarCorrelation(other) Digraph method
bipolarKDistance(self, digraph, Debug=False)
Renders the bipolar crisp Kendall distance between two bipolar valued
digraphs.
 
.. warning::
 
     Obsolete! Is replaced by the self.computeBipolarCorrelation(other, MedianCut=True) Digraph method
chordlessPaths(self, Pk, n2, Odd=False, Comments=False, Debug=False)
New procedure from Agrum study April 2009
recursive chordless path extraction starting from path
Pk = [n2, ...., n1] and ending in node n2.
Optimized with marking of visited chordless P1s.
circuitAverageCredibility(self, circ)
Renders the average linking credibility of a Chordless Circuit.
circuitCredibilities(self, circuit, Debug=False)
Renders the average linking credibilities and the minimal link of a Chordless Circuit.
circuitMaxCredibility(self, circ)
Renders the maximal linking credibility of a Chordless Circuit.
circuitMinCredibility(self, circ)
Renders the minimal linking credibility of a Chordless Circuit.
closeSymmetric(self, InSite=True)
Produces the symmetric closure of self.relation.
closeTransitive(self, Reverse=False, InSite=True, Comments=False)
Produces the transitive closure of self.relation
 
*Parameters*:
 
    - If *Reverse* == True (False default) all transitive links are dropped, otherwise all transitive links are closed with min[r(x,y),r(y,z)];
    - If *Insite* == False (True by default) the methods return a modified copy of self.relation without altering the original self.relation, otherwise self.relation is modified.
components(self)
Renders the list of connected components.
computeAllDensities(self, choice=None)
parameter: choice in self
renders six densitiy parameters:
arc density, double arc density,
single arc density, strict single arc density,
absence arc density, strict absence arc densitiy.
computeArrowRaynaudOrder(self)
Renders a linear ordering from worst to best of the actions following Arrow&Raynaud's rule.
computeArrowRaynaudRanking(self)
renders a linear ranking from best to worst of the actions following Arrow&Raynaud's rule.
computeAverageValuation(self)
Computes the bipolar average correlation between
self and the crisp complete digraph of same order
of the irreflexive and determined arcs of the digraph
computeBadChoices(self, Comments=False)
Computes characteristic values for potentially bad choices.
 
.. note::
 
     Returns a tuple with following content:
 
     [(0)-determ,(1)degirred,(2)degi,(3)degd,(4)dega,(5)str(choice),(6)absvec]
computeBadPirlotChoices(self, Comments=False)
Characteristic values for potentially bad choices
using the Pirlot's fixpoint algorithm.
computeBestChoiceRecommendation(self, Verbose=False, Comments=False, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True)
Sets self.bestChoice, self.bestChoiceData, self.worstChoice and self.worstChoiceData
with the showBestChoiceRecommendation method.
 
First and last choices data is the following:
[(0)-determ,(1)degirred,(2)degi,(3)degd,(4)dega,(5)str(choice),(6)domvec,(7)cover]
 
self.bestChoice = self.bestChoiceData[5]
self.worstChoice = self.worstChoiceData[5]
computeBipolarCorrelation(self, other, MedianCut=False, filterRelation=None, Debug=False)
obsolete: dummy replacement for Digraph.computeOrdinalCorrelation method
computeChordlessCircuits(self, Odd=False, Comments=False, Debug=False)
Renders the set of all chordless circuits detected in a digraph.
Result is stored in <self.circuitsList>
holding a possibly empty list of tuples with at position 0 the
list of adjacent actions of the circuit and at position 1
the set of actions in the stored circuit.
 
When *Odd* is True, only chordless circuits with an odd length
are collected.
computeChordlessCircuitsMP(self, Odd=False, Threading=False, nbrOfCPUs=None, startMethod=None, Comments=False, Debug=False)
Multiprocessing version of computeChordlessCircuits().
 
Renders the set of all chordless odd circuits detected in a digraph.
Result (possible empty list) stored in <self.circuitsList>
holding a possibly empty list tuples with at position 0 the
list of adjacent actions of the circuit and at position 1
the set of actions in the stored circuit.
Inspired by Dias, Castonguay, Longo, Jradi, Algorithmica (2015).
 
Returns a possibly empty list of tuples (circuit,frozenset(circuit)).
 
If Odd == True, only circuits of odd length are retained in the result.
computeCoSize(self)
Renders the number of non validated non reflexive arcs
computeConcentrationIndex(self, X, N)
Renders the Gini concentration index of the X serie.
N contains the partial frequencies.
Based on the triangle summation formula.
computeConcentrationIndexTrapez(self, X, N)
Renders the Gini concentration index of the X serie.
N contains the partial frequencies.
Based on the triangles summation formula.
computeCondorcetLosers(self)
Wrapper for condorcetLosers().
computeCondorcetWinners(self)
Wrapper for condorcetWinners().
computeCopelandOrder(self)
renders a linear ordering from worst to best of the actions following Arrow&Raynaud's rule.
computeCopelandRanking(self)
renders a linear ranking from best to worst of the actions following Arrow&Raynaud's rule.
computeCutLevelDensities(self, choice, level)
parameter: choice in self, robustness level
renders three robust densitiy parameters:
robust double arc density,
robust single arc density,
robust absence arc densitiy.
computeDensities(self, choice)
parameter: choice in self
renders the four densitiy parameters:
arc density, double arc density, single arc density, absence arc density.
computeDeterminateness(self, InPercents=False)
Computes the Kendalll distance of self
with the all median-valued indeterminate digraph of order n.
 
Return the average determination of the irreflexive part of the digraph.
 
*determination* = sum_(x,y) { abs[ r(xRy) - Med ] } / n(n-1)
 
If *InPercents* is True, returns the average determination in percentage of
(Max - Med) difference.
 
>>> from outrankingDigraphs import BipolarOutrankingDigraph
>>> from randomPerfTabs import Random3ObjectivesPerformanceTableau
>>> t = Random3ObjectivesPerformanceTableau(numberOfActions=7,numberOfCriteria=7,seed=101)
>>> g = BipolarOutrankingDigraph(t,Normalized=True)
>>> g
*------- Object instance description ------*
Instance class      : BipolarOutrankingDigraph
Instance name       : rel_random3ObjectivesPerfTab
Actions             : 7
Criteria            : 7
Size                : 27
Determinateness (%) : 65.67
Valuation domain    : [-1.00;1.00]
>>> print(g.computeDeterminateness())
0.3134920634920634920634920638
>>> print(g.computeDeterminateness(InPercents=True))
65.67460317460317460317460320
>>> g.recodeValuation(0,1)
>>> g
*------- Object instance description ------*
Instance class      : BipolarOutrankingDigraph
Instance name       : rel_random3ObjectivesPerfTab
Actions             : 7
Criteria            : 7
Size                : 27
Determinateness (%) : 65.67
Valuation domain    : [0.00;1.00]
>>> print(g.computeDeterminateness())
0.1567460317460317460317460318
>>> print(g.computeDeterminateness(InPercents=True))
65.67460317460317460317460320
computeDiameter(self, Oriented=True)
Renders the (by default oriented) diameter of the digraph instance
computeDigraphCentres(self, WeakDistances=False, Comments=False)
The centers of a digraph are the nodes with finite minimal shortes path lengths.
 
The maximal neighborhood distances are stored in *self.maximalNeighborhoodDistances*.
 
The corresponding digraph radius and diameter are stored respectively  in *self.radius* and *self.diameter*.
 
With *Comments* = True, all these results are printed out.
 
*Source*: Claude Berge, *The Theory of Graphs*, Dover (2001) pp. 119, original in French Dunod (1958)
computeDynamicProgrammingStages(self, source, sink, Debug=False)
Renders the discrete stages of the optimal substructure for
dynamic pogramming digrahs from a given source node 
to a given sink sink node.
 
Returns a list of list of action identifyers.
computeGoodChoiceVector(self, ker, Comments=False)
| Computing Characteristic values for dominant pre-kernels
| using the von Neumann dual fixoint equation
computeGoodChoices(self, Comments=False)
Computes characteristic values for potentially good choices.
 
..note::
 
     Return a tuple with following content:
 
     [(0)-determ,(1)degirred,(2)degi,(3)degd,(4)dega,(5)str(choice),(6)domvec,(7)cover]
computeGoodPirlotChoices(self, Comments=False)
Characteristic values for potentially good choices
using the Pirlot fixpoint algorithm.
computeIncomparabilityDegree(self, InPercents=False, Comments=False)
Renders the incomparability degree (Decimal), i.e. the relative number of symmetric indeterminate relations of the irreflexive part of a digraph.
computeKemenyIndex(self, otherRelation)
renders the Kemeny index of the self.relation
compared with a given crisp valued relation of a compatible
other digraph (same nodes or actions).
computeKemenyOrder(self, orderLimit=7, Debug=False)
Renders a ordering from worst to best of the actions with maximal Kemeny index.
Return a tuple: kemenyOrder (from worst to best), kemenyIndex
computeKemenyRanking(self, orderLimit=7, seed=None, sampleSize=1000, Debug=False)
Renders a ranking from best to worst of the actions with maximal Kemeny index.
 
.. note::
 
     Returns a tuple: kemenyRanking (from best to worst), kemenyIndex.
computeKernelVector(self, kernel, Initial=True, Comments=False)
| Computing Characteristic values for dominant pre-kernels
| using the von Neumann dual fixpoint equation
computeKohlerOrder(self)
Renders an ordering (worst to best) of the actions following Kohler's rule.
computeKohlerRanking(self)
Renders a ranking (best to worst) of the actions following Kohler's rule.
computeMaxHoleSize(self, Comments=False)
Renders the length of the largest chordless cycle
in the corresponding disjunctive undirected graph.
computeMeanInDegree(self)
Renders the mean indegree of self.
!!! self.size must be set previously !!!
computeMeanOutDegree(self)
Renders the mean degree of self.
!!! self.size must be set previously !!!
computeMeanSymDegree(self)
Renders the mean degree of self.
!!! self.size must be set previously !!!
computeMedianOutDegree(self)
Renders the median outdegree of self.
!!! self.size must be set previously !!!
computeMedianSymDegree(self)
Renders the median symmetric degree of self.
!!! self.size must be set previously !!!
computeMoreOrLessUnrelatedPairs(self)
Renders a list of more or less unrelated pairs.
computeNetFlowsOrder(self)
Renders an ordered list (from best to worst) of the actions
following the net flows ranking rule.
computeNetFlowsOrderDict(self)
Renders an ordered list (from worst to best) of the actions
following the net flows ranking rule.
computeNetFlowsRanking(self)
Renders an ordered list (from best to worst) of the actions
following the net flows ranking rule.
computeNetFlowsRankingDict(self)
Renders an ordered list (from best to worst) of the actions
following the net flows ranking rule.
computeODistance(self, op2, comments=False)
renders the squared normalized distance of
two digraph valuations.
 
.. note::
 
     op2 = digraphs of same order as self.
computeOrbit(self, choice, withListing=False)
renders the set of isomorph copies of a choice following
the automorphism of the digraph self
computeOrderCorrelation(self, order, Debug=False)
Renders the ordinal correlation K of a digraph instance
when compared with a given linear order (from worst to best) of its actions
 
K = sum_{x != y} [ min( max(-self.relation(x,y)),other.relation(x,y), max(self.relation(x,y),-other.relation(x,y)) ]
 
K /= sum_{x!=y} [ min(abs(self.relation(x,y),abs(other.relation(x,y)) ]
 
.. note::
 
     Renders a dictionary with the key 'correlation' containing the actual bipolar correlation index and the key 'determination' containing the minimal determination level D of self and the other relation.
 
     D = sum_{x != y} min(abs(self.relation(x,y)),abs(other.relation(x,y)) / n(n-1)
 
     where n is the number of actions considered.
 
     The correlation index with a completely indeterminate relation
     is by convention 0.0 at determination level 0.0 .
 
.. warning::
 
     self must be a normalized outranking digraph instance !
computeOrdinalCorrelation(self, other, MedianCut=False, filterRelation=None, Debug=False)
Renders the bipolar correlation K of a
self.relation when compared
with a given compatible (same actions set)) digraph or
a [-1,1] valued compatible relation (same actions set).
 
If MedianCut=True, the correlation is computed on the median polarized relations.
 
If filterRelation is not None, the correlation is computed on the partial domain corresponding to the determined part of the filter relation.
 
.. warning::
 
     Notice that the 'other' relation and/or the 'filterRelation',
     the case given, must both be normalized, ie [-1,1]-valued !
 
K = sum_{x != y} [ min( max(-self.relation[x][y]),other.relation[x][y]), max(self.relation[x][y],-other.relation[x][y]) ]
 
K /= sum_{x!=y} [ min(abs(self.relation[x][y]),abs(other.relation[x][y])) ]
 
.. note::
 
     Renders a tuple with at position 0 the actual bipolar correlation index
     and in position 1 the minimal determination level D of self and
     the other relation.
 
     D = sum_{x != y} min(abs(self.relation[x][y]),abs(other.relation[x][y])) / n(n-1)
 
     where n is the number of actions considered.
 
     The correlation index with a completely indeterminate relation
     is by convention 0.0 at determination level 0.0 .
computeOrdinalCorrelationMP(self, other, MedianCut=False, Threading=False, nbrOfCPUs=None, startMethod=None, Comments=False, Debug=False)
Multi processing version of the digraphs.computeOrdinalCorrelation() method.
 
.. note::
     The relation filtering and the MedinaCut option are not implemented in the MP version.
computePairwiseClusterComparison(self, K1, K2, Debug=False)
Computes the pairwise cluster comparison credibility vector
from bipolar-valued digraph g. with K1 and K2 disjoint
lists of action keys from g actions disctionary.
Returns the dictionary
{'I': Decimal(),'P+':Decimal(),'P-':Decimal(),'R' :Decimal()}
where one and only one item is strictly positive.
computePreKernels(self)
computing dominant and absorbent preKernels:
    Result in self.dompreKernels and self.abspreKernels
computePreRankingRelation(self, preRanking, Normalized=True, Debug=False)
Renders the bipolar-valued relation obtained from
a given preRanking in decreasing levels (list of lists) result.
computePreorderRelation(self, preorder, Normalized=True, Debug=False)
Renders the bipolar-valued relation obtained from
a given preordering in increasing levels (list of lists) result.
computePrincipalOrder(self, Colwise=False, Comments=False)
Rendesr an ordering from wrost to best of the decision actions.
computePrincipalRanking(self, Colwise=False, Comments=False)
Rendesr a ranking from best to worst of the decision actions.
computePrincipalScores(self, plotFileName=None, Colwise=False, imageType=None, tempDir=None, bgcolor='cornsilk', Comments=False, Debug=False)
Renders a ordered list of the first principal eigenvector of the covariance of the valued outdegrees of self.
 
.. note::
 
   The method, relying on writing and reading temporary files by default in a temporary directory is threading and multiprocessing safe !
   (see Digraph.exportPrincipalImage method)
computePrudentBetaLevel(self, Debug=False)
computes alpha, ie the lowest valuation level, for which the
bipolarly polarised digraph doesn't contain a chordless circuit.
computeRankingByBestChoosing(self, CoDual=False, Debug=False)
Computes a weak preordering of the self.actions by recursive
best choice elagations.
 
Stores in self.rankingByBestChoosing['result'] a list of (P+,bestChoice) tuples
where P+ gives the best choice complement outranking
average valuation via the computePairwiseClusterComparison
method.
 
If self.rankingByBestChoosing['CoDual'] is True, 
the ranking-by-choosing was computed on the codual of self.
computeRankingByBestChoosingRelation(self, rankingByBestChoosing=None, Debug=False)
Renders the bipolar-valued relation obtained from
the self.rankingByBestChoosing result.
computeRankingByChoosing(self, actionsSubset=None, Debug=False, CoDual=False)
Computes a weak preordring of the self.actions by iterating
jointly first and last choice elagations.
 
Stores in self.rankingByChoosing['result'] a list of ((P+,bestChoice),(P-,worstChoice)) pairs
where P+ (resp. P-) gives the best (resp. worst) choice complement outranking
(resp. outranked) average valuation via the computePairwiseClusterComparison
method.
 
If self.rankingByChoosing['CoDual'] is True, the ranking-by-choosing was computed on the codual of self.
computeRankingByChoosingRelation(self, rankingByChoosing=None, actionsSubset=None, Debug=False)
Renders the bipolar-valued relation obtained from
the self.rankingByChoosing result.
computeRankingByLastChoosing(self, CoDual=False, Debug=False)
Computes a weak preordring of the self.actions by iterating
worst choice elagations.
 
Stores in self.rankingByLastChoosing['result'] a list of (P-,worstChoice) pairs
where P- gives the worst choice complement outranked
average valuation via the computePairwiseClusterComparison
method.
 
If self.rankingByChoosing['CoDual'] is True, the ranking-by-last-chossing 
was computed on the codual of self.
computeRankingByLastChoosingRelation(self, rankingByLastChoosing=None, Debug=False)
Renders the bipolar-valued relation obtained from
the self.rankingByLastChoosing result.
computeRankingCorrelation(self, ranking, Debug=False)
Renders the ordinal correlation K of a digraph instance
when compared with a given linear ranking of its actions
 
K = sum_{x != y} [ min( max(-self.relation(x,y)),other.relation(x,y), max(self.relation(x,y),-other.relation(x,y)) ]
 
K /= sum_{x!=y} [ min(abs(self.relation(x,y),abs(other.relation(x,y)) ]
 
.. note::
 
     Renders a tuple with at position 0 the actual bipolar correlation index
     and in position 1 the minimal determination level D of self and
     the other relation.
 
     D = sum_{x != y} min(abs(self.relation(x,y)),abs(other.relation(x,y)) / n(n-1)
 
     where n is the number of actions considered.
 
     The correlation index with a completely indeterminate relation
     is by convention 0.0 at determination level 0.0 .
computeRelationalStructure(self, Debug=False)
Renders the counted decomposition of the valued relations into
the following type of links:
gt '>', eq '=', lt '<', incomp '<>',
leq '<=', geq '>=', indeterm '?'
computeRubisChoice(self, Comments=False, _OldCoca=False, BrokenCocs=True, Threading=False, nbrOfCPUs=1)
Renders self.strictGoodChoices, self.nullChoices
self.strictBadChoices, self.nonRobustChoices.
 
.. warning::
    Changes in site the outranking digraph by
    adding or braking chordless odd outranking circuits.
computeRubyChoice(self, Comments=False, _OldCoca=False)
dummy for computeRubisChoice()
old versions compatibility.
computeShortestPathLengths(self, WeakPaths=False, Comments=False, Debug=False)
Renders a double dictionary with the directed distances, i.e. the shortest path lengths between all self.actions
 
Equals *None* if there does not exist a directed path between two actions.
 
*Source*: Claude Berge, *The Theory of Graphs*, Dover (2001) pp. 119, original in French Dunod (1958)
computeSingletonRanking(self, Comments=False, Debug=False)
Renders the sorted bipolar net determinatation of outrankingness
minus outrankedness credibilities of all singleton choices.
 
res = ((netdet,singleton,dom,absorb)+)
computeSize(self)
Renders the number of validated non reflexive arcs
computeSizeTransitiveClosure(self)
Renders the size of the transitive closure of a digraph.
computeSlaterOrder(self, isProbabilistic=False, seed=None, sampleSize=1000, Debug=False)
Reversed return from computeSlaterRanking method.
computeSlaterRanking(self, isProbabilistic=False, seed=None, sampleSize=1000, Debug=False)
Renders a ranking of the actions with minimal Slater index.
Return a tuple: slaterOrder, slaterIndex
computeSymmetryDegree(self, InPercents=False, Comments=False)
Renders the symmetry degree (Decimal) of the irreflexive part of a digraph.
 
.. note::
 
   Empty and indeterminate digraphs are considered to be symmetric.
computeTopologicalRanking(self, Debug=False)
Mimetic Wrapper of the topologicalSort() method.
computeTransitivityDegree(self, InPercents=False, Comments=False)
Renders the transitivity degree (Decimal) of a digraph.
 
.. note:: 
 
   An empty or indeterminate digraph is considered to be transitive.
computeUnrelatedPairs(self)
Renders a list of more or less unrelated pairs.
computeValuationLevels(self, choice=None, Debug=False)
renders the symmetric closure of the
apparent valuations levels of self
in an increasingly ordered list.
If parameter choice is given, the
computation is limited to the actions
of the choice.
computeValuationPercentages(self, choice, percentiles, withValues=False)
Parameters: choice and list of percentiles.
renders a series of percentages of the characteristics valuation of
the arcs in the digraph.
computeValuationPercentiles(self, choice, percentages, withValues=False)
Parameters: choice and list of percentages.
renders a series of quantiles of the characteristics valuation of
the arcs in the digraph.
computeValuationStatistics(self, Sampling=False, Comments=False)
Renders the mean and variance of the valuation
of the non reflexive pairs.
computeValuedRankingRelation(self, ranking)
Renders the valued relation characteristics compatible 
with the given linar ranking. Discordant charcateristics 
are set to the indeterminate value.
computeWeakCondorcetLosers(self)
Wrapper for weakCondorcetLosers().
computeWeakCondorcetWinners(self)
Wrapper for weakCondorcetWinners().
computeupdown1(self, s, S)
Help method for show_MIS_HB2 method.
fills self.newmisset, self.upmis, self.downmis.
computeupdown2(self, s, S)
Help method for show_MIS_HB1 method.
Fills self.newmisset, self.upmis, self.downmis.
computeupdown2irred(self, s, S)
Help method for show_MIS_HB1 method.
Fills self.newmisset, self.upmis, self.downmis.
condorcetLosers(self)
Renders the set of decision actions x such that
self.relation[x][y] < self.valuationdomain['med']
for all y != x.
condorcetWinners(self)
Renders the set of decision actions x such that
self.relation[x][y] > self.valuationdomain['med']
for all y != x.
contra(self, v)
Parameter: choice.
Renders the negation of a choice v characteristic's vector.
convertRelationToDecimal(self)
Converts the float valued self.relation in a decimal valued one.
convertValuation2Integer(self, InSite=True, Comments=False)
Converts the self.relation valuation to integer values by converting the Decimals to Fractions and multiply by the least commun multiple of the fraction denominators.
 
*Parameters*:
 
    - If *Insite* == False (True by default) the method returns a modified copy of self.relation without altering the original self.relation, otherwise self.relation and self.valuationdomain is modified.
convertValuationToDecimal(self)
Convert the float valuation limits to Decimals.
coveringIndex(self, choice, direction='out')
Renders the covering index of a given choice in a set of objects,
ie the minimum number of choice members that cover each
non selected object.
crispKDistance(self, digraph, Debug=False)
Renders the crisp Kendall distance between two bipolar valued
digraphs.
 
.. warning::
 
     Obsolete! Is replaced by the self.computeBipolarCorrelation(other, MedianCut=True) Digraph method
detectChordlessCircuits(self, Comments=False, Debug=False)
Detects a chordless circuit in a digraph.
Returns a Boolean
detectChordlessPath(self, Pk, n2, Comments=False, Debug=False)
New procedure from Agrum study April 2009
recursive chordless path extraction starting from path
Pk = [n2, ...., n1] and ending in node n2.
Optimized with marking of visited chordless P1s.
determinateness(self, vec, inPercent=True)
Renders the determinateness of a characteristic vector *vec* = 
[(r(x),x),(r(y),y), ...] of length *n* in valuationdomain [Min,Med,Max]:
 
*result* =  sum_x( abs(r(x)-Med) ) / ( n*(Max-Med) )
 
If inPercent, *result* shifted (+1) and reduced (/2) to [0,1] range.
digraph2Graph(self, valuationDomain={'min': -1, 'med': 0, 'max': 1}, Debug=False, ConjunctiveConversion=True)
Convert a Digraph instance to a Graph instance.
dneighbors(self, node)
Renders the set of dominated out-neighbors of a node.
domin(self, choice)
Renders the dominance degree of a choice.
dominantChoices(self, S)
Generates all minimal dominant choices of a bipolar valued digraph.
 
.. note::
 
     Initiate with S = self.actions.copy().
domirred(self, choice)
Renders the crips +irredundance degree of a choice.
domirredval(self, choice, relation)
Renders the valued +irredundance degree of a choice.
domirredx(self, choice, x)
Renders the crips +irredundance degree of node x in a choice.
domkernelrestrict(self, prekernel)
Parameter: dominant prekernel
Renders dominant prekernel restricted relation.
exportGraphViz(self, fileName=None, actionsSubset=None, bestChoice=set(), worstChoice=set(), firstChoice=set(), lastChoice=set(), Comments=True, graphType='png', pictureFormat=None, graphSize='7,7', relation=None, bgcolor='cornsilk')
export GraphViz dot file  for graph drawing filtering.
exportPrincipalImage(self, plotFileName=None, pictureFormat='pdf', bgcolor='cornsilk', fontcolor='red3', fontsize='0.75', Reduced=False, Colwise=False, tempDir='.', Comments=False)
Export as PDF (default) the principal projection of
the valued relation using the three principal eigen vectors.
 
Implemeted picture formats are: 
'pdf' (default), 'png', 'jpeg' and 'xfig'.
 
The background color is set by default to 'cornsilk'. 
 
Font size and color are set by default to 'red3', resp. '0.75'. 
 
When *Reduced==True*, the valued relation characeteristics are centered and reduced.
 
When *Colwise==True*, the column vectors of the adjacency table are used for the principal projection, otherwise the rows (default) are used. Has no incidence when the *Digraph* instance *self*  is symmetric. 
 
.. warning::
 
    The method, writing and reading temporary files: 
    tempCol.r and rotationCol.csv, resp. tempRow.r and rotationRow.csv,
    by default in the working directory (./),
    is hence not safe for multiprocessing programs, unless a
    temporary directory *tempDir* is provided.
flatChoice(self, ch, Debug=False)
Converts set or list ch recursively to a flat list of items.
forcedBestSingleChoice(self)
Renders the set of most determined outranking singletons in self.
gammaSets(self)
Renders the dictionary of neighborhoods {node: (dx,ax)}
with set *dx* gathering the dominated, and set *ax* gathering
the absorbed neighborhood.
generateAbsPreKernels(self)
Generate all absorbent prekernels from independent choices generator.
generateDomPreKernels(self)
Generate all dominant prekernels from independent choices generator.
htmlChoiceVector(self, ch, ChoiceVector=True, choiceType='good')
Show procedure for annotated bipolar choices.
inDegrees(self)
renders the median cut indegrees
inDegreesDistribution(self)
Renders the distribution of indegrees.
independentChoices(self, U)
Generator for all independent choices with neighborhoods of a bipolar valued digraph:
 
.. note::
 
       * Initiate with U = self.singletons().
       * Yields [(independent choice, domnb, absnb, indnb)].
inner_prod(self, v1, v2)
Parameters: two choice characteristic vectors
Renders the inner product of two characteristic vetors.
intstab(self, choice)
Computes the independence degree of a choice.
irreflex(self, mat)
Puts diagonal entries of mat to valuationdomain['min']
isAsymmetricIndeterminate(self, Debug=False)
Checks the self.relation for assymmetric indeterminateness!!
 
.. warning::
 
    The reflexive links are ignored !!
isComplete(self, Debug=False)
checks the completeness property of self.relation by checking
for the absence of a link between two actions!!
 
.. warning::
 
    The reflexive links are ignored !!
isCyclic(self, Debug=False)
checks the cyclicity of self.relation by checking
for a reflexive loop in its transitive closure-
 
.. warning::
 
     self.relation is supposed to be irreflexive !
isIntegerValued(self, Debug=False)
Checks whether the decimal valuation of self is integer-valued
be using the as_integer_ratio() method of a Decimal 
giving a tuple (numerator,denominator). If denominator == 1, the
number is an integer.
isOutrankingDigraph(self, Comments=True, Debug=False)
Checks the outranking digraph characteristic condition (3.3).
 
relation[x][y] + relation[y][x)[y] >= 0.0
 
.. warning::
 
    The reflexive links are ignored and the valuation must be bipolar !!
isStrictOutrankingDigraph(self, Comments=True, Debug=False)
Checks the strict outranking digraph characteristic condition (3.1).
 
-(relation[x][y] + relation[y][x]) <= 0.0 , x != y
 
.. warning::
 
    The reflexive links are ignored and the valuation must be bipolar !!
isSymmetric(self, Comments=False)
True if symmetry degree == 1.0.
isTransitive(self, Comments=False)
True if transitivity degree == 1.0.
isWeaklyComplete(self, Debug=False)
checks the weakly completeness property of self.relation by checking
for the absence of a link between two actions!!
 
.. warning::
 
    The reflexive links are ignored !!
iterateRankingByChoosing(self, Odd=False, CoDual=False, Comments=True, Debug=False, Limited=None)
Renders a ranking by choosing result when progressively eliminating
all chordless (odd only) circuits with rising valuation cut levels.
 
Parameters
    CoDual = False (default)/True
    Limited = proportion (in [0,1]) * (max - med) valuationdomain
kChoices(self, A, k)
Renders all choices of length k from set A
matmult2(self, m, v)
Parameters: digraph relation and choice characteristic vector
matrix multiply vector by inner production
meanDegree(self)
Renders the mean degree of self.
!!! self.size must be set previously !!!
meanLength(self, Oriented=False)
Renders the (by default non-oriented) mean neighbourhoor depth of self.
!!! self.order must be set previously !!!
minimalChoices(self, S)
Generates all dominant or absorbent choices of a bipolar
valued digraph.
 
.. note:
 
   * Initiate with S = (actions, dict of dominant or absorbent closed neighborhoods)
   * See showMinDom and showMinAbs methods.
minimalValuationLevelForCircuitsElimination(self, Odd=True, Debug=False, Comments=False)
renders the minimal valuation level <lambda> that eliminates all
self.circuitsList stored odd chordless circuits from self.
 
.. warning::
 
    The <lambda> level polarised may still contain newly appearing chordless odd circuits !
neighbourhoodCollection(self, Oriented=False, Potential=False)
Renders the neighbourhood.
neighbourhoodDepthDistribution(self, Oriented=False)
Renders the distribtion of neighbourhood depths.
notGammaSets(self)
Renders the dictionary of neighborhoods {node: (dx,ax)}
with set *dx* gathering the not dominated, and set *ax* gathering
the not absorbed neighborhood.
notaneighbors(self, node)
Renders the set of absorbed not in-neighbors of a node.
notdneighbors(self, node)
Renders the set of not dominated out-neighbors of a node.
outDegrees(self)
renders the median cut outdegrees
outDegreesDistribution(self)
Renders the distribution of outdegrees.
plusirredundant(self, U)
Generates all +irredundant choices of a digraph.
powerset(self, U)
Generates all subsets of a set.
readPerrinMisset(self, file='curd.dat')
read method for 0-1-char-coded MISs by default from the perrinMIS.c curd.dat result file.
readabsvector(self, x, relation)
Parameter: action x
absorbent in vector.
readdomvector(self, x, relation)
Parameter: action x
dominant out vector.
recodeValuation(self, newMin=-1.0, newMax=1.0, ndigits=4, Debug=False)
Recodes the characteristic valuation domain according
to the parameters given. 
 
*ndigits* indicates the number of decimal digits of the valuation.
relationFct(self, x, y)
wrapper for self.relation dictionary access to ensure interoperability
with the sparse and big outranking digraph implementation model.
save(self, fileName='tempdigraph', option=None, DecimalValuation=True, decDigits=2)
Persistent storage of a Digraph class instance in the form of
a python source code file
saveCSV(self, fileName='tempdigraph', Normalized=False, Dual=False, Converse=False, Diagonal=False, Debug=False)
Persistent storage of a Digraph class instance in the form of
a csv file.
saveXMCDA2(self, fileName='temp', fileExt='xmcda2', Comments=True, relationName='R', relationType='binary', category='random', subcategory='valued', author='digraphs Module (RB)', reference='saved from Python', valuationType='standard', digits=2, servingD3=False)
save digraph in XMCDA 2.0 format. Deprecated now.
savedre(self, fileName='temp')
save digraph in nauty format.
sharp(self, x, y)
Paramaters: choice characteristic values.
Renders the sharpest of two characteristic values x and y.
sharpvec(self, v, w)
Paramaters: choice characteristic vectors.
Renders the sharpest of two characteristic vectors v and w.
showActions(self)
presentation methods for digraphs actions
showAll(self)
Detailed show method for genuine digraphs.
showAttributes(self)
Prints out the attributes of self.
showAutomorphismGenerators(self)
Renders the generators of the automorphism group.
showBadChoices(self, Recompute=True)
Characteristic values for potentially bad choices.
showBestChoiceRecommendation(self, Verbose=False, Comments=True, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True)
Shows the RuBis best choice recommendation.
 
.. note::
 
    Computes by default the Rubis best choice recommendation on the corresponding strict (codual) outranking digraph.
 
    By default, with BrokenCocs=True, we brake all chordless circuits at their weakest determined ( abs(r(x>y)) + abs(r(y>x)) ) link.
 
    When BrokenCocs=False we proceed like follows:
 
    In case of chordless circuits, if supporting arcs are more credible
    than the reversed negating arcs, we collapse the circuits into hyper nodes.
    Inversely,  if supporting arcs are not more credible than the reversed negating arcs,
    we brake the circuits on their weakest arc.
 
Usage example:
 
>>> from outrankingDigraphs import *
>>> t = Random3ObjectivesPerformanceTableau(seed=5)
>>> g = BipolarOutrankingDigraph(t)
>>> g.showBestChoiceRecommendation()
***********************
RuBis Best Choice Recommendation (BCR)
(in decreasing order of determinateness)   
Credibility domain:  [-100.0, 100.0]
=== >> potential first choices
* choice              : ['a04', 'a14', 'a19', 'a20']
   independence        : 1.19
   dominance           : 4.76
   absorbency          : -59.52
   covering (%)        : 75.00
   determinateness (%) : 57.86
   - most credible action(s) = { 'a14': 23.81, 'a19': 11.90, 'a04': 2.38, 'a20': 1.19, }  
=== >> potential last choices 
* choice              : ['a03', 'a12', 'a17']
  independence        : 4.76
  dominance           : -76.19
  absorbency          : 4.76
  covering (%)        : 0.00
  determinateness (%) : 65.39
  - most credible action(s) = { 'a03': 38.10, 'a12': 13.10, 'a17': 4.76, }
Execution time: 0.024 seconds
*****************************
showChoiceVector(self, ch, choiceType='good', ChoiceVector=True)
Show procedure for annotated bipolar choices.
showChordlessCircuits(self, Recompute=False)
Show method for chordless circuits observed in a Digraph instance.
 
If previous computation is required, stores the detected circuits in self.circuitsList attribute.
showComponents(self)
Shows the list of connected components of the digraph instance.
showCorrelation(self, corr=None, ndigits=3)
Renders the valued ordinal correlation index, the crisp Kendall tau index and their epistemic determination degree.
showFirstChoiceRecommendation(self, Verbose=False, Comments=True, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True)
Shows the RuBis first choice recommendation.
 
.. note::
 
    Computes by default the Rubis first choice recommendation on the corresponding strict (codual) outranking digraph.
 
    By default, with BrokenCocs=True, we brake all chordless circuits at their weakest determined ( abs(r(x>y)) + abs(r(y>x)) ) link.
 
    When BrokenCocs=False we proceed like follows:
 
    In case of chordless circuits, if supporting arcs are more credible
    than the reversed negating arcs, we collapse the circuits into hyper nodes.
    Inversely,  if supporting arcs are not more credible than the reversed negating arcs,
    we brake the circuits on their weakest arc.
 
Usage example:
 
>>> from outrankingDigraphs import *
>>> t = Random3ObjectivesPerformanceTableau(seed=5)
>>> g = BipolarOutrankingDigraph(t)
>>> g.showFirstChoiceRecommendation()
***********************
RuBis First Choice Recommendation (BCR)
(in decreasing order of determinateness)   
Credibility domain:  [-100.0, 100.0]
=== >> potential first choices
* choice              : ['a04', 'a14', 'a19', 'a20']
   independence        : 1.19
   dominance           : 4.76
   absorbency          : -59.52
   covering (%)        : 75.00
   determinateness (%) : 57.86
   - most credible action(s) = { 'a14': 23.81, 'a19': 11.90, 'a04': 2.38, 'a20': 1.19, }  
=== >> potential last choices 
* choice              : ['a03', 'a12', 'a17']
  independence        : 4.76
  dominance           : -76.19
  absorbency          : 4.76
  covering (%)        : 0.00
  determinateness (%) : 65.39
  - most credible action(s) = { 'a03': 38.10, 'a12': 13.10, 'a17': 4.76, }
Execution time: 0.024 seconds
*****************************
showGoodChoices(self, Recompute=True)
Characteristic values for potentially good choices.
showHTMLBestChoiceRecommendation(self, pageTitle=None, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True, htmlFileName=None)
showHTMLRelationHeatmap(self, actionsList=None, rankingRule='NetFlows', colorLevels=7, tableTitle='Relation Heatmap', relationName='r(x S y)', ndigits=2, fromIndex=None, toIndex=None, htmlFileName=None)
Launches a browser window with the colored relation map of self.
 
See corresponding :py:class:`~digraphs.Digraph.showHTMLRelationMap` method.
 
The *colorLevels* parameter may be set to 3, 5, 7 (default) or 9.
 
When the *actionsList* parameter is *None* (default), the digraphs actions list may be ranked with the *rankingRule* parameter set to the 'Copeland' (default) or to the 'Netlows' ranking rule.
 
When the *htmlFileName* parameter is set to a string value 'xxx', a html file named 'xxx.html' will be generated in the current working directory. Otherwise, a temporary file named 'tmp*.html' will be generated there.
 
Example::
 
    >>> from outrankingDigraphs import *
    >>> t = RandomCBPerformanceTableau(numberOfActions=25,seed=1)
    >>> g = BipolarOutrankingDigraph(t,ndigits=2)
    >>> gcd = ~(-g)  # strict outranking relation
    >>> gcd.showHTMLRelationHeatmap(colorLevels=7,ndigits=2)
    
.. image:: relationHeatmap.png
   :alt: Browser view of a relation map
   :width: 600 px
   :align: center
showHTMLRelationMap(self, actionsList=None, rankingRule='Copeland', Colored=True, tableTitle='Relation Map', relationName='r(x S y)', symbols=['+', '&middot;', '&nbsp;', '&#150;', '&#151'], fromIndex=None, toIndex=None, htmlFileName=None)
Launches a browser window with the colored relation map of self.
See corresponding Digraph.showRelationMap() method.
 
When *htmlFileName* parameter is set to a string value, a html file
with that name will be stored in the current working directory.
 
By default, a temporary file named: tmp*.html will be generated
instead in the current working directory.
 
Example::
 
    >>> from outrankingDigraphs import *
    >>> t = RandomCBPerformanceTableau(numberOfActions=25,seed=1)
    >>> g = BipolarOutrankingDigraph(t,Normalized=True)
    >>> gcd = ~(-g)  # strict outranking relation
    >>> gcd.showHTMLRelationMap(rankingRule="NetFlows")
    
.. image:: relationMap.png
   :alt: Browser view of a relation map
   :width: 600 px
   :align: center
showHTMLRelationTable(self, actionsList=None, relation=None, IntegerValues=False, ndigits=2, Colored=True, tableTitle='Valued Adjacency Matrix', relationName='r(x S y)', ReflexiveTerms=False, htmlFileName=None, fromIndex=None, toIndex=None)
Launches a browser window with the colored relation table of self.
showMIS(self, withListing=True)
Prints all maximal independent choices:
    Result in self.misset.
showMIS_AH(self, withListing=True)
Prints all MIS using the Hertz method.
 
Result saved in self.hertzmisset.
showMIS_HB2(self, withListing=True)
Prints all MIS using the Hertz-Bisdorff method.
 
Result saved in self.newmisset.
showMIS_RB(self, withListing=True)
Prints all MIS using the Bisdorff method.
 
Result saved in self.newmisset.
showMIS_UD(self, withListing=True)
Prints all MIS using the Hertz-Bisdorff method.
 
Result saved in self.newmisset.
showMaxAbsIrred(self, withListing=True)
Computing maximal -irredundant choices:
    Result in self.absirset.
showMaxDomIrred(self, withListing=True)
Computing maximal +irredundant choices:
   Result in self.domirset.
showMinAbs(self, withListing=True)
Prints minimal absorbent choices:
    Result in self.absset.
showMinDom(self, withListing=True)
Prints all minimal dominant choices:
    Result in self.domset.
showNeighborhoods(self)
Lists the gamma and the notGamma function of self.
showOrbits(self, InChoices, withListing=True)
Prints the orbits of Choices along the automorphisms of
the Digraph instance.
 
Example Python session for computing the non isomorphic MISs from the 12-cycle graph:
 
>>> from digraphs import *
>>> c12 = CirculantDigraph(order=12,circulants=[1,-1])
>>> c12.automorphismGenerators()
...
  Permutations
  {'1': '1', '2': '12', '3': '11', '4': '10', '5': 
   '9', '6': '8', '7': '7', '8': '6', '9': '5', '10': 
   '4', '11': '3', '12': '2'}
  {'1': '2', '2': '1', '3': '12', '4': '11', '5': '10', 
   '6': '9', '7': '8', '8': '7', '9': '6', '10': '5', 
   '11': '4', '12': '3'}
  Reflections {}
>>> print('grpsize = ', c12.automorphismGroupSize)
  grpsize = 24
>>> c12.showMIS(withListing=False)
  *---  Maximal independent choices ---*
  number of solutions:  29
  cardinality distribution
  card.:  [0, 1, 2, 3, 4,  5,  6, 7, 8, 9, 10, 11, 12]
  freq.:  [0, 0, 0, 0, 3, 24,  2, 0, 0, 0,  0,  0,  0]
  Results in c12.misset
>>> c12.showOrbits(c12.misset,withListing=False)
...
  *---- Global result ----
  Number of MIS:  29
  Number of orbits :  4
  Labelled representatives:
  1: ['2','4','6','8','10','12']
  2: ['2','5','8','11']
  3: ['2','4','6','9','11']
  4: ['1','4','7','9','11']
  Symmetry vector
  stabilizer size: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, ...]
  frequency      : [0, 2, 0, 0, 0, 0, 0, 1, 0,  0,  0,  1, ...]
 
*Figure*: The symmetry axes of the non isomorphic MISs of the 12-cycle:
 
.. image:: c12.png
   :width: 400 px
   :align: center
   :alt: The 4 non isomorphic MIS of the 12-cycle graph
 
*Reference*: R. Bisdorff and J.L. Marichal (2008). Counting non-isomorphic maximal independent sets of the n-cycle graph. *Journal of Integer Sequences*, Vol. 11 Article 08.5.7 (`openly accessible here <https://www.cs.uwaterloo.ca/journals/JIS/VOL11/Marichal/marichal.html>`_)
showOrbitsFromFile(self, InFile, withListing=True)
Prints the orbits of Choices along the automorphisms of
the digraph self by reading in the 0-1 misset file format.
See the :py:func:`digraphs.Digraph.readPerrinMisset` method.
showPreKernels(self, withListing=True)
Printing dominant and absorbent preKernels:
    Result in self.dompreKernels and self.abspreKernels
showRankingByBestChoosing(self, rankingByBestChoosing=None)
A show method for self.rankinByBestChoosing result.
 
.. warning::
 
     The self.computeRankingByBestChoosing(CoDual=False/True) method instantiating the self.rankingByBestChoosing slot is pre-required !
showRankingByChoosing(self, rankingByChoosing=None, WithCoverCredibility=False)
A show method for self.rankinByChoosing result.
 
When parameter *WithCoverCredibility* is set to True, the credibility of outranking, respectively being outranked is indicated at each selection step. 
 
.. warning::
 
     The self.computeRankingByChoosing(CoDual=False/True) method instantiating the self.rankingByChoosing slot is pre-required !
showRankingByLastChoosing(self, rankingByLastChoosing=None, Debug=None)
A show method for self.rankinByChoosing result.
 
.. warning::
 
     The self.computeRankingByLastChoosing(CoDual=False/True) method instantiating the self.rankingByChoosing slot is pre-required !
showRelation(self)
prints the relation valuation in ##.## format.
showRelationMap(self, symbols=None, rankingRule='Copeland', fromIndex=None, toIndex=None, actionsList=None)
Prints on the console, in text map format, the location of
certainly validated and certainly invalidated outranking situations.
 
By default, symbols = {'max':'┬','positive': '+', 'median': ' ',
                       'negative': '-', 'min': '┴'}
 
The default ordering of the output is following the Copeland ranking rule
from best to worst actions. Further available ranking rule is the 'NetFlows' net flows rule.
 
 
Example::
 
    >>> from outrankingDigraphs import *
    >>> t = RandomCBPerformanceTableau(numberOfActions=25,seed=1)
    >>> g = BipolarOutrankingDigraph(t,Normalized=True)
    >>> gcd = ~(-g)  # strict outranking relation
    >>> gcd.showRelationMap(rankingRule="NetFlows")
     -   ++++++++  +++++┬+┬┬+
    - -   + +++++ ++┬+┬+++┬++
    ┴+  ┴ + ++  ++++┬+┬┬++┬++
    -   ++ - ++++-++++++┬++┬+
       - - - ++- ┬- + -+┬+-┬┬
    -----  -      -┬┬┬-+  -┬┬
    ----    --+-+++++++++++++
    -- --+- --++ ++ +++-┬+-┬┬
    ----  -  -+-- ++--+++++ +
    ----- ++- --- +---++++┬ +
    -- -- ---+ -++-+++-+ +-++
    -- --┴---+  + +-++-+ -  +
    ---- ┴---+-- ++--++++ - +
      --┴┴--  --- -  --+ --┬┬
     ---------+--+ ----- +-┬┬
    -┴---┴- ---+- + ---+++┬ +
    -┴┴--┴---+--- ++ -++--+++
    -----┴--- ---+-+- ++---+ 
    -┴┴--------------- --++┬ 
    --┴---------------- --+┬ 
    ┴--┴┴ -┴--┴┴-┴ --++  ++-+
    ----┴┴--------------- -  
    ┴┴┴----+-┴+┴---┴-+---+ ┴+
    ┴┴-┴┴┴-┴- - -┴┴---┴┴+ ┬ -
    ----┴┴-┴-----┴┴---  - -- 
    Ranking rule: NetFlows
    >>>
showRelationTable(self, Sorted=True, rankingRule=None, IntegerValues=False, actionsSubset=None, relation=None, ndigits=2, ReflexiveTerms=True, fromIndex=None, toIndex=None)
Prints the relation valuation in actions X actions table format.
Copeland and NetFlows rankings my be used.
showRubisBestChoiceRecommendation(self, **kwargs)
Dummy for backward portable showBestChoiceRecommendation().
showRubyChoice(self, Verbose=False, Comments=True, _OldCoca=True)
Dummy for showBestChoiceRecommendation()
needed for older versions compatibility.
showShort(self)
concise presentation method for genuine digraphs.
showSingletonRanking(self, Comments=True, Debug=False)
Calls self.computeSingletonRanking(comments=True,Debug = False).
Renders and prints the sorted bipolar net determinatation of outrankingness
minus outrankedness credibilities of all singleton choices.
 
res = ((netdet,sigleton,dom,absorb)+)
showStatistics(self)
Computes digraph statistics like order, size and arc-density.
showdre(self)
Shows relation in nauty format.
singletons(self)
list of singletons and neighborhoods
[(singx1, +nx1, -nx1, not(+nx1 or -nx1)),.... ]
sizeSubGraph(self, choice)
Output: (size, undeterm,arcDensity).
Renders the arc density of the induced subgraph.
strongComponents(self, setPotential=False)
Renders the set of strong components of self.
symDegreesDistribution(self)
Renders the distribution of symmetric degrees.
topologicalSort(self, Debug=False)
If self is acyclic, adds topological sort number to each node of self
and renders ordered list of nodes. Otherwise renders None.
Source: M. Golumbic Algorithmic Graph heory and Perfect Graphs,
Annals Of Discrete Mathematics 57 2nd Ed. , Elsevier 2004, Algorithm 2.4 p.44.
weakAneighbors(self, node)
Renders the set of absorbed in-neighbors of a node.
weakCondorcetLosers(self)
Renders the set of decision actions x such that
self.relation[x][y] <= self.valuationdomain['med']
for all y != x.
weakCondorcetWinners(self)
Renders the set of decision actions x such that
self.relation[x][y] >= self.valuationdomain['med']
for all y != x.
weakDneighbors(self, node)
Renders the set of dominated out-neighbors of a node.
weakGammaSets(self)
Renders the dictionary of neighborhoods {node: (dx,ax)}
zoomValuation(self, zoomFactor=1.0)
Zooms in or out, depending on the value of the zoomFactor provided,
the bipolar valuation of a digraph.

Data descriptors inherited from Digraph:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class GridDigraph(Digraph)
    GridDigraph(n=5, m=5, valuationdomain={'min': -1.0, 'max': 1.0}, hasRandomOrientation=False, hasMedianSplitOrientation=False)
 
Specialization of the general Digraph class for generating
temporary Grid digraphs of dimension n times m.
 
Parameters:
    n,m > 0; valuationdomain ={'min':m, 'max':M}.
 
Default instantiation (5 times 5 Grid Digraph):
    n = 5, m=5, valuationdomain = {'min':-1.0,'max':1.0}.
 
Randomly orientable with hasRandomOrientation=True (default=False).
 
 
Method resolution order:
GridDigraph
Digraph
builtins.object

Methods defined here:
__init__(self, n=5, m=5, valuationdomain={'min': -1.0, 'max': 1.0}, hasRandomOrientation=False, hasMedianSplitOrientation=False)
Initialize self.  See help(type(self)) for accurate signature.
showShort(self)
concise presentation method for genuine digraphs.

Methods inherited from Digraph:
MISgen(self, S, I)
generator of maximal independent choices (voir Byskov 2004):
    * S ::= remaining nodes;
    * I ::= current independent choice
 
.. note::
 
        Inititalize: self.MISgen(self.actions.copy(),set())
__invert__(self)
Make the inverting operator ~self available for Digraph instances. 
 
Returns a ConverseDigraph instance of self.
__neg__(self)
Make the negation operator -self available for Digraph instances. 
 
Returns a DualDigraph instance of self.
__repr__(self)
Default presentation method for Digraph instances.
absirred(self, choice)
Renders the crips -irredundance degree of a choice.
absirredundant(self, U)
Generates all -irredundant choices of a digraph.
absirredval(self, choice, relation)
Renders the valued -irredundance degree of a choice.
absirredx(self, choice, x)
Computes the crips -irredundance degree of node x in a choice.
abskernelrestrict(self, prekernel)
Parameter: prekernel
Renders absorbent prekernel restricted relation.
absorb(self, choice)
Renders the absorbency degree of a choice.
absorbentChoices(self, S)
Generates all minimal absorbent choices of a bipolar valued digraph.
addValuationAttribute(self)
Adds the numpy valuation attribute
agglomerationDistribution(self)
Output: aggloCoeffDistribution, meanCoeff
Renders the distribution of agglomeration coefficients.
aneighbors(self, node)
Renders the set of absorbed in-neighbors of a node.
automorphismGenerators(self)
Adds automorphism group generators to the digraph instance.
 
.. note::
 
    Dependency: Uses the dreadnaut command from the nauty software package. See https://www3.cs.stonybrook.edu/~algorith/implement/nauty/implement.shtml
 
    On Ubuntu Linux:
      ...$ sudo apt-get install nauty
averageCoveringIndex(self, choice, direction='out')
Renders the average covering index of a given choice in a set of objects,
ie the average number of choice members that cover each
non selected object.
bipolarKCorrelation(self, digraph, Debug=False)
Renders the bipolar Kendall correlation between two bipolar valued
digraphs computed from the average valuation of the
XORDigraph(self,digraph) instance.
 
.. warning::
 
     Obsolete! Is replaced by the self.computeBipolarCorrelation(other) Digraph method
bipolarKDistance(self, digraph, Debug=False)
Renders the bipolar crisp Kendall distance between two bipolar valued
digraphs.
 
.. warning::
 
     Obsolete! Is replaced by the self.computeBipolarCorrelation(other, MedianCut=True) Digraph method
chordlessPaths(self, Pk, n2, Odd=False, Comments=False, Debug=False)
New procedure from Agrum study April 2009
recursive chordless path extraction starting from path
Pk = [n2, ...., n1] and ending in node n2.
Optimized with marking of visited chordless P1s.
circuitAverageCredibility(self, circ)
Renders the average linking credibility of a Chordless Circuit.
circuitCredibilities(self, circuit, Debug=False)
Renders the average linking credibilities and the minimal link of a Chordless Circuit.
circuitMaxCredibility(self, circ)
Renders the maximal linking credibility of a Chordless Circuit.
circuitMinCredibility(self, circ)
Renders the minimal linking credibility of a Chordless Circuit.
closeSymmetric(self, InSite=True)
Produces the symmetric closure of self.relation.
closeTransitive(self, Reverse=False, InSite=True, Comments=False)
Produces the transitive closure of self.relation
 
*Parameters*:
 
    - If *Reverse* == True (False default) all transitive links are dropped, otherwise all transitive links are closed with min[r(x,y),r(y,z)];
    - If *Insite* == False (True by default) the methods return a modified copy of self.relation without altering the original self.relation, otherwise self.relation is modified.
components(self)
Renders the list of connected components.
computeAllDensities(self, choice=None)
parameter: choice in self
renders six densitiy parameters:
arc density, double arc density,
single arc density, strict single arc density,
absence arc density, strict absence arc densitiy.
computeArrowRaynaudOrder(self)
Renders a linear ordering from worst to best of the actions following Arrow&Raynaud's rule.
computeArrowRaynaudRanking(self)
renders a linear ranking from best to worst of the actions following Arrow&Raynaud's rule.
computeAverageValuation(self)
Computes the bipolar average correlation between
self and the crisp complete digraph of same order
of the irreflexive and determined arcs of the digraph
computeBadChoices(self, Comments=False)
Computes characteristic values for potentially bad choices.
 
.. note::
 
     Returns a tuple with following content:
 
     [(0)-determ,(1)degirred,(2)degi,(3)degd,(4)dega,(5)str(choice),(6)absvec]
computeBadPirlotChoices(self, Comments=False)
Characteristic values for potentially bad choices
using the Pirlot's fixpoint algorithm.
computeBestChoiceRecommendation(self, Verbose=False, Comments=False, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True)
Sets self.bestChoice, self.bestChoiceData, self.worstChoice and self.worstChoiceData
with the showBestChoiceRecommendation method.
 
First and last choices data is the following:
[(0)-determ,(1)degirred,(2)degi,(3)degd,(4)dega,(5)str(choice),(6)domvec,(7)cover]
 
self.bestChoice = self.bestChoiceData[5]
self.worstChoice = self.worstChoiceData[5]
computeBipolarCorrelation(self, other, MedianCut=False, filterRelation=None, Debug=False)
obsolete: dummy replacement for Digraph.computeOrdinalCorrelation method
computeChordlessCircuits(self, Odd=False, Comments=False, Debug=False)
Renders the set of all chordless circuits detected in a digraph.
Result is stored in <self.circuitsList>
holding a possibly empty list of tuples with at position 0 the
list of adjacent actions of the circuit and at position 1
the set of actions in the stored circuit.
 
When *Odd* is True, only chordless circuits with an odd length
are collected.
computeChordlessCircuitsMP(self, Odd=False, Threading=False, nbrOfCPUs=None, startMethod=None, Comments=False, Debug=False)
Multiprocessing version of computeChordlessCircuits().
 
Renders the set of all chordless odd circuits detected in a digraph.
Result (possible empty list) stored in <self.circuitsList>
holding a possibly empty list tuples with at position 0 the
list of adjacent actions of the circuit and at position 1
the set of actions in the stored circuit.
Inspired by Dias, Castonguay, Longo, Jradi, Algorithmica (2015).
 
Returns a possibly empty list of tuples (circuit,frozenset(circuit)).
 
If Odd == True, only circuits of odd length are retained in the result.
computeCoSize(self)
Renders the number of non validated non reflexive arcs
computeConcentrationIndex(self, X, N)
Renders the Gini concentration index of the X serie.
N contains the partial frequencies.
Based on the triangle summation formula.
computeConcentrationIndexTrapez(self, X, N)
Renders the Gini concentration index of the X serie.
N contains the partial frequencies.
Based on the triangles summation formula.
computeCondorcetLosers(self)
Wrapper for condorcetLosers().
computeCondorcetWinners(self)
Wrapper for condorcetWinners().
computeCopelandOrder(self)
renders a linear ordering from worst to best of the actions following Arrow&Raynaud's rule.
computeCopelandRanking(self)
renders a linear ranking from best to worst of the actions following Arrow&Raynaud's rule.
computeCutLevelDensities(self, choice, level)
parameter: choice in self, robustness level
renders three robust densitiy parameters:
robust double arc density,
robust single arc density,
robust absence arc densitiy.
computeDensities(self, choice)
parameter: choice in self
renders the four densitiy parameters:
arc density, double arc density, single arc density, absence arc density.
computeDeterminateness(self, InPercents=False)
Computes the Kendalll distance of self
with the all median-valued indeterminate digraph of order n.
 
Return the average determination of the irreflexive part of the digraph.
 
*determination* = sum_(x,y) { abs[ r(xRy) - Med ] } / n(n-1)
 
If *InPercents* is True, returns the average determination in percentage of
(Max - Med) difference.
 
>>> from outrankingDigraphs import BipolarOutrankingDigraph
>>> from randomPerfTabs import Random3ObjectivesPerformanceTableau
>>> t = Random3ObjectivesPerformanceTableau(numberOfActions=7,numberOfCriteria=7,seed=101)
>>> g = BipolarOutrankingDigraph(t,Normalized=True)
>>> g
*------- Object instance description ------*
Instance class      : BipolarOutrankingDigraph
Instance name       : rel_random3ObjectivesPerfTab
Actions             : 7
Criteria            : 7
Size                : 27
Determinateness (%) : 65.67
Valuation domain    : [-1.00;1.00]
>>> print(g.computeDeterminateness())
0.3134920634920634920634920638
>>> print(g.computeDeterminateness(InPercents=True))
65.67460317460317460317460320
>>> g.recodeValuation(0,1)
>>> g
*------- Object instance description ------*
Instance class      : BipolarOutrankingDigraph
Instance name       : rel_random3ObjectivesPerfTab
Actions             : 7
Criteria            : 7
Size                : 27
Determinateness (%) : 65.67
Valuation domain    : [0.00;1.00]
>>> print(g.computeDeterminateness())
0.1567460317460317460317460318
>>> print(g.computeDeterminateness(InPercents=True))
65.67460317460317460317460320
computeDiameter(self, Oriented=True)
Renders the (by default oriented) diameter of the digraph instance
computeDigraphCentres(self, WeakDistances=False, Comments=False)
The centers of a digraph are the nodes with finite minimal shortes path lengths.
 
The maximal neighborhood distances are stored in *self.maximalNeighborhoodDistances*.
 
The corresponding digraph radius and diameter are stored respectively  in *self.radius* and *self.diameter*.
 
With *Comments* = True, all these results are printed out.
 
*Source*: Claude Berge, *The Theory of Graphs*, Dover (2001) pp. 119, original in French Dunod (1958)
computeDynamicProgrammingStages(self, source, sink, Debug=False)
Renders the discrete stages of the optimal substructure for
dynamic pogramming digrahs from a given source node 
to a given sink sink node.
 
Returns a list of list of action identifyers.
computeGoodChoiceVector(self, ker, Comments=False)
| Computing Characteristic values for dominant pre-kernels
| using the von Neumann dual fixoint equation
computeGoodChoices(self, Comments=False)
Computes characteristic values for potentially good choices.
 
..note::
 
     Return a tuple with following content:
 
     [(0)-determ,(1)degirred,(2)degi,(3)degd,(4)dega,(5)str(choice),(6)domvec,(7)cover]
computeGoodPirlotChoices(self, Comments=False)
Characteristic values for potentially good choices
using the Pirlot fixpoint algorithm.
computeIncomparabilityDegree(self, InPercents=False, Comments=False)
Renders the incomparability degree (Decimal), i.e. the relative number of symmetric indeterminate relations of the irreflexive part of a digraph.
computeKemenyIndex(self, otherRelation)
renders the Kemeny index of the self.relation
compared with a given crisp valued relation of a compatible
other digraph (same nodes or actions).
computeKemenyOrder(self, orderLimit=7, Debug=False)
Renders a ordering from worst to best of the actions with maximal Kemeny index.
Return a tuple: kemenyOrder (from worst to best), kemenyIndex
computeKemenyRanking(self, orderLimit=7, seed=None, sampleSize=1000, Debug=False)
Renders a ranking from best to worst of the actions with maximal Kemeny index.
 
.. note::
 
     Returns a tuple: kemenyRanking (from best to worst), kemenyIndex.
computeKernelVector(self, kernel, Initial=True, Comments=False)
| Computing Characteristic values for dominant pre-kernels
| using the von Neumann dual fixpoint equation
computeKohlerOrder(self)
Renders an ordering (worst to best) of the actions following Kohler's rule.
computeKohlerRanking(self)
Renders a ranking (best to worst) of the actions following Kohler's rule.
computeMaxHoleSize(self, Comments=False)
Renders the length of the largest chordless cycle
in the corresponding disjunctive undirected graph.
computeMeanInDegree(self)
Renders the mean indegree of self.
!!! self.size must be set previously !!!
computeMeanOutDegree(self)
Renders the mean degree of self.
!!! self.size must be set previously !!!
computeMeanSymDegree(self)
Renders the mean degree of self.
!!! self.size must be set previously !!!
computeMedianOutDegree(self)
Renders the median outdegree of self.
!!! self.size must be set previously !!!
computeMedianSymDegree(self)
Renders the median symmetric degree of self.
!!! self.size must be set previously !!!
computeMoreOrLessUnrelatedPairs(self)
Renders a list of more or less unrelated pairs.
computeNetFlowsOrder(self)
Renders an ordered list (from best to worst) of the actions
following the net flows ranking rule.
computeNetFlowsOrderDict(self)
Renders an ordered list (from worst to best) of the actions
following the net flows ranking rule.
computeNetFlowsRanking(self)
Renders an ordered list (from best to worst) of the actions
following the net flows ranking rule.
computeNetFlowsRankingDict(self)
Renders an ordered list (from best to worst) of the actions
following the net flows ranking rule.
computeODistance(self, op2, comments=False)
renders the squared normalized distance of
two digraph valuations.
 
.. note::
 
     op2 = digraphs of same order as self.
computeOrbit(self, choice, withListing=False)
renders the set of isomorph copies of a choice following
the automorphism of the digraph self
computeOrderCorrelation(self, order, Debug=False)
Renders the ordinal correlation K of a digraph instance
when compared with a given linear order (from worst to best) of its actions
 
K = sum_{x != y} [ min( max(-self.relation(x,y)),other.relation(x,y), max(self.relation(x,y),-other.relation(x,y)) ]
 
K /= sum_{x!=y} [ min(abs(self.relation(x,y),abs(other.relation(x,y)) ]
 
.. note::
 
     Renders a dictionary with the key 'correlation' containing the actual bipolar correlation index and the key 'determination' containing the minimal determination level D of self and the other relation.
 
     D = sum_{x != y} min(abs(self.relation(x,y)),abs(other.relation(x,y)) / n(n-1)
 
     where n is the number of actions considered.
 
     The correlation index with a completely indeterminate relation
     is by convention 0.0 at determination level 0.0 .
 
.. warning::
 
     self must be a normalized outranking digraph instance !
computeOrdinalCorrelation(self, other, MedianCut=False, filterRelation=None, Debug=False)
Renders the bipolar correlation K of a
self.relation when compared
with a given compatible (same actions set)) digraph or
a [-1,1] valued compatible relation (same actions set).
 
If MedianCut=True, the correlation is computed on the median polarized relations.
 
If filterRelation is not None, the correlation is computed on the partial domain corresponding to the determined part of the filter relation.
 
.. warning::
 
     Notice that the 'other' relation and/or the 'filterRelation',
     the case given, must both be normalized, ie [-1,1]-valued !
 
K = sum_{x != y} [ min( max(-self.relation[x][y]),other.relation[x][y]), max(self.relation[x][y],-other.relation[x][y]) ]
 
K /= sum_{x!=y} [ min(abs(self.relation[x][y]),abs(other.relation[x][y])) ]
 
.. note::
 
     Renders a tuple with at position 0 the actual bipolar correlation index
     and in position 1 the minimal determination level D of self and
     the other relation.
 
     D = sum_{x != y} min(abs(self.relation[x][y]),abs(other.relation[x][y])) / n(n-1)
 
     where n is the number of actions considered.
 
     The correlation index with a completely indeterminate relation
     is by convention 0.0 at determination level 0.0 .
computeOrdinalCorrelationMP(self, other, MedianCut=False, Threading=False, nbrOfCPUs=None, startMethod=None, Comments=False, Debug=False)
Multi processing version of the digraphs.computeOrdinalCorrelation() method.
 
.. note::
     The relation filtering and the MedinaCut option are not implemented in the MP version.
computePairwiseClusterComparison(self, K1, K2, Debug=False)
Computes the pairwise cluster comparison credibility vector
from bipolar-valued digraph g. with K1 and K2 disjoint
lists of action keys from g actions disctionary.
Returns the dictionary
{'I': Decimal(),'P+':Decimal(),'P-':Decimal(),'R' :Decimal()}
where one and only one item is strictly positive.
computePreKernels(self)
computing dominant and absorbent preKernels:
    Result in self.dompreKernels and self.abspreKernels
computePreRankingRelation(self, preRanking, Normalized=True, Debug=False)
Renders the bipolar-valued relation obtained from
a given preRanking in decreasing levels (list of lists) result.
computePreorderRelation(self, preorder, Normalized=True, Debug=False)
Renders the bipolar-valued relation obtained from
a given preordering in increasing levels (list of lists) result.
computePrincipalOrder(self, Colwise=False, Comments=False)
Rendesr an ordering from wrost to best of the decision actions.
computePrincipalRanking(self, Colwise=False, Comments=False)
Rendesr a ranking from best to worst of the decision actions.
computePrincipalScores(self, plotFileName=None, Colwise=False, imageType=None, tempDir=None, bgcolor='cornsilk', Comments=False, Debug=False)
Renders a ordered list of the first principal eigenvector of the covariance of the valued outdegrees of self.
 
.. note::
 
   The method, relying on writing and reading temporary files by default in a temporary directory is threading and multiprocessing safe !
   (see Digraph.exportPrincipalImage method)
computePrudentBetaLevel(self, Debug=False)
computes alpha, ie the lowest valuation level, for which the
bipolarly polarised digraph doesn't contain a chordless circuit.
computeRankingByBestChoosing(self, CoDual=False, Debug=False)
Computes a weak preordering of the self.actions by recursive
best choice elagations.
 
Stores in self.rankingByBestChoosing['result'] a list of (P+,bestChoice) tuples
where P+ gives the best choice complement outranking
average valuation via the computePairwiseClusterComparison
method.
 
If self.rankingByBestChoosing['CoDual'] is True, 
the ranking-by-choosing was computed on the codual of self.
computeRankingByBestChoosingRelation(self, rankingByBestChoosing=None, Debug=False)
Renders the bipolar-valued relation obtained from
the self.rankingByBestChoosing result.
computeRankingByChoosing(self, actionsSubset=None, Debug=False, CoDual=False)
Computes a weak preordring of the self.actions by iterating
jointly first and last choice elagations.
 
Stores in self.rankingByChoosing['result'] a list of ((P+,bestChoice),(P-,worstChoice)) pairs
where P+ (resp. P-) gives the best (resp. worst) choice complement outranking
(resp. outranked) average valuation via the computePairwiseClusterComparison
method.
 
If self.rankingByChoosing['CoDual'] is True, the ranking-by-choosing was computed on the codual of self.
computeRankingByChoosingRelation(self, rankingByChoosing=None, actionsSubset=None, Debug=False)
Renders the bipolar-valued relation obtained from
the self.rankingByChoosing result.
computeRankingByLastChoosing(self, CoDual=False, Debug=False)
Computes a weak preordring of the self.actions by iterating
worst choice elagations.
 
Stores in self.rankingByLastChoosing['result'] a list of (P-,worstChoice) pairs
where P- gives the worst choice complement outranked
average valuation via the computePairwiseClusterComparison
method.
 
If self.rankingByChoosing['CoDual'] is True, the ranking-by-last-chossing 
was computed on the codual of self.
computeRankingByLastChoosingRelation(self, rankingByLastChoosing=None, Debug=False)
Renders the bipolar-valued relation obtained from
the self.rankingByLastChoosing result.
computeRankingCorrelation(self, ranking, Debug=False)
Renders the ordinal correlation K of a digraph instance
when compared with a given linear ranking of its actions
 
K = sum_{x != y} [ min( max(-self.relation(x,y)),other.relation(x,y), max(self.relation(x,y),-other.relation(x,y)) ]
 
K /= sum_{x!=y} [ min(abs(self.relation(x,y),abs(other.relation(x,y)) ]
 
.. note::
 
     Renders a tuple with at position 0 the actual bipolar correlation index
     and in position 1 the minimal determination level D of self and
     the other relation.
 
     D = sum_{x != y} min(abs(self.relation(x,y)),abs(other.relation(x,y)) / n(n-1)
 
     where n is the number of actions considered.
 
     The correlation index with a completely indeterminate relation
     is by convention 0.0 at determination level 0.0 .
computeRelationalStructure(self, Debug=False)
Renders the counted decomposition of the valued relations into
the following type of links:
gt '>', eq '=', lt '<', incomp '<>',
leq '<=', geq '>=', indeterm '?'
computeRubisChoice(self, Comments=False, _OldCoca=False, BrokenCocs=True, Threading=False, nbrOfCPUs=1)
Renders self.strictGoodChoices, self.nullChoices
self.strictBadChoices, self.nonRobustChoices.
 
.. warning::
    Changes in site the outranking digraph by
    adding or braking chordless odd outranking circuits.
computeRubyChoice(self, Comments=False, _OldCoca=False)
dummy for computeRubisChoice()
old versions compatibility.
computeShortestPathLengths(self, WeakPaths=False, Comments=False, Debug=False)
Renders a double dictionary with the directed distances, i.e. the shortest path lengths between all self.actions
 
Equals *None* if there does not exist a directed path between two actions.
 
*Source*: Claude Berge, *The Theory of Graphs*, Dover (2001) pp. 119, original in French Dunod (1958)
computeSingletonRanking(self, Comments=False, Debug=False)
Renders the sorted bipolar net determinatation of outrankingness
minus outrankedness credibilities of all singleton choices.
 
res = ((netdet,singleton,dom,absorb)+)
computeSize(self)
Renders the number of validated non reflexive arcs
computeSizeTransitiveClosure(self)
Renders the size of the transitive closure of a digraph.
computeSlaterOrder(self, isProbabilistic=False, seed=None, sampleSize=1000, Debug=False)
Reversed return from computeSlaterRanking method.
computeSlaterRanking(self, isProbabilistic=False, seed=None, sampleSize=1000, Debug=False)
Renders a ranking of the actions with minimal Slater index.
Return a tuple: slaterOrder, slaterIndex
computeSymmetryDegree(self, InPercents=False, Comments=False)
Renders the symmetry degree (Decimal) of the irreflexive part of a digraph.
 
.. note::
 
   Empty and indeterminate digraphs are considered to be symmetric.
computeTopologicalRanking(self, Debug=False)
Mimetic Wrapper of the topologicalSort() method.
computeTransitivityDegree(self, InPercents=False, Comments=False)
Renders the transitivity degree (Decimal) of a digraph.
 
.. note:: 
 
   An empty or indeterminate digraph is considered to be transitive.
computeUnrelatedPairs(self)
Renders a list of more or less unrelated pairs.
computeValuationLevels(self, choice=None, Debug=False)
renders the symmetric closure of the
apparent valuations levels of self
in an increasingly ordered list.
If parameter choice is given, the
computation is limited to the actions
of the choice.
computeValuationPercentages(self, choice, percentiles, withValues=False)
Parameters: choice and list of percentiles.
renders a series of percentages of the characteristics valuation of
the arcs in the digraph.
computeValuationPercentiles(self, choice, percentages, withValues=False)
Parameters: choice and list of percentages.
renders a series of quantiles of the characteristics valuation of
the arcs in the digraph.
computeValuationStatistics(self, Sampling=False, Comments=False)
Renders the mean and variance of the valuation
of the non reflexive pairs.
computeValuedRankingRelation(self, ranking)
Renders the valued relation characteristics compatible 
with the given linar ranking. Discordant charcateristics 
are set to the indeterminate value.
computeWeakCondorcetLosers(self)
Wrapper for weakCondorcetLosers().
computeWeakCondorcetWinners(self)
Wrapper for weakCondorcetWinners().
computeupdown1(self, s, S)
Help method for show_MIS_HB2 method.
fills self.newmisset, self.upmis, self.downmis.
computeupdown2(self, s, S)
Help method for show_MIS_HB1 method.
Fills self.newmisset, self.upmis, self.downmis.
computeupdown2irred(self, s, S)
Help method for show_MIS_HB1 method.
Fills self.newmisset, self.upmis, self.downmis.
condorcetLosers(self)
Renders the set of decision actions x such that
self.relation[x][y] < self.valuationdomain['med']
for all y != x.
condorcetWinners(self)
Renders the set of decision actions x such that
self.relation[x][y] > self.valuationdomain['med']
for all y != x.
contra(self, v)
Parameter: choice.
Renders the negation of a choice v characteristic's vector.
convertRelationToDecimal(self)
Converts the float valued self.relation in a decimal valued one.
convertValuation2Integer(self, InSite=True, Comments=False)
Converts the self.relation valuation to integer values by converting the Decimals to Fractions and multiply by the least commun multiple of the fraction denominators.
 
*Parameters*:
 
    - If *Insite* == False (True by default) the method returns a modified copy of self.relation without altering the original self.relation, otherwise self.relation and self.valuationdomain is modified.
convertValuationToDecimal(self)
Convert the float valuation limits to Decimals.
coveringIndex(self, choice, direction='out')
Renders the covering index of a given choice in a set of objects,
ie the minimum number of choice members that cover each
non selected object.
crispKDistance(self, digraph, Debug=False)
Renders the crisp Kendall distance between two bipolar valued
digraphs.
 
.. warning::
 
     Obsolete! Is replaced by the self.computeBipolarCorrelation(other, MedianCut=True) Digraph method
detectChordlessCircuits(self, Comments=False, Debug=False)
Detects a chordless circuit in a digraph.
Returns a Boolean
detectChordlessPath(self, Pk, n2, Comments=False, Debug=False)
New procedure from Agrum study April 2009
recursive chordless path extraction starting from path
Pk = [n2, ...., n1] and ending in node n2.
Optimized with marking of visited chordless P1s.
determinateness(self, vec, inPercent=True)
Renders the determinateness of a characteristic vector *vec* = 
[(r(x),x),(r(y),y), ...] of length *n* in valuationdomain [Min,Med,Max]:
 
*result* =  sum_x( abs(r(x)-Med) ) / ( n*(Max-Med) )
 
If inPercent, *result* shifted (+1) and reduced (/2) to [0,1] range.
digraph2Graph(self, valuationDomain={'min': -1, 'med': 0, 'max': 1}, Debug=False, ConjunctiveConversion=True)
Convert a Digraph instance to a Graph instance.
dneighbors(self, node)
Renders the set of dominated out-neighbors of a node.
domin(self, choice)
Renders the dominance degree of a choice.
dominantChoices(self, S)
Generates all minimal dominant choices of a bipolar valued digraph.
 
.. note::
 
     Initiate with S = self.actions.copy().
domirred(self, choice)
Renders the crips +irredundance degree of a choice.
domirredval(self, choice, relation)
Renders the valued +irredundance degree of a choice.
domirredx(self, choice, x)
Renders the crips +irredundance degree of node x in a choice.
domkernelrestrict(self, prekernel)
Parameter: dominant prekernel
Renders dominant prekernel restricted relation.
exportGraphViz(self, fileName=None, actionsSubset=None, bestChoice=set(), worstChoice=set(), firstChoice=set(), lastChoice=set(), Comments=True, graphType='png', pictureFormat=None, graphSize='7,7', relation=None, bgcolor='cornsilk')
export GraphViz dot file  for graph drawing filtering.
exportPrincipalImage(self, plotFileName=None, pictureFormat='pdf', bgcolor='cornsilk', fontcolor='red3', fontsize='0.75', Reduced=False, Colwise=False, tempDir='.', Comments=False)
Export as PDF (default) the principal projection of
the valued relation using the three principal eigen vectors.
 
Implemeted picture formats are: 
'pdf' (default), 'png', 'jpeg' and 'xfig'.
 
The background color is set by default to 'cornsilk'. 
 
Font size and color are set by default to 'red3', resp. '0.75'. 
 
When *Reduced==True*, the valued relation characeteristics are centered and reduced.
 
When *Colwise==True*, the column vectors of the adjacency table are used for the principal projection, otherwise the rows (default) are used. Has no incidence when the *Digraph* instance *self*  is symmetric. 
 
.. warning::
 
    The method, writing and reading temporary files: 
    tempCol.r and rotationCol.csv, resp. tempRow.r and rotationRow.csv,
    by default in the working directory (./),
    is hence not safe for multiprocessing programs, unless a
    temporary directory *tempDir* is provided.
flatChoice(self, ch, Debug=False)
Converts set or list ch recursively to a flat list of items.
forcedBestSingleChoice(self)
Renders the set of most determined outranking singletons in self.
gammaSets(self)
Renders the dictionary of neighborhoods {node: (dx,ax)}
with set *dx* gathering the dominated, and set *ax* gathering
the absorbed neighborhood.
generateAbsPreKernels(self)
Generate all absorbent prekernels from independent choices generator.
generateDomPreKernels(self)
Generate all dominant prekernels from independent choices generator.
htmlChoiceVector(self, ch, ChoiceVector=True, choiceType='good')
Show procedure for annotated bipolar choices.
inDegrees(self)
renders the median cut indegrees
inDegreesDistribution(self)
Renders the distribution of indegrees.
independentChoices(self, U)
Generator for all independent choices with neighborhoods of a bipolar valued digraph:
 
.. note::
 
       * Initiate with U = self.singletons().
       * Yields [(independent choice, domnb, absnb, indnb)].
inner_prod(self, v1, v2)
Parameters: two choice characteristic vectors
Renders the inner product of two characteristic vetors.
intstab(self, choice)
Computes the independence degree of a choice.
irreflex(self, mat)
Puts diagonal entries of mat to valuationdomain['min']
isAsymmetricIndeterminate(self, Debug=False)
Checks the self.relation for assymmetric indeterminateness!!
 
.. warning::
 
    The reflexive links are ignored !!
isComplete(self, Debug=False)
checks the completeness property of self.relation by checking
for the absence of a link between two actions!!
 
.. warning::
 
    The reflexive links are ignored !!
isCyclic(self, Debug=False)
checks the cyclicity of self.relation by checking
for a reflexive loop in its transitive closure-
 
.. warning::
 
     self.relation is supposed to be irreflexive !
isIntegerValued(self, Debug=False)
Checks whether the decimal valuation of self is integer-valued
be using the as_integer_ratio() method of a Decimal 
giving a tuple (numerator,denominator). If denominator == 1, the
number is an integer.
isOutrankingDigraph(self, Comments=True, Debug=False)
Checks the outranking digraph characteristic condition (3.3).
 
relation[x][y] + relation[y][x)[y] >= 0.0
 
.. warning::
 
    The reflexive links are ignored and the valuation must be bipolar !!
isStrictOutrankingDigraph(self, Comments=True, Debug=False)
Checks the strict outranking digraph characteristic condition (3.1).
 
-(relation[x][y] + relation[y][x]) <= 0.0 , x != y
 
.. warning::
 
    The reflexive links are ignored and the valuation must be bipolar !!
isSymmetric(self, Comments=False)
True if symmetry degree == 1.0.
isTransitive(self, Comments=False)
True if transitivity degree == 1.0.
isWeaklyComplete(self, Debug=False)
checks the weakly completeness property of self.relation by checking
for the absence of a link between two actions!!
 
.. warning::
 
    The reflexive links are ignored !!
iterateRankingByChoosing(self, Odd=False, CoDual=False, Comments=True, Debug=False, Limited=None)
Renders a ranking by choosing result when progressively eliminating
all chordless (odd only) circuits with rising valuation cut levels.
 
Parameters
    CoDual = False (default)/True
    Limited = proportion (in [0,1]) * (max - med) valuationdomain
kChoices(self, A, k)
Renders all choices of length k from set A
matmult2(self, m, v)
Parameters: digraph relation and choice characteristic vector
matrix multiply vector by inner production
meanDegree(self)
Renders the mean degree of self.
!!! self.size must be set previously !!!
meanLength(self, Oriented=False)
Renders the (by default non-oriented) mean neighbourhoor depth of self.
!!! self.order must be set previously !!!
minimalChoices(self, S)
Generates all dominant or absorbent choices of a bipolar
valued digraph.
 
.. note:
 
   * Initiate with S = (actions, dict of dominant or absorbent closed neighborhoods)
   * See showMinDom and showMinAbs methods.
minimalValuationLevelForCircuitsElimination(self, Odd=True, Debug=False, Comments=False)
renders the minimal valuation level <lambda> that eliminates all
self.circuitsList stored odd chordless circuits from self.
 
.. warning::
 
    The <lambda> level polarised may still contain newly appearing chordless odd circuits !
neighbourhoodCollection(self, Oriented=False, Potential=False)
Renders the neighbourhood.
neighbourhoodDepthDistribution(self, Oriented=False)
Renders the distribtion of neighbourhood depths.
notGammaSets(self)
Renders the dictionary of neighborhoods {node: (dx,ax)}
with set *dx* gathering the not dominated, and set *ax* gathering
the not absorbed neighborhood.
notaneighbors(self, node)
Renders the set of absorbed not in-neighbors of a node.
notdneighbors(self, node)
Renders the set of not dominated out-neighbors of a node.
outDegrees(self)
renders the median cut outdegrees
outDegreesDistribution(self)
Renders the distribution of outdegrees.
plusirredundant(self, U)
Generates all +irredundant choices of a digraph.
powerset(self, U)
Generates all subsets of a set.
readPerrinMisset(self, file='curd.dat')
read method for 0-1-char-coded MISs by default from the perrinMIS.c curd.dat result file.
readabsvector(self, x, relation)
Parameter: action x
absorbent in vector.
readdomvector(self, x, relation)
Parameter: action x
dominant out vector.
recodeValuation(self, newMin=-1.0, newMax=1.0, ndigits=4, Debug=False)
Recodes the characteristic valuation domain according
to the parameters given. 
 
*ndigits* indicates the number of decimal digits of the valuation.
relationFct(self, x, y)
wrapper for self.relation dictionary access to ensure interoperability
with the sparse and big outranking digraph implementation model.
save(self, fileName='tempdigraph', option=None, DecimalValuation=True, decDigits=2)
Persistent storage of a Digraph class instance in the form of
a python source code file
saveCSV(self, fileName='tempdigraph', Normalized=False, Dual=False, Converse=False, Diagonal=False, Debug=False)
Persistent storage of a Digraph class instance in the form of
a csv file.
saveXMCDA2(self, fileName='temp', fileExt='xmcda2', Comments=True, relationName='R', relationType='binary', category='random', subcategory='valued', author='digraphs Module (RB)', reference='saved from Python', valuationType='standard', digits=2, servingD3=False)
save digraph in XMCDA 2.0 format. Deprecated now.
savedre(self, fileName='temp')
save digraph in nauty format.
sharp(self, x, y)
Paramaters: choice characteristic values.
Renders the sharpest of two characteristic values x and y.
sharpvec(self, v, w)
Paramaters: choice characteristic vectors.
Renders the sharpest of two characteristic vectors v and w.
showActions(self)
presentation methods for digraphs actions
showAll(self)
Detailed show method for genuine digraphs.
showAttributes(self)
Prints out the attributes of self.
showAutomorphismGenerators(self)
Renders the generators of the automorphism group.
showBadChoices(self, Recompute=True)
Characteristic values for potentially bad choices.
showBestChoiceRecommendation(self, Verbose=False, Comments=True, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True)
Shows the RuBis best choice recommendation.
 
.. note::
 
    Computes by default the Rubis best choice recommendation on the corresponding strict (codual) outranking digraph.
 
    By default, with BrokenCocs=True, we brake all chordless circuits at their weakest determined ( abs(r(x>y)) + abs(r(y>x)) ) link.
 
    When BrokenCocs=False we proceed like follows:
 
    In case of chordless circuits, if supporting arcs are more credible
    than the reversed negating arcs, we collapse the circuits into hyper nodes.
    Inversely,  if supporting arcs are not more credible than the reversed negating arcs,
    we brake the circuits on their weakest arc.
 
Usage example:
 
>>> from outrankingDigraphs import *
>>> t = Random3ObjectivesPerformanceTableau(seed=5)
>>> g = BipolarOutrankingDigraph(t)
>>> g.showBestChoiceRecommendation()
***********************
RuBis Best Choice Recommendation (BCR)
(in decreasing order of determinateness)   
Credibility domain:  [-100.0, 100.0]
=== >> potential first choices
* choice              : ['a04', 'a14', 'a19', 'a20']
   independence        : 1.19
   dominance           : 4.76
   absorbency          : -59.52
   covering (%)        : 75.00
   determinateness (%) : 57.86
   - most credible action(s) = { 'a14': 23.81, 'a19': 11.90, 'a04': 2.38, 'a20': 1.19, }  
=== >> potential last choices 
* choice              : ['a03', 'a12', 'a17']
  independence        : 4.76
  dominance           : -76.19
  absorbency          : 4.76
  covering (%)        : 0.00
  determinateness (%) : 65.39
  - most credible action(s) = { 'a03': 38.10, 'a12': 13.10, 'a17': 4.76, }
Execution time: 0.024 seconds
*****************************
showChoiceVector(self, ch, choiceType='good', ChoiceVector=True)
Show procedure for annotated bipolar choices.
showChordlessCircuits(self, Recompute=False)
Show method for chordless circuits observed in a Digraph instance.
 
If previous computation is required, stores the detected circuits in self.circuitsList attribute.
showComponents(self)
Shows the list of connected components of the digraph instance.
showCorrelation(self, corr=None, ndigits=3)
Renders the valued ordinal correlation index, the crisp Kendall tau index and their epistemic determination degree.
showFirstChoiceRecommendation(self, Verbose=False, Comments=True, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True)
Shows the RuBis first choice recommendation.
 
.. note::
 
    Computes by default the Rubis first choice recommendation on the corresponding strict (codual) outranking digraph.
 
    By default, with BrokenCocs=True, we brake all chordless circuits at their weakest determined ( abs(r(x>y)) + abs(r(y>x)) ) link.
 
    When BrokenCocs=False we proceed like follows:
 
    In case of chordless circuits, if supporting arcs are more credible
    than the reversed negating arcs, we collapse the circuits into hyper nodes.
    Inversely,  if supporting arcs are not more credible than the reversed negating arcs,
    we brake the circuits on their weakest arc.
 
Usage example:
 
>>> from outrankingDigraphs import *
>>> t = Random3ObjectivesPerformanceTableau(seed=5)
>>> g = BipolarOutrankingDigraph(t)
>>> g.showFirstChoiceRecommendation()
***********************
RuBis First Choice Recommendation (BCR)
(in decreasing order of determinateness)   
Credibility domain:  [-100.0, 100.0]
=== >> potential first choices
* choice              : ['a04', 'a14', 'a19', 'a20']
   independence        : 1.19
   dominance           : 4.76
   absorbency          : -59.52
   covering (%)        : 75.00
   determinateness (%) : 57.86
   - most credible action(s) = { 'a14': 23.81, 'a19': 11.90, 'a04': 2.38, 'a20': 1.19, }  
=== >> potential last choices 
* choice              : ['a03', 'a12', 'a17']
  independence        : 4.76
  dominance           : -76.19
  absorbency          : 4.76
  covering (%)        : 0.00
  determinateness (%) : 65.39
  - most credible action(s) = { 'a03': 38.10, 'a12': 13.10, 'a17': 4.76, }
Execution time: 0.024 seconds
*****************************
showGoodChoices(self, Recompute=True)
Characteristic values for potentially good choices.
showHTMLBestChoiceRecommendation(self, pageTitle=None, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True, htmlFileName=None)
showHTMLRelationHeatmap(self, actionsList=None, rankingRule='NetFlows', colorLevels=7, tableTitle='Relation Heatmap', relationName='r(x S y)', ndigits=2, fromIndex=None, toIndex=None, htmlFileName=None)
Launches a browser window with the colored relation map of self.
 
See corresponding :py:class:`~digraphs.Digraph.showHTMLRelationMap` method.
 
The *colorLevels* parameter may be set to 3, 5, 7 (default) or 9.
 
When the *actionsList* parameter is *None* (default), the digraphs actions list may be ranked with the *rankingRule* parameter set to the 'Copeland' (default) or to the 'Netlows' ranking rule.
 
When the *htmlFileName* parameter is set to a string value 'xxx', a html file named 'xxx.html' will be generated in the current working directory. Otherwise, a temporary file named 'tmp*.html' will be generated there.
 
Example::
 
    >>> from outrankingDigraphs import *
    >>> t = RandomCBPerformanceTableau(numberOfActions=25,seed=1)
    >>> g = BipolarOutrankingDigraph(t,ndigits=2)
    >>> gcd = ~(-g)  # strict outranking relation
    >>> gcd.showHTMLRelationHeatmap(colorLevels=7,ndigits=2)
    
.. image:: relationHeatmap.png
   :alt: Browser view of a relation map
   :width: 600 px
   :align: center
showHTMLRelationMap(self, actionsList=None, rankingRule='Copeland', Colored=True, tableTitle='Relation Map', relationName='r(x S y)', symbols=['+', '&middot;', '&nbsp;', '&#150;', '&#151'], fromIndex=None, toIndex=None, htmlFileName=None)
Launches a browser window with the colored relation map of self.
See corresponding Digraph.showRelationMap() method.
 
When *htmlFileName* parameter is set to a string value, a html file
with that name will be stored in the current working directory.
 
By default, a temporary file named: tmp*.html will be generated
instead in the current working directory.
 
Example::
 
    >>> from outrankingDigraphs import *
    >>> t = RandomCBPerformanceTableau(numberOfActions=25,seed=1)
    >>> g = BipolarOutrankingDigraph(t,Normalized=True)
    >>> gcd = ~(-g)  # strict outranking relation
    >>> gcd.showHTMLRelationMap(rankingRule="NetFlows")
    
.. image:: relationMap.png
   :alt: Browser view of a relation map
   :width: 600 px
   :align: center
showHTMLRelationTable(self, actionsList=None, relation=None, IntegerValues=False, ndigits=2, Colored=True, tableTitle='Valued Adjacency Matrix', relationName='r(x S y)', ReflexiveTerms=False, htmlFileName=None, fromIndex=None, toIndex=None)
Launches a browser window with the colored relation table of self.
showMIS(self, withListing=True)
Prints all maximal independent choices:
    Result in self.misset.
showMIS_AH(self, withListing=True)
Prints all MIS using the Hertz method.
 
Result saved in self.hertzmisset.
showMIS_HB2(self, withListing=True)
Prints all MIS using the Hertz-Bisdorff method.
 
Result saved in self.newmisset.
showMIS_RB(self, withListing=True)
Prints all MIS using the Bisdorff method.
 
Result saved in self.newmisset.
showMIS_UD(self, withListing=True)
Prints all MIS using the Hertz-Bisdorff method.
 
Result saved in self.newmisset.
showMaxAbsIrred(self, withListing=True)
Computing maximal -irredundant choices:
    Result in self.absirset.
showMaxDomIrred(self, withListing=True)
Computing maximal +irredundant choices:
   Result in self.domirset.
showMinAbs(self, withListing=True)
Prints minimal absorbent choices:
    Result in self.absset.
showMinDom(self, withListing=True)
Prints all minimal dominant choices:
    Result in self.domset.
showNeighborhoods(self)
Lists the gamma and the notGamma function of self.
showOrbits(self, InChoices, withListing=True)
Prints the orbits of Choices along the automorphisms of
the Digraph instance.
 
Example Python session for computing the non isomorphic MISs from the 12-cycle graph:
 
>>> from digraphs import *
>>> c12 = CirculantDigraph(order=12,circulants=[1,-1])
>>> c12.automorphismGenerators()
...
  Permutations
  {'1': '1', '2': '12', '3': '11', '4': '10', '5': 
   '9', '6': '8', '7': '7', '8': '6', '9': '5', '10': 
   '4', '11': '3', '12': '2'}
  {'1': '2', '2': '1', '3': '12', '4': '11', '5': '10', 
   '6': '9', '7': '8', '8': '7', '9': '6', '10': '5', 
   '11': '4', '12': '3'}
  Reflections {}
>>> print('grpsize = ', c12.automorphismGroupSize)
  grpsize = 24
>>> c12.showMIS(withListing=False)
  *---  Maximal independent choices ---*
  number of solutions:  29
  cardinality distribution
  card.:  [0, 1, 2, 3, 4,  5,  6, 7, 8, 9, 10, 11, 12]
  freq.:  [0, 0, 0, 0, 3, 24,  2, 0, 0, 0,  0,  0,  0]
  Results in c12.misset
>>> c12.showOrbits(c12.misset,withListing=False)
...
  *---- Global result ----
  Number of MIS:  29
  Number of orbits :  4
  Labelled representatives:
  1: ['2','4','6','8','10','12']
  2: ['2','5','8','11']
  3: ['2','4','6','9','11']
  4: ['1','4','7','9','11']
  Symmetry vector
  stabilizer size: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, ...]
  frequency      : [0, 2, 0, 0, 0, 0, 0, 1, 0,  0,  0,  1, ...]
 
*Figure*: The symmetry axes of the non isomorphic MISs of the 12-cycle:
 
.. image:: c12.png
   :width: 400 px
   :align: center
   :alt: The 4 non isomorphic MIS of the 12-cycle graph
 
*Reference*: R. Bisdorff and J.L. Marichal (2008). Counting non-isomorphic maximal independent sets of the n-cycle graph. *Journal of Integer Sequences*, Vol. 11 Article 08.5.7 (`openly accessible here <https://www.cs.uwaterloo.ca/journals/JIS/VOL11/Marichal/marichal.html>`_)
showOrbitsFromFile(self, InFile, withListing=True)
Prints the orbits of Choices along the automorphisms of
the digraph self by reading in the 0-1 misset file format.
See the :py:func:`digraphs.Digraph.readPerrinMisset` method.
showPreKernels(self, withListing=True)
Printing dominant and absorbent preKernels:
    Result in self.dompreKernels and self.abspreKernels
showRankingByBestChoosing(self, rankingByBestChoosing=None)
A show method for self.rankinByBestChoosing result.
 
.. warning::
 
     The self.computeRankingByBestChoosing(CoDual=False/True) method instantiating the self.rankingByBestChoosing slot is pre-required !
showRankingByChoosing(self, rankingByChoosing=None, WithCoverCredibility=False)
A show method for self.rankinByChoosing result.
 
When parameter *WithCoverCredibility* is set to True, the credibility of outranking, respectively being outranked is indicated at each selection step. 
 
.. warning::
 
     The self.computeRankingByChoosing(CoDual=False/True) method instantiating the self.rankingByChoosing slot is pre-required !
showRankingByLastChoosing(self, rankingByLastChoosing=None, Debug=None)
A show method for self.rankinByChoosing result.
 
.. warning::
 
     The self.computeRankingByLastChoosing(CoDual=False/True) method instantiating the self.rankingByChoosing slot is pre-required !
showRelation(self)
prints the relation valuation in ##.## format.
showRelationMap(self, symbols=None, rankingRule='Copeland', fromIndex=None, toIndex=None, actionsList=None)
Prints on the console, in text map format, the location of
certainly validated and certainly invalidated outranking situations.
 
By default, symbols = {'max':'┬','positive': '+', 'median': ' ',
                       'negative': '-', 'min': '┴'}
 
The default ordering of the output is following the Copeland ranking rule
from best to worst actions. Further available ranking rule is the 'NetFlows' net flows rule.
 
 
Example::
 
    >>> from outrankingDigraphs import *
    >>> t = RandomCBPerformanceTableau(numberOfActions=25,seed=1)
    >>> g = BipolarOutrankingDigraph(t,Normalized=True)
    >>> gcd = ~(-g)  # strict outranking relation
    >>> gcd.showRelationMap(rankingRule="NetFlows")
     -   ++++++++  +++++┬+┬┬+
    - -   + +++++ ++┬+┬+++┬++
    ┴+  ┴ + ++  ++++┬+┬┬++┬++
    -   ++ - ++++-++++++┬++┬+
       - - - ++- ┬- + -+┬+-┬┬
    -----  -      -┬┬┬-+  -┬┬
    ----    --+-+++++++++++++
    -- --+- --++ ++ +++-┬+-┬┬
    ----  -  -+-- ++--+++++ +
    ----- ++- --- +---++++┬ +
    -- -- ---+ -++-+++-+ +-++
    -- --┴---+  + +-++-+ -  +
    ---- ┴---+-- ++--++++ - +
      --┴┴--  --- -  --+ --┬┬
     ---------+--+ ----- +-┬┬
    -┴---┴- ---+- + ---+++┬ +
    -┴┴--┴---+--- ++ -++--+++
    -----┴--- ---+-+- ++---+ 
    -┴┴--------------- --++┬ 
    --┴---------------- --+┬ 
    ┴--┴┴ -┴--┴┴-┴ --++  ++-+
    ----┴┴--------------- -  
    ┴┴┴----+-┴+┴---┴-+---+ ┴+
    ┴┴-┴┴┴-┴- - -┴┴---┴┴+ ┬ -
    ----┴┴-┴-----┴┴---  - -- 
    Ranking rule: NetFlows
    >>>
showRelationTable(self, Sorted=True, rankingRule=None, IntegerValues=False, actionsSubset=None, relation=None, ndigits=2, ReflexiveTerms=True, fromIndex=None, toIndex=None)
Prints the relation valuation in actions X actions table format.
Copeland and NetFlows rankings my be used.
showRubisBestChoiceRecommendation(self, **kwargs)
Dummy for backward portable showBestChoiceRecommendation().
showRubyChoice(self, Verbose=False, Comments=True, _OldCoca=True)
Dummy for showBestChoiceRecommendation()
needed for older versions compatibility.
showSingletonRanking(self, Comments=True, Debug=False)
Calls self.computeSingletonRanking(comments=True,Debug = False).
Renders and prints the sorted bipolar net determinatation of outrankingness
minus outrankedness credibilities of all singleton choices.
 
res = ((netdet,sigleton,dom,absorb)+)
showStatistics(self)
Computes digraph statistics like order, size and arc-density.
showdre(self)
Shows relation in nauty format.
singletons(self)
list of singletons and neighborhoods
[(singx1, +nx1, -nx1, not(+nx1 or -nx1)),.... ]
sizeSubGraph(self, choice)
Output: (size, undeterm,arcDensity).
Renders the arc density of the induced subgraph.
strongComponents(self, setPotential=False)
Renders the set of strong components of self.
symDegreesDistribution(self)
Renders the distribution of symmetric degrees.
topologicalSort(self, Debug=False)
If self is acyclic, adds topological sort number to each node of self
and renders ordered list of nodes. Otherwise renders None.
Source: M. Golumbic Algorithmic Graph heory and Perfect Graphs,
Annals Of Discrete Mathematics 57 2nd Ed. , Elsevier 2004, Algorithm 2.4 p.44.
weakAneighbors(self, node)
Renders the set of absorbed in-neighbors of a node.
weakCondorcetLosers(self)
Renders the set of decision actions x such that
self.relation[x][y] <= self.valuationdomain['med']
for all y != x.
weakCondorcetWinners(self)
Renders the set of decision actions x such that
self.relation[x][y] >= self.valuationdomain['med']
for all y != x.
weakDneighbors(self, node)
Renders the set of dominated out-neighbors of a node.
weakGammaSets(self)
Renders the dictionary of neighborhoods {node: (dx,ax)}
zoomValuation(self, zoomFactor=1.0)
Zooms in or out, depending on the value of the zoomFactor provided,
the bipolar valuation of a digraph.

Data descriptors inherited from Digraph:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class IndeterminateDigraph(Digraph)
    IndeterminateDigraph(other=None, nodes=None, order=5, valuationdomain=(-1, 1))
 
Parameters: order > 0; valuationdomain =(Min,Max).
Specialization of the general Digraph class for generating
temporary empty graphs of order 5 in {-1,0,1}.
 
 
Method resolution order:
IndeterminateDigraph
Digraph
builtins.object

Methods defined here:
__init__(self, other=None, nodes=None, order=5, valuationdomain=(-1, 1))
Initialize self.  See help(type(self)) for accurate signature.

Methods inherited from Digraph:
MISgen(self, S, I)
generator of maximal independent choices (voir Byskov 2004):
    * S ::= remaining nodes;
    * I ::= current independent choice
 
.. note::
 
        Inititalize: self.MISgen(self.actions.copy(),set())
__invert__(self)
Make the inverting operator ~self available for Digraph instances. 
 
Returns a ConverseDigraph instance of self.
__neg__(self)
Make the negation operator -self available for Digraph instances. 
 
Returns a DualDigraph instance of self.
__repr__(self)
Default presentation method for Digraph instances.
absirred(self, choice)
Renders the crips -irredundance degree of a choice.
absirredundant(self, U)
Generates all -irredundant choices of a digraph.
absirredval(self, choice, relation)
Renders the valued -irredundance degree of a choice.
absirredx(self, choice, x)
Computes the crips -irredundance degree of node x in a choice.
abskernelrestrict(self, prekernel)
Parameter: prekernel
Renders absorbent prekernel restricted relation.
absorb(self, choice)
Renders the absorbency degree of a choice.
absorbentChoices(self, S)
Generates all minimal absorbent choices of a bipolar valued digraph.
addValuationAttribute(self)
Adds the numpy valuation attribute
agglomerationDistribution(self)
Output: aggloCoeffDistribution, meanCoeff
Renders the distribution of agglomeration coefficients.
aneighbors(self, node)
Renders the set of absorbed in-neighbors of a node.
automorphismGenerators(self)
Adds automorphism group generators to the digraph instance.
 
.. note::
 
    Dependency: Uses the dreadnaut command from the nauty software package. See https://www3.cs.stonybrook.edu/~algorith/implement/nauty/implement.shtml
 
    On Ubuntu Linux:
      ...$ sudo apt-get install nauty
averageCoveringIndex(self, choice, direction='out')
Renders the average covering index of a given choice in a set of objects,
ie the average number of choice members that cover each
non selected object.
bipolarKCorrelation(self, digraph, Debug=False)
Renders the bipolar Kendall correlation between two bipolar valued
digraphs computed from the average valuation of the
XORDigraph(self,digraph) instance.
 
.. warning::
 
     Obsolete! Is replaced by the self.computeBipolarCorrelation(other) Digraph method
bipolarKDistance(self, digraph, Debug=False)
Renders the bipolar crisp Kendall distance between two bipolar valued
digraphs.
 
.. warning::
 
     Obsolete! Is replaced by the self.computeBipolarCorrelation(other, MedianCut=True) Digraph method
chordlessPaths(self, Pk, n2, Odd=False, Comments=False, Debug=False)
New procedure from Agrum study April 2009
recursive chordless path extraction starting from path
Pk = [n2, ...., n1] and ending in node n2.
Optimized with marking of visited chordless P1s.
circuitAverageCredibility(self, circ)
Renders the average linking credibility of a Chordless Circuit.
circuitCredibilities(self, circuit, Debug=False)
Renders the average linking credibilities and the minimal link of a Chordless Circuit.
circuitMaxCredibility(self, circ)
Renders the maximal linking credibility of a Chordless Circuit.
circuitMinCredibility(self, circ)
Renders the minimal linking credibility of a Chordless Circuit.
closeSymmetric(self, InSite=True)
Produces the symmetric closure of self.relation.
closeTransitive(self, Reverse=False, InSite=True, Comments=False)
Produces the transitive closure of self.relation
 
*Parameters*:
 
    - If *Reverse* == True (False default) all transitive links are dropped, otherwise all transitive links are closed with min[r(x,y),r(y,z)];
    - If *Insite* == False (True by default) the methods return a modified copy of self.relation without altering the original self.relation, otherwise self.relation is modified.
components(self)
Renders the list of connected components.
computeAllDensities(self, choice=None)
parameter: choice in self
renders six densitiy parameters:
arc density, double arc density,
single arc density, strict single arc density,
absence arc density, strict absence arc densitiy.
computeArrowRaynaudOrder(self)
Renders a linear ordering from worst to best of the actions following Arrow&Raynaud's rule.
computeArrowRaynaudRanking(self)
renders a linear ranking from best to worst of the actions following Arrow&Raynaud's rule.
computeAverageValuation(self)
Computes the bipolar average correlation between
self and the crisp complete digraph of same order
of the irreflexive and determined arcs of the digraph
computeBadChoices(self, Comments=False)
Computes characteristic values for potentially bad choices.
 
.. note::
 
     Returns a tuple with following content:
 
     [(0)-determ,(1)degirred,(2)degi,(3)degd,(4)dega,(5)str(choice),(6)absvec]
computeBadPirlotChoices(self, Comments=False)
Characteristic values for potentially bad choices
using the Pirlot's fixpoint algorithm.
computeBestChoiceRecommendation(self, Verbose=False, Comments=False, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True)
Sets self.bestChoice, self.bestChoiceData, self.worstChoice and self.worstChoiceData
with the showBestChoiceRecommendation method.
 
First and last choices data is the following:
[(0)-determ,(1)degirred,(2)degi,(3)degd,(4)dega,(5)str(choice),(6)domvec,(7)cover]
 
self.bestChoice = self.bestChoiceData[5]
self.worstChoice = self.worstChoiceData[5]
computeBipolarCorrelation(self, other, MedianCut=False, filterRelation=None, Debug=False)
obsolete: dummy replacement for Digraph.computeOrdinalCorrelation method
computeChordlessCircuits(self, Odd=False, Comments=False, Debug=False)
Renders the set of all chordless circuits detected in a digraph.
Result is stored in <self.circuitsList>
holding a possibly empty list of tuples with at position 0 the
list of adjacent actions of the circuit and at position 1
the set of actions in the stored circuit.
 
When *Odd* is True, only chordless circuits with an odd length
are collected.
computeChordlessCircuitsMP(self, Odd=False, Threading=False, nbrOfCPUs=None, startMethod=None, Comments=False, Debug=False)
Multiprocessing version of computeChordlessCircuits().
 
Renders the set of all chordless odd circuits detected in a digraph.
Result (possible empty list) stored in <self.circuitsList>
holding a possibly empty list tuples with at position 0 the
list of adjacent actions of the circuit and at position 1
the set of actions in the stored circuit.
Inspired by Dias, Castonguay, Longo, Jradi, Algorithmica (2015).
 
Returns a possibly empty list of tuples (circuit,frozenset(circuit)).
 
If Odd == True, only circuits of odd length are retained in the result.
computeCoSize(self)
Renders the number of non validated non reflexive arcs
computeConcentrationIndex(self, X, N)
Renders the Gini concentration index of the X serie.
N contains the partial frequencies.
Based on the triangle summation formula.
computeConcentrationIndexTrapez(self, X, N)
Renders the Gini concentration index of the X serie.
N contains the partial frequencies.
Based on the triangles summation formula.
computeCondorcetLosers(self)
Wrapper for condorcetLosers().
computeCondorcetWinners(self)
Wrapper for condorcetWinners().
computeCopelandOrder(self)
renders a linear ordering from worst to best of the actions following Arrow&Raynaud's rule.
computeCopelandRanking(self)
renders a linear ranking from best to worst of the actions following Arrow&Raynaud's rule.
computeCutLevelDensities(self, choice, level)
parameter: choice in self, robustness level
renders three robust densitiy parameters:
robust double arc density,
robust single arc density,
robust absence arc densitiy.
computeDensities(self, choice)
parameter: choice in self
renders the four densitiy parameters:
arc density, double arc density, single arc density, absence arc density.
computeDeterminateness(self, InPercents=False)
Computes the Kendalll distance of self
with the all median-valued indeterminate digraph of order n.
 
Return the average determination of the irreflexive part of the digraph.
 
*determination* = sum_(x,y) { abs[ r(xRy) - Med ] } / n(n-1)
 
If *InPercents* is True, returns the average determination in percentage of
(Max - Med) difference.
 
>>> from outrankingDigraphs import BipolarOutrankingDigraph
>>> from randomPerfTabs import Random3ObjectivesPerformanceTableau
>>> t = Random3ObjectivesPerformanceTableau(numberOfActions=7,numberOfCriteria=7,seed=101)
>>> g = BipolarOutrankingDigraph(t,Normalized=True)
>>> g
*------- Object instance description ------*
Instance class      : BipolarOutrankingDigraph
Instance name       : rel_random3ObjectivesPerfTab
Actions             : 7
Criteria            : 7
Size                : 27
Determinateness (%) : 65.67
Valuation domain    : [-1.00;1.00]
>>> print(g.computeDeterminateness())
0.3134920634920634920634920638
>>> print(g.computeDeterminateness(InPercents=True))
65.67460317460317460317460320
>>> g.recodeValuation(0,1)
>>> g
*------- Object instance description ------*
Instance class      : BipolarOutrankingDigraph
Instance name       : rel_random3ObjectivesPerfTab
Actions             : 7
Criteria            : 7
Size                : 27
Determinateness (%) : 65.67
Valuation domain    : [0.00;1.00]
>>> print(g.computeDeterminateness())
0.1567460317460317460317460318
>>> print(g.computeDeterminateness(InPercents=True))
65.67460317460317460317460320
computeDiameter(self, Oriented=True)
Renders the (by default oriented) diameter of the digraph instance
computeDigraphCentres(self, WeakDistances=False, Comments=False)
The centers of a digraph are the nodes with finite minimal shortes path lengths.
 
The maximal neighborhood distances are stored in *self.maximalNeighborhoodDistances*.
 
The corresponding digraph radius and diameter are stored respectively  in *self.radius* and *self.diameter*.
 
With *Comments* = True, all these results are printed out.
 
*Source*: Claude Berge, *The Theory of Graphs*, Dover (2001) pp. 119, original in French Dunod (1958)
computeDynamicProgrammingStages(self, source, sink, Debug=False)
Renders the discrete stages of the optimal substructure for
dynamic pogramming digrahs from a given source node 
to a given sink sink node.
 
Returns a list of list of action identifyers.
computeGoodChoiceVector(self, ker, Comments=False)
| Computing Characteristic values for dominant pre-kernels
| using the von Neumann dual fixoint equation
computeGoodChoices(self, Comments=False)
Computes characteristic values for potentially good choices.
 
..note::
 
     Return a tuple with following content:
 
     [(0)-determ,(1)degirred,(2)degi,(3)degd,(4)dega,(5)str(choice),(6)domvec,(7)cover]
computeGoodPirlotChoices(self, Comments=False)
Characteristic values for potentially good choices
using the Pirlot fixpoint algorithm.
computeIncomparabilityDegree(self, InPercents=False, Comments=False)
Renders the incomparability degree (Decimal), i.e. the relative number of symmetric indeterminate relations of the irreflexive part of a digraph.
computeKemenyIndex(self, otherRelation)
renders the Kemeny index of the self.relation
compared with a given crisp valued relation of a compatible
other digraph (same nodes or actions).
computeKemenyOrder(self, orderLimit=7, Debug=False)
Renders a ordering from worst to best of the actions with maximal Kemeny index.
Return a tuple: kemenyOrder (from worst to best), kemenyIndex
computeKemenyRanking(self, orderLimit=7, seed=None, sampleSize=1000, Debug=False)
Renders a ranking from best to worst of the actions with maximal Kemeny index.
 
.. note::
 
     Returns a tuple: kemenyRanking (from best to worst), kemenyIndex.
computeKernelVector(self, kernel, Initial=True, Comments=False)
| Computing Characteristic values for dominant pre-kernels
| using the von Neumann dual fixpoint equation
computeKohlerOrder(self)
Renders an ordering (worst to best) of the actions following Kohler's rule.
computeKohlerRanking(self)
Renders a ranking (best to worst) of the actions following Kohler's rule.
computeMaxHoleSize(self, Comments=False)
Renders the length of the largest chordless cycle
in the corresponding disjunctive undirected graph.
computeMeanInDegree(self)
Renders the mean indegree of self.
!!! self.size must be set previously !!!
computeMeanOutDegree(self)
Renders the mean degree of self.
!!! self.size must be set previously !!!
computeMeanSymDegree(self)
Renders the mean degree of self.
!!! self.size must be set previously !!!
computeMedianOutDegree(self)
Renders the median outdegree of self.
!!! self.size must be set previously !!!
computeMedianSymDegree(self)
Renders the median symmetric degree of self.
!!! self.size must be set previously !!!
computeMoreOrLessUnrelatedPairs(self)
Renders a list of more or less unrelated pairs.
computeNetFlowsOrder(self)
Renders an ordered list (from best to worst) of the actions
following the net flows ranking rule.
computeNetFlowsOrderDict(self)
Renders an ordered list (from worst to best) of the actions
following the net flows ranking rule.
computeNetFlowsRanking(self)
Renders an ordered list (from best to worst) of the actions
following the net flows ranking rule.
computeNetFlowsRankingDict(self)
Renders an ordered list (from best to worst) of the actions
following the net flows ranking rule.
computeODistance(self, op2, comments=False)
renders the squared normalized distance of
two digraph valuations.
 
.. note::
 
     op2 = digraphs of same order as self.
computeOrbit(self, choice, withListing=False)
renders the set of isomorph copies of a choice following
the automorphism of the digraph self
computeOrderCorrelation(self, order, Debug=False)
Renders the ordinal correlation K of a digraph instance
when compared with a given linear order (from worst to best) of its actions
 
K = sum_{x != y} [ min( max(-self.relation(x,y)),other.relation(x,y), max(self.relation(x,y),-other.relation(x,y)) ]
 
K /= sum_{x!=y} [ min(abs(self.relation(x,y),abs(other.relation(x,y)) ]
 
.. note::
 
     Renders a dictionary with the key 'correlation' containing the actual bipolar correlation index and the key 'determination' containing the minimal determination level D of self and the other relation.
 
     D = sum_{x != y} min(abs(self.relation(x,y)),abs(other.relation(x,y)) / n(n-1)
 
     where n is the number of actions considered.
 
     The correlation index with a completely indeterminate relation
     is by convention 0.0 at determination level 0.0 .
 
.. warning::
 
     self must be a normalized outranking digraph instance !
computeOrdinalCorrelation(self, other, MedianCut=False, filterRelation=None, Debug=False)
Renders the bipolar correlation K of a
self.relation when compared
with a given compatible (same actions set)) digraph or
a [-1,1] valued compatible relation (same actions set).
 
If MedianCut=True, the correlation is computed on the median polarized relations.
 
If filterRelation is not None, the correlation is computed on the partial domain corresponding to the determined part of the filter relation.
 
.. warning::
 
     Notice that the 'other' relation and/or the 'filterRelation',
     the case given, must both be normalized, ie [-1,1]-valued !
 
K = sum_{x != y} [ min( max(-self.relation[x][y]),other.relation[x][y]), max(self.relation[x][y],-other.relation[x][y]) ]
 
K /= sum_{x!=y} [ min(abs(self.relation[x][y]),abs(other.relation[x][y])) ]
 
.. note::
 
     Renders a tuple with at position 0 the actual bipolar correlation index
     and in position 1 the minimal determination level D of self and
     the other relation.
 
     D = sum_{x != y} min(abs(self.relation[x][y]),abs(other.relation[x][y])) / n(n-1)
 
     where n is the number of actions considered.
 
     The correlation index with a completely indeterminate relation
     is by convention 0.0 at determination level 0.0 .
computeOrdinalCorrelationMP(self, other, MedianCut=False, Threading=False, nbrOfCPUs=None, startMethod=None, Comments=False, Debug=False)
Multi processing version of the digraphs.computeOrdinalCorrelation() method.
 
.. note::
     The relation filtering and the MedinaCut option are not implemented in the MP version.
computePairwiseClusterComparison(self, K1, K2, Debug=False)
Computes the pairwise cluster comparison credibility vector
from bipolar-valued digraph g. with K1 and K2 disjoint
lists of action keys from g actions disctionary.
Returns the dictionary
{'I': Decimal(),'P+':Decimal(),'P-':Decimal(),'R' :Decimal()}
where one and only one item is strictly positive.
computePreKernels(self)
computing dominant and absorbent preKernels:
    Result in self.dompreKernels and self.abspreKernels
computePreRankingRelation(self, preRanking, Normalized=True, Debug=False)
Renders the bipolar-valued relation obtained from
a given preRanking in decreasing levels (list of lists) result.
computePreorderRelation(self, preorder, Normalized=True, Debug=False)
Renders the bipolar-valued relation obtained from
a given preordering in increasing levels (list of lists) result.
computePrincipalOrder(self, Colwise=False, Comments=False)
Rendesr an ordering from wrost to best of the decision actions.
computePrincipalRanking(self, Colwise=False, Comments=False)
Rendesr a ranking from best to worst of the decision actions.
computePrincipalScores(self, plotFileName=None, Colwise=False, imageType=None, tempDir=None, bgcolor='cornsilk', Comments=False, Debug=False)
Renders a ordered list of the first principal eigenvector of the covariance of the valued outdegrees of self.
 
.. note::
 
   The method, relying on writing and reading temporary files by default in a temporary directory is threading and multiprocessing safe !
   (see Digraph.exportPrincipalImage method)
computePrudentBetaLevel(self, Debug=False)
computes alpha, ie the lowest valuation level, for which the
bipolarly polarised digraph doesn't contain a chordless circuit.
computeRankingByBestChoosing(self, CoDual=False, Debug=False)
Computes a weak preordering of the self.actions by recursive
best choice elagations.
 
Stores in self.rankingByBestChoosing['result'] a list of (P+,bestChoice) tuples
where P+ gives the best choice complement outranking
average valuation via the computePairwiseClusterComparison
method.
 
If self.rankingByBestChoosing['CoDual'] is True, 
the ranking-by-choosing was computed on the codual of self.
computeRankingByBestChoosingRelation(self, rankingByBestChoosing=None, Debug=False)
Renders the bipolar-valued relation obtained from
the self.rankingByBestChoosing result.
computeRankingByChoosing(self, actionsSubset=None, Debug=False, CoDual=False)
Computes a weak preordring of the self.actions by iterating
jointly first and last choice elagations.
 
Stores in self.rankingByChoosing['result'] a list of ((P+,bestChoice),(P-,worstChoice)) pairs
where P+ (resp. P-) gives the best (resp. worst) choice complement outranking
(resp. outranked) average valuation via the computePairwiseClusterComparison
method.
 
If self.rankingByChoosing['CoDual'] is True, the ranking-by-choosing was computed on the codual of self.
computeRankingByChoosingRelation(self, rankingByChoosing=None, actionsSubset=None, Debug=False)
Renders the bipolar-valued relation obtained from
the self.rankingByChoosing result.
computeRankingByLastChoosing(self, CoDual=False, Debug=False)
Computes a weak preordring of the self.actions by iterating
worst choice elagations.
 
Stores in self.rankingByLastChoosing['result'] a list of (P-,worstChoice) pairs
where P- gives the worst choice complement outranked
average valuation via the computePairwiseClusterComparison
method.
 
If self.rankingByChoosing['CoDual'] is True, the ranking-by-last-chossing 
was computed on the codual of self.
computeRankingByLastChoosingRelation(self, rankingByLastChoosing=None, Debug=False)
Renders the bipolar-valued relation obtained from
the self.rankingByLastChoosing result.
computeRankingCorrelation(self, ranking, Debug=False)
Renders the ordinal correlation K of a digraph instance
when compared with a given linear ranking of its actions
 
K = sum_{x != y} [ min( max(-self.relation(x,y)),other.relation(x,y), max(self.relation(x,y),-other.relation(x,y)) ]
 
K /= sum_{x!=y} [ min(abs(self.relation(x,y),abs(other.relation(x,y)) ]
 
.. note::
 
     Renders a tuple with at position 0 the actual bipolar correlation index
     and in position 1 the minimal determination level D of self and
     the other relation.
 
     D = sum_{x != y} min(abs(self.relation(x,y)),abs(other.relation(x,y)) / n(n-1)
 
     where n is the number of actions considered.
 
     The correlation index with a completely indeterminate relation
     is by convention 0.0 at determination level 0.0 .
computeRelationalStructure(self, Debug=False)
Renders the counted decomposition of the valued relations into
the following type of links:
gt '>', eq '=', lt '<', incomp '<>',
leq '<=', geq '>=', indeterm '?'
computeRubisChoice(self, Comments=False, _OldCoca=False, BrokenCocs=True, Threading=False, nbrOfCPUs=1)
Renders self.strictGoodChoices, self.nullChoices
self.strictBadChoices, self.nonRobustChoices.
 
.. warning::
    Changes in site the outranking digraph by
    adding or braking chordless odd outranking circuits.
computeRubyChoice(self, Comments=False, _OldCoca=False)
dummy for computeRubisChoice()
old versions compatibility.
computeShortestPathLengths(self, WeakPaths=False, Comments=False, Debug=False)
Renders a double dictionary with the directed distances, i.e. the shortest path lengths between all self.actions
 
Equals *None* if there does not exist a directed path between two actions.
 
*Source*: Claude Berge, *The Theory of Graphs*, Dover (2001) pp. 119, original in French Dunod (1958)
computeSingletonRanking(self, Comments=False, Debug=False)
Renders the sorted bipolar net determinatation of outrankingness
minus outrankedness credibilities of all singleton choices.
 
res = ((netdet,singleton,dom,absorb)+)
computeSize(self)
Renders the number of validated non reflexive arcs
computeSizeTransitiveClosure(self)
Renders the size of the transitive closure of a digraph.
computeSlaterOrder(self, isProbabilistic=False, seed=None, sampleSize=1000, Debug=False)
Reversed return from computeSlaterRanking method.
computeSlaterRanking(self, isProbabilistic=False, seed=None, sampleSize=1000, Debug=False)
Renders a ranking of the actions with minimal Slater index.
Return a tuple: slaterOrder, slaterIndex
computeSymmetryDegree(self, InPercents=False, Comments=False)
Renders the symmetry degree (Decimal) of the irreflexive part of a digraph.
 
.. note::
 
   Empty and indeterminate digraphs are considered to be symmetric.
computeTopologicalRanking(self, Debug=False)
Mimetic Wrapper of the topologicalSort() method.
computeTransitivityDegree(self, InPercents=False, Comments=False)
Renders the transitivity degree (Decimal) of a digraph.
 
.. note:: 
 
   An empty or indeterminate digraph is considered to be transitive.
computeUnrelatedPairs(self)
Renders a list of more or less unrelated pairs.
computeValuationLevels(self, choice=None, Debug=False)
renders the symmetric closure of the
apparent valuations levels of self
in an increasingly ordered list.
If parameter choice is given, the
computation is limited to the actions
of the choice.
computeValuationPercentages(self, choice, percentiles, withValues=False)
Parameters: choice and list of percentiles.
renders a series of percentages of the characteristics valuation of
the arcs in the digraph.
computeValuationPercentiles(self, choice, percentages, withValues=False)
Parameters: choice and list of percentages.
renders a series of quantiles of the characteristics valuation of
the arcs in the digraph.
computeValuationStatistics(self, Sampling=False, Comments=False)
Renders the mean and variance of the valuation
of the non reflexive pairs.
computeValuedRankingRelation(self, ranking)
Renders the valued relation characteristics compatible 
with the given linar ranking. Discordant charcateristics 
are set to the indeterminate value.
computeWeakCondorcetLosers(self)
Wrapper for weakCondorcetLosers().
computeWeakCondorcetWinners(self)
Wrapper for weakCondorcetWinners().
computeupdown1(self, s, S)
Help method for show_MIS_HB2 method.
fills self.newmisset, self.upmis, self.downmis.
computeupdown2(self, s, S)
Help method for show_MIS_HB1 method.
Fills self.newmisset, self.upmis, self.downmis.
computeupdown2irred(self, s, S)
Help method for show_MIS_HB1 method.
Fills self.newmisset, self.upmis, self.downmis.
condorcetLosers(self)
Renders the set of decision actions x such that
self.relation[x][y] < self.valuationdomain['med']
for all y != x.
condorcetWinners(self)
Renders the set of decision actions x such that
self.relation[x][y] > self.valuationdomain['med']
for all y != x.
contra(self, v)
Parameter: choice.
Renders the negation of a choice v characteristic's vector.
convertRelationToDecimal(self)
Converts the float valued self.relation in a decimal valued one.
convertValuation2Integer(self, InSite=True, Comments=False)
Converts the self.relation valuation to integer values by converting the Decimals to Fractions and multiply by the least commun multiple of the fraction denominators.
 
*Parameters*:
 
    - If *Insite* == False (True by default) the method returns a modified copy of self.relation without altering the original self.relation, otherwise self.relation and self.valuationdomain is modified.
convertValuationToDecimal(self)
Convert the float valuation limits to Decimals.
coveringIndex(self, choice, direction='out')
Renders the covering index of a given choice in a set of objects,
ie the minimum number of choice members that cover each
non selected object.
crispKDistance(self, digraph, Debug=False)
Renders the crisp Kendall distance between two bipolar valued
digraphs.
 
.. warning::
 
     Obsolete! Is replaced by the self.computeBipolarCorrelation(other, MedianCut=True) Digraph method
detectChordlessCircuits(self, Comments=False, Debug=False)
Detects a chordless circuit in a digraph.
Returns a Boolean
detectChordlessPath(self, Pk, n2, Comments=False, Debug=False)
New procedure from Agrum study April 2009
recursive chordless path extraction starting from path
Pk = [n2, ...., n1] and ending in node n2.
Optimized with marking of visited chordless P1s.
determinateness(self, vec, inPercent=True)
Renders the determinateness of a characteristic vector *vec* = 
[(r(x),x),(r(y),y), ...] of length *n* in valuationdomain [Min,Med,Max]:
 
*result* =  sum_x( abs(r(x)-Med) ) / ( n*(Max-Med) )
 
If inPercent, *result* shifted (+1) and reduced (/2) to [0,1] range.
digraph2Graph(self, valuationDomain={'min': -1, 'med': 0, 'max': 1}, Debug=False, ConjunctiveConversion=True)
Convert a Digraph instance to a Graph instance.
dneighbors(self, node)
Renders the set of dominated out-neighbors of a node.
domin(self, choice)
Renders the dominance degree of a choice.
dominantChoices(self, S)
Generates all minimal dominant choices of a bipolar valued digraph.
 
.. note::
 
     Initiate with S = self.actions.copy().
domirred(self, choice)
Renders the crips +irredundance degree of a choice.
domirredval(self, choice, relation)
Renders the valued +irredundance degree of a choice.
domirredx(self, choice, x)
Renders the crips +irredundance degree of node x in a choice.
domkernelrestrict(self, prekernel)
Parameter: dominant prekernel
Renders dominant prekernel restricted relation.
exportGraphViz(self, fileName=None, actionsSubset=None, bestChoice=set(), worstChoice=set(), firstChoice=set(), lastChoice=set(), Comments=True, graphType='png', pictureFormat=None, graphSize='7,7', relation=None, bgcolor='cornsilk')
export GraphViz dot file  for graph drawing filtering.
exportPrincipalImage(self, plotFileName=None, pictureFormat='pdf', bgcolor='cornsilk', fontcolor='red3', fontsize='0.75', Reduced=False, Colwise=False, tempDir='.', Comments=False)
Export as PDF (default) the principal projection of
the valued relation using the three principal eigen vectors.
 
Implemeted picture formats are: 
'pdf' (default), 'png', 'jpeg' and 'xfig'.
 
The background color is set by default to 'cornsilk'. 
 
Font size and color are set by default to 'red3', resp. '0.75'. 
 
When *Reduced==True*, the valued relation characeteristics are centered and reduced.
 
When *Colwise==True*, the column vectors of the adjacency table are used for the principal projection, otherwise the rows (default) are used. Has no incidence when the *Digraph* instance *self*  is symmetric. 
 
.. warning::
 
    The method, writing and reading temporary files: 
    tempCol.r and rotationCol.csv, resp. tempRow.r and rotationRow.csv,
    by default in the working directory (./),
    is hence not safe for multiprocessing programs, unless a
    temporary directory *tempDir* is provided.
flatChoice(self, ch, Debug=False)
Converts set or list ch recursively to a flat list of items.
forcedBestSingleChoice(self)
Renders the set of most determined outranking singletons in self.
gammaSets(self)
Renders the dictionary of neighborhoods {node: (dx,ax)}
with set *dx* gathering the dominated, and set *ax* gathering
the absorbed neighborhood.
generateAbsPreKernels(self)
Generate all absorbent prekernels from independent choices generator.
generateDomPreKernels(self)
Generate all dominant prekernels from independent choices generator.
htmlChoiceVector(self, ch, ChoiceVector=True, choiceType='good')
Show procedure for annotated bipolar choices.
inDegrees(self)
renders the median cut indegrees
inDegreesDistribution(self)
Renders the distribution of indegrees.
independentChoices(self, U)
Generator for all independent choices with neighborhoods of a bipolar valued digraph:
 
.. note::
 
       * Initiate with U = self.singletons().
       * Yields [(independent choice, domnb, absnb, indnb)].
inner_prod(self, v1, v2)
Parameters: two choice characteristic vectors
Renders the inner product of two characteristic vetors.
intstab(self, choice)
Computes the independence degree of a choice.
irreflex(self, mat)
Puts diagonal entries of mat to valuationdomain['min']
isAsymmetricIndeterminate(self, Debug=False)
Checks the self.relation for assymmetric indeterminateness!!
 
.. warning::
 
    The reflexive links are ignored !!
isComplete(self, Debug=False)
checks the completeness property of self.relation by checking
for the absence of a link between two actions!!
 
.. warning::
 
    The reflexive links are ignored !!
isCyclic(self, Debug=False)
checks the cyclicity of self.relation by checking
for a reflexive loop in its transitive closure-
 
.. warning::
 
     self.relation is supposed to be irreflexive !
isIntegerValued(self, Debug=False)
Checks whether the decimal valuation of self is integer-valued
be using the as_integer_ratio() method of a Decimal 
giving a tuple (numerator,denominator). If denominator == 1, the
number is an integer.
isOutrankingDigraph(self, Comments=True, Debug=False)
Checks the outranking digraph characteristic condition (3.3).
 
relation[x][y] + relation[y][x)[y] >= 0.0
 
.. warning::
 
    The reflexive links are ignored and the valuation must be bipolar !!
isStrictOutrankingDigraph(self, Comments=True, Debug=False)
Checks the strict outranking digraph characteristic condition (3.1).
 
-(relation[x][y] + relation[y][x]) <= 0.0 , x != y
 
.. warning::
 
    The reflexive links are ignored and the valuation must be bipolar !!
isSymmetric(self, Comments=False)
True if symmetry degree == 1.0.
isTransitive(self, Comments=False)
True if transitivity degree == 1.0.
isWeaklyComplete(self, Debug=False)
checks the weakly completeness property of self.relation by checking
for the absence of a link between two actions!!
 
.. warning::
 
    The reflexive links are ignored !!
iterateRankingByChoosing(self, Odd=False, CoDual=False, Comments=True, Debug=False, Limited=None)
Renders a ranking by choosing result when progressively eliminating
all chordless (odd only) circuits with rising valuation cut levels.
 
Parameters
    CoDual = False (default)/True
    Limited = proportion (in [0,1]) * (max - med) valuationdomain
kChoices(self, A, k)
Renders all choices of length k from set A
matmult2(self, m, v)
Parameters: digraph relation and choice characteristic vector
matrix multiply vector by inner production
meanDegree(self)
Renders the mean degree of self.
!!! self.size must be set previously !!!
meanLength(self, Oriented=False)
Renders the (by default non-oriented) mean neighbourhoor depth of self.
!!! self.order must be set previously !!!
minimalChoices(self, S)
Generates all dominant or absorbent choices of a bipolar
valued digraph.
 
.. note:
 
   * Initiate with S = (actions, dict of dominant or absorbent closed neighborhoods)
   * See showMinDom and showMinAbs methods.
minimalValuationLevelForCircuitsElimination(self, Odd=True, Debug=False, Comments=False)
renders the minimal valuation level <lambda> that eliminates all
self.circuitsList stored odd chordless circuits from self.
 
.. warning::
 
    The <lambda> level polarised may still contain newly appearing chordless odd circuits !
neighbourhoodCollection(self, Oriented=False, Potential=False)
Renders the neighbourhood.
neighbourhoodDepthDistribution(self, Oriented=False)
Renders the distribtion of neighbourhood depths.
notGammaSets(self)
Renders the dictionary of neighborhoods {node: (dx,ax)}
with set *dx* gathering the not dominated, and set *ax* gathering
the not absorbed neighborhood.
notaneighbors(self, node)
Renders the set of absorbed not in-neighbors of a node.
notdneighbors(self, node)
Renders the set of not dominated out-neighbors of a node.
outDegrees(self)
renders the median cut outdegrees
outDegreesDistribution(self)
Renders the distribution of outdegrees.
plusirredundant(self, U)
Generates all +irredundant choices of a digraph.
powerset(self, U)
Generates all subsets of a set.
readPerrinMisset(self, file='curd.dat')
read method for 0-1-char-coded MISs by default from the perrinMIS.c curd.dat result file.
readabsvector(self, x, relation)
Parameter: action x
absorbent in vector.
readdomvector(self, x, relation)
Parameter: action x
dominant out vector.
recodeValuation(self, newMin=-1.0, newMax=1.0, ndigits=4, Debug=False)
Recodes the characteristic valuation domain according
to the parameters given. 
 
*ndigits* indicates the number of decimal digits of the valuation.
relationFct(self, x, y)
wrapper for self.relation dictionary access to ensure interoperability
with the sparse and big outranking digraph implementation model.
save(self, fileName='tempdigraph', option=None, DecimalValuation=True, decDigits=2)
Persistent storage of a Digraph class instance in the form of
a python source code file
saveCSV(self, fileName='tempdigraph', Normalized=False, Dual=False, Converse=False, Diagonal=False, Debug=False)
Persistent storage of a Digraph class instance in the form of
a csv file.
saveXMCDA2(self, fileName='temp', fileExt='xmcda2', Comments=True, relationName='R', relationType='binary', category='random', subcategory='valued', author='digraphs Module (RB)', reference='saved from Python', valuationType='standard', digits=2, servingD3=False)
save digraph in XMCDA 2.0 format. Deprecated now.
savedre(self, fileName='temp')
save digraph in nauty format.
sharp(self, x, y)
Paramaters: choice characteristic values.
Renders the sharpest of two characteristic values x and y.
sharpvec(self, v, w)
Paramaters: choice characteristic vectors.
Renders the sharpest of two characteristic vectors v and w.
showActions(self)
presentation methods for digraphs actions
showAll(self)
Detailed show method for genuine digraphs.
showAttributes(self)
Prints out the attributes of self.
showAutomorphismGenerators(self)
Renders the generators of the automorphism group.
showBadChoices(self, Recompute=True)
Characteristic values for potentially bad choices.
showBestChoiceRecommendation(self, Verbose=False, Comments=True, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True)
Shows the RuBis best choice recommendation.
 
.. note::
 
    Computes by default the Rubis best choice recommendation on the corresponding strict (codual) outranking digraph.
 
    By default, with BrokenCocs=True, we brake all chordless circuits at their weakest determined ( abs(r(x>y)) + abs(r(y>x)) ) link.
 
    When BrokenCocs=False we proceed like follows:
 
    In case of chordless circuits, if supporting arcs are more credible
    than the reversed negating arcs, we collapse the circuits into hyper nodes.
    Inversely,  if supporting arcs are not more credible than the reversed negating arcs,
    we brake the circuits on their weakest arc.
 
Usage example:
 
>>> from outrankingDigraphs import *
>>> t = Random3ObjectivesPerformanceTableau(seed=5)
>>> g = BipolarOutrankingDigraph(t)
>>> g.showBestChoiceRecommendation()
***********************
RuBis Best Choice Recommendation (BCR)
(in decreasing order of determinateness)   
Credibility domain:  [-100.0, 100.0]
=== >> potential first choices
* choice              : ['a04', 'a14', 'a19', 'a20']
   independence        : 1.19
   dominance           : 4.76
   absorbency          : -59.52
   covering (%)        : 75.00
   determinateness (%) : 57.86
   - most credible action(s) = { 'a14': 23.81, 'a19': 11.90, 'a04': 2.38, 'a20': 1.19, }  
=== >> potential last choices 
* choice              : ['a03', 'a12', 'a17']
  independence        : 4.76
  dominance           : -76.19
  absorbency          : 4.76
  covering (%)        : 0.00
  determinateness (%) : 65.39
  - most credible action(s) = { 'a03': 38.10, 'a12': 13.10, 'a17': 4.76, }
Execution time: 0.024 seconds
*****************************
showChoiceVector(self, ch, choiceType='good', ChoiceVector=True)
Show procedure for annotated bipolar choices.
showChordlessCircuits(self, Recompute=False)
Show method for chordless circuits observed in a Digraph instance.
 
If previous computation is required, stores the detected circuits in self.circuitsList attribute.
showComponents(self)
Shows the list of connected components of the digraph instance.
showCorrelation(self, corr=None, ndigits=3)
Renders the valued ordinal correlation index, the crisp Kendall tau index and their epistemic determination degree.
showFirstChoiceRecommendation(self, Verbose=False, Comments=True, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True)
Shows the RuBis first choice recommendation.
 
.. note::
 
    Computes by default the Rubis first choice recommendation on the corresponding strict (codual) outranking digraph.
 
    By default, with BrokenCocs=True, we brake all chordless circuits at their weakest determined ( abs(r(x>y)) + abs(r(y>x)) ) link.
 
    When BrokenCocs=False we proceed like follows:
 
    In case of chordless circuits, if supporting arcs are more credible
    than the reversed negating arcs, we collapse the circuits into hyper nodes.
    Inversely,  if supporting arcs are not more credible than the reversed negating arcs,
    we brake the circuits on their weakest arc.
 
Usage example:
 
>>> from outrankingDigraphs import *
>>> t = Random3ObjectivesPerformanceTableau(seed=5)
>>> g = BipolarOutrankingDigraph(t)
>>> g.showFirstChoiceRecommendation()
***********************
RuBis First Choice Recommendation (BCR)
(in decreasing order of determinateness)   
Credibility domain:  [-100.0, 100.0]
=== >> potential first choices
* choice              : ['a04', 'a14', 'a19', 'a20']
   independence        : 1.19
   dominance           : 4.76
   absorbency          : -59.52
   covering (%)        : 75.00
   determinateness (%) : 57.86
   - most credible action(s) = { 'a14': 23.81, 'a19': 11.90, 'a04': 2.38, 'a20': 1.19, }  
=== >> potential last choices 
* choice              : ['a03', 'a12', 'a17']
  independence        : 4.76
  dominance           : -76.19
  absorbency          : 4.76
  covering (%)        : 0.00
  determinateness (%) : 65.39
  - most credible action(s) = { 'a03': 38.10, 'a12': 13.10, 'a17': 4.76, }
Execution time: 0.024 seconds
*****************************
showGoodChoices(self, Recompute=True)
Characteristic values for potentially good choices.
showHTMLBestChoiceRecommendation(self, pageTitle=None, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True, htmlFileName=None)
showHTMLRelationHeatmap(self, actionsList=None, rankingRule='NetFlows', colorLevels=7, tableTitle='Relation Heatmap', relationName='r(x S y)', ndigits=2, fromIndex=None, toIndex=None, htmlFileName=None)
Launches a browser window with the colored relation map of self.
 
See corresponding :py:class:`~digraphs.Digraph.showHTMLRelationMap` method.
 
The *colorLevels* parameter may be set to 3, 5, 7 (default) or 9.
 
When the *actionsList* parameter is *None* (default), the digraphs actions list may be ranked with the *rankingRule* parameter set to the 'Copeland' (default) or to the 'Netlows' ranking rule.
 
When the *htmlFileName* parameter is set to a string value 'xxx', a html file named 'xxx.html' will be generated in the current working directory. Otherwise, a temporary file named 'tmp*.html' will be generated there.
 
Example::
 
    >>> from outrankingDigraphs import *
    >>> t = RandomCBPerformanceTableau(numberOfActions=25,seed=1)
    >>> g = BipolarOutrankingDigraph(t,ndigits=2)
    >>> gcd = ~(-g)  # strict outranking relation
    >>> gcd.showHTMLRelationHeatmap(colorLevels=7,ndigits=2)
    
.. image:: relationHeatmap.png
   :alt: Browser view of a relation map
   :width: 600 px
   :align: center
showHTMLRelationMap(self, actionsList=None, rankingRule='Copeland', Colored=True, tableTitle='Relation Map', relationName='r(x S y)', symbols=['+', '&middot;', '&nbsp;', '&#150;', '&#151'], fromIndex=None, toIndex=None, htmlFileName=None)
Launches a browser window with the colored relation map of self.
See corresponding Digraph.showRelationMap() method.
 
When *htmlFileName* parameter is set to a string value, a html file
with that name will be stored in the current working directory.
 
By default, a temporary file named: tmp*.html will be generated
instead in the current working directory.
 
Example::
 
    >>> from outrankingDigraphs import *
    >>> t = RandomCBPerformanceTableau(numberOfActions=25,seed=1)
    >>> g = BipolarOutrankingDigraph(t,Normalized=True)
    >>> gcd = ~(-g)  # strict outranking relation
    >>> gcd.showHTMLRelationMap(rankingRule="NetFlows")
    
.. image:: relationMap.png
   :alt: Browser view of a relation map
   :width: 600 px
   :align: center
showHTMLRelationTable(self, actionsList=None, relation=None, IntegerValues=False, ndigits=2, Colored=True, tableTitle='Valued Adjacency Matrix', relationName='r(x S y)', ReflexiveTerms=False, htmlFileName=None, fromIndex=None, toIndex=None)
Launches a browser window with the colored relation table of self.
showMIS(self, withListing=True)
Prints all maximal independent choices:
    Result in self.misset.
showMIS_AH(self, withListing=True)
Prints all MIS using the Hertz method.
 
Result saved in self.hertzmisset.
showMIS_HB2(self, withListing=True)
Prints all MIS using the Hertz-Bisdorff method.
 
Result saved in self.newmisset.
showMIS_RB(self, withListing=True)
Prints all MIS using the Bisdorff method.
 
Result saved in self.newmisset.
showMIS_UD(self, withListing=True)
Prints all MIS using the Hertz-Bisdorff method.
 
Result saved in self.newmisset.
showMaxAbsIrred(self, withListing=True)
Computing maximal -irredundant choices:
    Result in self.absirset.
showMaxDomIrred(self, withListing=True)
Computing maximal +irredundant choices:
   Result in self.domirset.
showMinAbs(self, withListing=True)
Prints minimal absorbent choices:
    Result in self.absset.
showMinDom(self, withListing=True)
Prints all minimal dominant choices:
    Result in self.domset.
showNeighborhoods(self)
Lists the gamma and the notGamma function of self.
showOrbits(self, InChoices, withListing=True)
Prints the orbits of Choices along the automorphisms of
the Digraph instance.
 
Example Python session for computing the non isomorphic MISs from the 12-cycle graph:
 
>>> from digraphs import *
>>> c12 = CirculantDigraph(order=12,circulants=[1,-1])
>>> c12.automorphismGenerators()
...
  Permutations
  {'1': '1', '2': '12', '3': '11', '4': '10', '5': 
   '9', '6': '8', '7': '7', '8': '6', '9': '5', '10': 
   '4', '11': '3', '12': '2'}
  {'1': '2', '2': '1', '3': '12', '4': '11', '5': '10', 
   '6': '9', '7': '8', '8': '7', '9': '6', '10': '5', 
   '11': '4', '12': '3'}
  Reflections {}
>>> print('grpsize = ', c12.automorphismGroupSize)
  grpsize = 24
>>> c12.showMIS(withListing=False)
  *---  Maximal independent choices ---*
  number of solutions:  29
  cardinality distribution
  card.:  [0, 1, 2, 3, 4,  5,  6, 7, 8, 9, 10, 11, 12]
  freq.:  [0, 0, 0, 0, 3, 24,  2, 0, 0, 0,  0,  0,  0]
  Results in c12.misset
>>> c12.showOrbits(c12.misset,withListing=False)
...
  *---- Global result ----
  Number of MIS:  29
  Number of orbits :  4
  Labelled representatives:
  1: ['2','4','6','8','10','12']
  2: ['2','5','8','11']
  3: ['2','4','6','9','11']
  4: ['1','4','7','9','11']
  Symmetry vector
  stabilizer size: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, ...]
  frequency      : [0, 2, 0, 0, 0, 0, 0, 1, 0,  0,  0,  1, ...]
 
*Figure*: The symmetry axes of the non isomorphic MISs of the 12-cycle:
 
.. image:: c12.png
   :width: 400 px
   :align: center
   :alt: The 4 non isomorphic MIS of the 12-cycle graph
 
*Reference*: R. Bisdorff and J.L. Marichal (2008). Counting non-isomorphic maximal independent sets of the n-cycle graph. *Journal of Integer Sequences*, Vol. 11 Article 08.5.7 (`openly accessible here <https://www.cs.uwaterloo.ca/journals/JIS/VOL11/Marichal/marichal.html>`_)
showOrbitsFromFile(self, InFile, withListing=True)
Prints the orbits of Choices along the automorphisms of
the digraph self by reading in the 0-1 misset file format.
See the :py:func:`digraphs.Digraph.readPerrinMisset` method.
showPreKernels(self, withListing=True)
Printing dominant and absorbent preKernels:
    Result in self.dompreKernels and self.abspreKernels
showRankingByBestChoosing(self, rankingByBestChoosing=None)
A show method for self.rankinByBestChoosing result.
 
.. warning::
 
     The self.computeRankingByBestChoosing(CoDual=False/True) method instantiating the self.rankingByBestChoosing slot is pre-required !
showRankingByChoosing(self, rankingByChoosing=None, WithCoverCredibility=False)
A show method for self.rankinByChoosing result.
 
When parameter *WithCoverCredibility* is set to True, the credibility of outranking, respectively being outranked is indicated at each selection step. 
 
.. warning::
 
     The self.computeRankingByChoosing(CoDual=False/True) method instantiating the self.rankingByChoosing slot is pre-required !
showRankingByLastChoosing(self, rankingByLastChoosing=None, Debug=None)
A show method for self.rankinByChoosing result.
 
.. warning::
 
     The self.computeRankingByLastChoosing(CoDual=False/True) method instantiating the self.rankingByChoosing slot is pre-required !
showRelation(self)
prints the relation valuation in ##.## format.
showRelationMap(self, symbols=None, rankingRule='Copeland', fromIndex=None, toIndex=None, actionsList=None)
Prints on the console, in text map format, the location of
certainly validated and certainly invalidated outranking situations.
 
By default, symbols = {'max':'┬','positive': '+', 'median': ' ',
                       'negative': '-', 'min': '┴'}
 
The default ordering of the output is following the Copeland ranking rule
from best to worst actions. Further available ranking rule is the 'NetFlows' net flows rule.
 
 
Example::
 
    >>> from outrankingDigraphs import *
    >>> t = RandomCBPerformanceTableau(numberOfActions=25,seed=1)
    >>> g = BipolarOutrankingDigraph(t,Normalized=True)
    >>> gcd = ~(-g)  # strict outranking relation
    >>> gcd.showRelationMap(rankingRule="NetFlows")
     -   ++++++++  +++++┬+┬┬+
    - -   + +++++ ++┬+┬+++┬++
    ┴+  ┴ + ++  ++++┬+┬┬++┬++
    -   ++ - ++++-++++++┬++┬+
       - - - ++- ┬- + -+┬+-┬┬
    -----  -      -┬┬┬-+  -┬┬
    ----    --+-+++++++++++++
    -- --+- --++ ++ +++-┬+-┬┬
    ----  -  -+-- ++--+++++ +
    ----- ++- --- +---++++┬ +
    -- -- ---+ -++-+++-+ +-++
    -- --┴---+  + +-++-+ -  +
    ---- ┴---+-- ++--++++ - +
      --┴┴--  --- -  --+ --┬┬
     ---------+--+ ----- +-┬┬
    -┴---┴- ---+- + ---+++┬ +
    -┴┴--┴---+--- ++ -++--+++
    -----┴--- ---+-+- ++---+ 
    -┴┴--------------- --++┬ 
    --┴---------------- --+┬ 
    ┴--┴┴ -┴--┴┴-┴ --++  ++-+
    ----┴┴--------------- -  
    ┴┴┴----+-┴+┴---┴-+---+ ┴+
    ┴┴-┴┴┴-┴- - -┴┴---┴┴+ ┬ -
    ----┴┴-┴-----┴┴---  - -- 
    Ranking rule: NetFlows
    >>>
showRelationTable(self, Sorted=True, rankingRule=None, IntegerValues=False, actionsSubset=None, relation=None, ndigits=2, ReflexiveTerms=True, fromIndex=None, toIndex=None)
Prints the relation valuation in actions X actions table format.
Copeland and NetFlows rankings my be used.
showRubisBestChoiceRecommendation(self, **kwargs)
Dummy for backward portable showBestChoiceRecommendation().
showRubyChoice(self, Verbose=False, Comments=True, _OldCoca=True)
Dummy for showBestChoiceRecommendation()
needed for older versions compatibility.
showShort(self)
concise presentation method for genuine digraphs.
showSingletonRanking(self, Comments=True, Debug=False)
Calls self.computeSingletonRanking(comments=True,Debug = False).
Renders and prints the sorted bipolar net determinatation of outrankingness
minus outrankedness credibilities of all singleton choices.
 
res = ((netdet,sigleton,dom,absorb)+)
showStatistics(self)
Computes digraph statistics like order, size and arc-density.
showdre(self)
Shows relation in nauty format.
singletons(self)
list of singletons and neighborhoods
[(singx1, +nx1, -nx1, not(+nx1 or -nx1)),.... ]
sizeSubGraph(self, choice)
Output: (size, undeterm,arcDensity).
Renders the arc density of the induced subgraph.
strongComponents(self, setPotential=False)
Renders the set of strong components of self.
symDegreesDistribution(self)
Renders the distribution of symmetric degrees.
topologicalSort(self, Debug=False)
If self is acyclic, adds topological sort number to each node of self
and renders ordered list of nodes. Otherwise renders None.
Source: M. Golumbic Algorithmic Graph heory and Perfect Graphs,
Annals Of Discrete Mathematics 57 2nd Ed. , Elsevier 2004, Algorithm 2.4 p.44.
weakAneighbors(self, node)
Renders the set of absorbed in-neighbors of a node.
weakCondorcetLosers(self)
Renders the set of decision actions x such that
self.relation[x][y] <= self.valuationdomain['med']
for all y != x.
weakCondorcetWinners(self)
Renders the set of decision actions x such that
self.relation[x][y] >= self.valuationdomain['med']
for all y != x.
weakDneighbors(self, node)
Renders the set of dominated out-neighbors of a node.
weakGammaSets(self)
Renders the dictionary of neighborhoods {node: (dx,ax)}
zoomValuation(self, zoomFactor=1.0)
Zooms in or out, depending on the value of the zoomFactor provided,
the bipolar valuation of a digraph.

Data descriptors inherited from Digraph:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class KneserDigraph(Digraph)
    KneserDigraph(n=5, j=2, valuationdomain={'min': -1.0, 'max': 1.0})
 
Specialization of the general Digraph class for generating
temporary Kneser digraphs
 
Parameters:
    | n > 0; n > j > 0;
    | valuationdomain ={'min':m, 'max':M}.
 
Default instantiation as Petersen graph:
    n = 5, j = 2, valuationdomain = {'min':-1.0,'max':1.0}.
 
 
Method resolution order:
KneserDigraph
Digraph
builtins.object

Methods defined here:
__init__(self, n=5, j=2, valuationdomain={'min': -1.0, 'max': 1.0})
Initialize self.  See help(type(self)) for accurate signature.
showShort(self)
concise presentation method for genuine digraphs.

Methods inherited from Digraph:
MISgen(self, S, I)
generator of maximal independent choices (voir Byskov 2004):
    * S ::= remaining nodes;
    * I ::= current independent choice
 
.. note::
 
        Inititalize: self.MISgen(self.actions.copy(),set())
__invert__(self)
Make the inverting operator ~self available for Digraph instances. 
 
Returns a ConverseDigraph instance of self.
__neg__(self)
Make the negation operator -self available for Digraph instances. 
 
Returns a DualDigraph instance of self.
__repr__(self)
Default presentation method for Digraph instances.
absirred(self, choice)
Renders the crips -irredundance degree of a choice.
absirredundant(self, U)
Generates all -irredundant choices of a digraph.
absirredval(self, choice, relation)
Renders the valued -irredundance degree of a choice.
absirredx(self, choice, x)
Computes the crips -irredundance degree of node x in a choice.
abskernelrestrict(self, prekernel)
Parameter: prekernel
Renders absorbent prekernel restricted relation.
absorb(self, choice)
Renders the absorbency degree of a choice.
absorbentChoices(self, S)
Generates all minimal absorbent choices of a bipolar valued digraph.
addValuationAttribute(self)
Adds the numpy valuation attribute
agglomerationDistribution(self)
Output: aggloCoeffDistribution, meanCoeff
Renders the distribution of agglomeration coefficients.
aneighbors(self, node)
Renders the set of absorbed in-neighbors of a node.
automorphismGenerators(self)
Adds automorphism group generators to the digraph instance.
 
.. note::
 
    Dependency: Uses the dreadnaut command from the nauty software package. See https://www3.cs.stonybrook.edu/~algorith/implement/nauty/implement.shtml
 
    On Ubuntu Linux:
      ...$ sudo apt-get install nauty
averageCoveringIndex(self, choice, direction='out')
Renders the average covering index of a given choice in a set of objects,
ie the average number of choice members that cover each
non selected object.
bipolarKCorrelation(self, digraph, Debug=False)
Renders the bipolar Kendall correlation between two bipolar valued
digraphs computed from the average valuation of the
XORDigraph(self,digraph) instance.
 
.. warning::
 
     Obsolete! Is replaced by the self.computeBipolarCorrelation(other) Digraph method
bipolarKDistance(self, digraph, Debug=False)
Renders the bipolar crisp Kendall distance between two bipolar valued
digraphs.
 
.. warning::
 
     Obsolete! Is replaced by the self.computeBipolarCorrelation(other, MedianCut=True) Digraph method
chordlessPaths(self, Pk, n2, Odd=False, Comments=False, Debug=False)
New procedure from Agrum study April 2009
recursive chordless path extraction starting from path
Pk = [n2, ...., n1] and ending in node n2.
Optimized with marking of visited chordless P1s.
circuitAverageCredibility(self, circ)
Renders the average linking credibility of a Chordless Circuit.
circuitCredibilities(self, circuit, Debug=False)
Renders the average linking credibilities and the minimal link of a Chordless Circuit.
circuitMaxCredibility(self, circ)
Renders the maximal linking credibility of a Chordless Circuit.
circuitMinCredibility(self, circ)
Renders the minimal linking credibility of a Chordless Circuit.
closeSymmetric(self, InSite=True)
Produces the symmetric closure of self.relation.
closeTransitive(self, Reverse=False, InSite=True, Comments=False)
Produces the transitive closure of self.relation
 
*Parameters*:
 
    - If *Reverse* == True (False default) all transitive links are dropped, otherwise all transitive links are closed with min[r(x,y),r(y,z)];
    - If *Insite* == False (True by default) the methods return a modified copy of self.relation without altering the original self.relation, otherwise self.relation is modified.
components(self)
Renders the list of connected components.
computeAllDensities(self, choice=None)
parameter: choice in self
renders six densitiy parameters:
arc density, double arc density,
single arc density, strict single arc density,
absence arc density, strict absence arc densitiy.
computeArrowRaynaudOrder(self)
Renders a linear ordering from worst to best of the actions following Arrow&Raynaud's rule.
computeArrowRaynaudRanking(self)
renders a linear ranking from best to worst of the actions following Arrow&Raynaud's rule.
computeAverageValuation(self)
Computes the bipolar average correlation between
self and the crisp complete digraph of same order
of the irreflexive and determined arcs of the digraph
computeBadChoices(self, Comments=False)
Computes characteristic values for potentially bad choices.
 
.. note::
 
     Returns a tuple with following content:
 
     [(0)-determ,(1)degirred,(2)degi,(3)degd,(4)dega,(5)str(choice),(6)absvec]
computeBadPirlotChoices(self, Comments=False)
Characteristic values for potentially bad choices
using the Pirlot's fixpoint algorithm.
computeBestChoiceRecommendation(self, Verbose=False, Comments=False, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True)
Sets self.bestChoice, self.bestChoiceData, self.worstChoice and self.worstChoiceData
with the showBestChoiceRecommendation method.
 
First and last choices data is the following:
[(0)-determ,(1)degirred,(2)degi,(3)degd,(4)dega,(5)str(choice),(6)domvec,(7)cover]
 
self.bestChoice = self.bestChoiceData[5]
self.worstChoice = self.worstChoiceData[5]
computeBipolarCorrelation(self, other, MedianCut=False, filterRelation=None, Debug=False)
obsolete: dummy replacement for Digraph.computeOrdinalCorrelation method
computeChordlessCircuits(self, Odd=False, Comments=False, Debug=False)
Renders the set of all chordless circuits detected in a digraph.
Result is stored in <self.circuitsList>
holding a possibly empty list of tuples with at position 0 the
list of adjacent actions of the circuit and at position 1
the set of actions in the stored circuit.
 
When *Odd* is True, only chordless circuits with an odd length
are collected.
computeChordlessCircuitsMP(self, Odd=False, Threading=False, nbrOfCPUs=None, startMethod=None, Comments=False, Debug=False)
Multiprocessing version of computeChordlessCircuits().
 
Renders the set of all chordless odd circuits detected in a digraph.
Result (possible empty list) stored in <self.circuitsList>
holding a possibly empty list tuples with at position 0 the
list of adjacent actions of the circuit and at position 1
the set of actions in the stored circuit.
Inspired by Dias, Castonguay, Longo, Jradi, Algorithmica (2015).
 
Returns a possibly empty list of tuples (circuit,frozenset(circuit)).
 
If Odd == True, only circuits of odd length are retained in the result.
computeCoSize(self)
Renders the number of non validated non reflexive arcs
computeConcentrationIndex(self, X, N)
Renders the Gini concentration index of the X serie.
N contains the partial frequencies.
Based on the triangle summation formula.
computeConcentrationIndexTrapez(self, X, N)
Renders the Gini concentration index of the X serie.
N contains the partial frequencies.
Based on the triangles summation formula.
computeCondorcetLosers(self)
Wrapper for condorcetLosers().
computeCondorcetWinners(self)
Wrapper for condorcetWinners().
computeCopelandOrder(self)
renders a linear ordering from worst to best of the actions following Arrow&Raynaud's rule.
computeCopelandRanking(self)
renders a linear ranking from best to worst of the actions following Arrow&Raynaud's rule.
computeCutLevelDensities(self, choice, level)
parameter: choice in self, robustness level
renders three robust densitiy parameters:
robust double arc density,
robust single arc density,
robust absence arc densitiy.
computeDensities(self, choice)
parameter: choice in self
renders the four densitiy parameters:
arc density, double arc density, single arc density, absence arc density.
computeDeterminateness(self, InPercents=False)
Computes the Kendalll distance of self
with the all median-valued indeterminate digraph of order n.
 
Return the average determination of the irreflexive part of the digraph.
 
*determination* = sum_(x,y) { abs[ r(xRy) - Med ] } / n(n-1)
 
If *InPercents* is True, returns the average determination in percentage of
(Max - Med) difference.
 
>>> from outrankingDigraphs import BipolarOutrankingDigraph
>>> from randomPerfTabs import Random3ObjectivesPerformanceTableau
>>> t = Random3ObjectivesPerformanceTableau(numberOfActions=7,numberOfCriteria=7,seed=101)
>>> g = BipolarOutrankingDigraph(t,Normalized=True)
>>> g
*------- Object instance description ------*
Instance class      : BipolarOutrankingDigraph
Instance name       : rel_random3ObjectivesPerfTab
Actions             : 7
Criteria            : 7
Size                : 27
Determinateness (%) : 65.67
Valuation domain    : [-1.00;1.00]
>>> print(g.computeDeterminateness())
0.3134920634920634920634920638
>>> print(g.computeDeterminateness(InPercents=True))
65.67460317460317460317460320
>>> g.recodeValuation(0,1)
>>> g
*------- Object instance description ------*
Instance class      : BipolarOutrankingDigraph
Instance name       : rel_random3ObjectivesPerfTab
Actions             : 7
Criteria            : 7
Size                : 27
Determinateness (%) : 65.67
Valuation domain    : [0.00;1.00]
>>> print(g.computeDeterminateness())
0.1567460317460317460317460318
>>> print(g.computeDeterminateness(InPercents=True))
65.67460317460317460317460320
computeDiameter(self, Oriented=True)
Renders the (by default oriented) diameter of the digraph instance
computeDigraphCentres(self, WeakDistances=False, Comments=False)
The centers of a digraph are the nodes with finite minimal shortes path lengths.
 
The maximal neighborhood distances are stored in *self.maximalNeighborhoodDistances*.
 
The corresponding digraph radius and diameter are stored respectively  in *self.radius* and *self.diameter*.
 
With *Comments* = True, all these results are printed out.
 
*Source*: Claude Berge, *The Theory of Graphs*, Dover (2001) pp. 119, original in French Dunod (1958)
computeDynamicProgrammingStages(self, source, sink, Debug=False)
Renders the discrete stages of the optimal substructure for
dynamic pogramming digrahs from a given source node 
to a given sink sink node.
 
Returns a list of list of action identifyers.
computeGoodChoiceVector(self, ker, Comments=False)
| Computing Characteristic values for dominant pre-kernels
| using the von Neumann dual fixoint equation
computeGoodChoices(self, Comments=False)
Computes characteristic values for potentially good choices.
 
..note::
 
     Return a tuple with following content:
 
     [(0)-determ,(1)degirred,(2)degi,(3)degd,(4)dega,(5)str(choice),(6)domvec,(7)cover]
computeGoodPirlotChoices(self, Comments=False)
Characteristic values for potentially good choices
using the Pirlot fixpoint algorithm.
computeIncomparabilityDegree(self, InPercents=False, Comments=False)
Renders the incomparability degree (Decimal), i.e. the relative number of symmetric indeterminate relations of the irreflexive part of a digraph.
computeKemenyIndex(self, otherRelation)
renders the Kemeny index of the self.relation
compared with a given crisp valued relation of a compatible
other digraph (same nodes or actions).
computeKemenyOrder(self, orderLimit=7, Debug=False)
Renders a ordering from worst to best of the actions with maximal Kemeny index.
Return a tuple: kemenyOrder (from worst to best), kemenyIndex
computeKemenyRanking(self, orderLimit=7, seed=None, sampleSize=1000, Debug=False)
Renders a ranking from best to worst of the actions with maximal Kemeny index.
 
.. note::
 
     Returns a tuple: kemenyRanking (from best to worst), kemenyIndex.
computeKernelVector(self, kernel, Initial=True, Comments=False)
| Computing Characteristic values for dominant pre-kernels
| using the von Neumann dual fixpoint equation
computeKohlerOrder(self)
Renders an ordering (worst to best) of the actions following Kohler's rule.
computeKohlerRanking(self)
Renders a ranking (best to worst) of the actions following Kohler's rule.
computeMaxHoleSize(self, Comments=False)
Renders the length of the largest chordless cycle
in the corresponding disjunctive undirected graph.
computeMeanInDegree(self)
Renders the mean indegree of self.
!!! self.size must be set previously !!!
computeMeanOutDegree(self)
Renders the mean degree of self.
!!! self.size must be set previously !!!
computeMeanSymDegree(self)
Renders the mean degree of self.
!!! self.size must be set previously !!!
computeMedianOutDegree(self)
Renders the median outdegree of self.
!!! self.size must be set previously !!!
computeMedianSymDegree(self)
Renders the median symmetric degree of self.
!!! self.size must be set previously !!!
computeMoreOrLessUnrelatedPairs(self)
Renders a list of more or less unrelated pairs.
computeNetFlowsOrder(self)
Renders an ordered list (from best to worst) of the actions
following the net flows ranking rule.
computeNetFlowsOrderDict(self)
Renders an ordered list (from worst to best) of the actions
following the net flows ranking rule.
computeNetFlowsRanking(self)
Renders an ordered list (from best to worst) of the actions
following the net flows ranking rule.
computeNetFlowsRankingDict(self)
Renders an ordered list (from best to worst) of the actions
following the net flows ranking rule.
computeODistance(self, op2, comments=False)
renders the squared normalized distance of
two digraph valuations.
 
.. note::
 
     op2 = digraphs of same order as self.
computeOrbit(self, choice, withListing=False)
renders the set of isomorph copies of a choice following
the automorphism of the digraph self
computeOrderCorrelation(self, order, Debug=False)
Renders the ordinal correlation K of a digraph instance
when compared with a given linear order (from worst to best) of its actions
 
K = sum_{x != y} [ min( max(-self.relation(x,y)),other.relation(x,y), max(self.relation(x,y),-other.relation(x,y)) ]
 
K /= sum_{x!=y} [ min(abs(self.relation(x,y),abs(other.relation(x,y)) ]
 
.. note::
 
     Renders a dictionary with the key 'correlation' containing the actual bipolar correlation index and the key 'determination' containing the minimal determination level D of self and the other relation.
 
     D = sum_{x != y} min(abs(self.relation(x,y)),abs(other.relation(x,y)) / n(n-1)
 
     where n is the number of actions considered.
 
     The correlation index with a completely indeterminate relation
     is by convention 0.0 at determination level 0.0 .
 
.. warning::
 
     self must be a normalized outranking digraph instance !
computeOrdinalCorrelation(self, other, MedianCut=False, filterRelation=None, Debug=False)
Renders the bipolar correlation K of a
self.relation when compared
with a given compatible (same actions set)) digraph or
a [-1,1] valued compatible relation (same actions set).
 
If MedianCut=True, the correlation is computed on the median polarized relations.
 
If filterRelation is not None, the correlation is computed on the partial domain corresponding to the determined part of the filter relation.
 
.. warning::
 
     Notice that the 'other' relation and/or the 'filterRelation',
     the case given, must both be normalized, ie [-1,1]-valued !
 
K = sum_{x != y} [ min( max(-self.relation[x][y]),other.relation[x][y]), max(self.relation[x][y],-other.relation[x][y]) ]
 
K /= sum_{x!=y} [ min(abs(self.relation[x][y]),abs(other.relation[x][y])) ]
 
.. note::
 
     Renders a tuple with at position 0 the actual bipolar correlation index
     and in position 1 the minimal determination level D of self and
     the other relation.
 
     D = sum_{x != y} min(abs(self.relation[x][y]),abs(other.relation[x][y])) / n(n-1)
 
     where n is the number of actions considered.
 
     The correlation index with a completely indeterminate relation
     is by convention 0.0 at determination level 0.0 .
computeOrdinalCorrelationMP(self, other, MedianCut=False, Threading=False, nbrOfCPUs=None, startMethod=None, Comments=False, Debug=False)
Multi processing version of the digraphs.computeOrdinalCorrelation() method.
 
.. note::
     The relation filtering and the MedinaCut option are not implemented in the MP version.
computePairwiseClusterComparison(self, K1, K2, Debug=False)
Computes the pairwise cluster comparison credibility vector
from bipolar-valued digraph g. with K1 and K2 disjoint
lists of action keys from g actions disctionary.
Returns the dictionary
{'I': Decimal(),'P+':Decimal(),'P-':Decimal(),'R' :Decimal()}
where one and only one item is strictly positive.
computePreKernels(self)
computing dominant and absorbent preKernels:
    Result in self.dompreKernels and self.abspreKernels
computePreRankingRelation(self, preRanking, Normalized=True, Debug=False)
Renders the bipolar-valued relation obtained from
a given preRanking in decreasing levels (list of lists) result.
computePreorderRelation(self, preorder, Normalized=True, Debug=False)
Renders the bipolar-valued relation obtained from
a given preordering in increasing levels (list of lists) result.
computePrincipalOrder(self, Colwise=False, Comments=False)
Rendesr an ordering from wrost to best of the decision actions.
computePrincipalRanking(self, Colwise=False, Comments=False)
Rendesr a ranking from best to worst of the decision actions.
computePrincipalScores(self, plotFileName=None, Colwise=False, imageType=None, tempDir=None, bgcolor='cornsilk', Comments=False, Debug=False)
Renders a ordered list of the first principal eigenvector of the covariance of the valued outdegrees of self.
 
.. note::
 
   The method, relying on writing and reading temporary files by default in a temporary directory is threading and multiprocessing safe !
   (see Digraph.exportPrincipalImage method)
computePrudentBetaLevel(self, Debug=False)
computes alpha, ie the lowest valuation level, for which the
bipolarly polarised digraph doesn't contain a chordless circuit.
computeRankingByBestChoosing(self, CoDual=False, Debug=False)
Computes a weak preordering of the self.actions by recursive
best choice elagations.
 
Stores in self.rankingByBestChoosing['result'] a list of (P+,bestChoice) tuples
where P+ gives the best choice complement outranking
average valuation via the computePairwiseClusterComparison
method.
 
If self.rankingByBestChoosing['CoDual'] is True, 
the ranking-by-choosing was computed on the codual of self.
computeRankingByBestChoosingRelation(self, rankingByBestChoosing=None, Debug=False)
Renders the bipolar-valued relation obtained from
the self.rankingByBestChoosing result.
computeRankingByChoosing(self, actionsSubset=None, Debug=False, CoDual=False)
Computes a weak preordring of the self.actions by iterating
jointly first and last choice elagations.
 
Stores in self.rankingByChoosing['result'] a list of ((P+,bestChoice),(P-,worstChoice)) pairs
where P+ (resp. P-) gives the best (resp. worst) choice complement outranking
(resp. outranked) average valuation via the computePairwiseClusterComparison
method.
 
If self.rankingByChoosing['CoDual'] is True, the ranking-by-choosing was computed on the codual of self.
computeRankingByChoosingRelation(self, rankingByChoosing=None, actionsSubset=None, Debug=False)
Renders the bipolar-valued relation obtained from
the self.rankingByChoosing result.
computeRankingByLastChoosing(self, CoDual=False, Debug=False)
Computes a weak preordring of the self.actions by iterating
worst choice elagations.
 
Stores in self.rankingByLastChoosing['result'] a list of (P-,worstChoice) pairs
where P- gives the worst choice complement outranked
average valuation via the computePairwiseClusterComparison
method.
 
If self.rankingByChoosing['CoDual'] is True, the ranking-by-last-chossing 
was computed on the codual of self.
computeRankingByLastChoosingRelation(self, rankingByLastChoosing=None, Debug=False)
Renders the bipolar-valued relation obtained from
the self.rankingByLastChoosing result.
computeRankingCorrelation(self, ranking, Debug=False)
Renders the ordinal correlation K of a digraph instance
when compared with a given linear ranking of its actions
 
K = sum_{x != y} [ min( max(-self.relation(x,y)),other.relation(x,y), max(self.relation(x,y),-other.relation(x,y)) ]
 
K /= sum_{x!=y} [ min(abs(self.relation(x,y),abs(other.relation(x,y)) ]
 
.. note::
 
     Renders a tuple with at position 0 the actual bipolar correlation index
     and in position 1 the minimal determination level D of self and
     the other relation.
 
     D = sum_{x != y} min(abs(self.relation(x,y)),abs(other.relation(x,y)) / n(n-1)
 
     where n is the number of actions considered.
 
     The correlation index with a completely indeterminate relation
     is by convention 0.0 at determination level 0.0 .
computeRelationalStructure(self, Debug=False)
Renders the counted decomposition of the valued relations into
the following type of links:
gt '>', eq '=', lt '<', incomp '<>',
leq '<=', geq '>=', indeterm '?'
computeRubisChoice(self, Comments=False, _OldCoca=False, BrokenCocs=True, Threading=False, nbrOfCPUs=1)
Renders self.strictGoodChoices, self.nullChoices
self.strictBadChoices, self.nonRobustChoices.
 
.. warning::
    Changes in site the outranking digraph by
    adding or braking chordless odd outranking circuits.
computeRubyChoice(self, Comments=False, _OldCoca=False)
dummy for computeRubisChoice()
old versions compatibility.
computeShortestPathLengths(self, WeakPaths=False, Comments=False, Debug=False)
Renders a double dictionary with the directed distances, i.e. the shortest path lengths between all self.actions
 
Equals *None* if there does not exist a directed path between two actions.
 
*Source*: Claude Berge, *The Theory of Graphs*, Dover (2001) pp. 119, original in French Dunod (1958)
computeSingletonRanking(self, Comments=False, Debug=False)
Renders the sorted bipolar net determinatation of outrankingness
minus outrankedness credibilities of all singleton choices.
 
res = ((netdet,singleton,dom,absorb)+)
computeSize(self)
Renders the number of validated non reflexive arcs
computeSizeTransitiveClosure(self)
Renders the size of the transitive closure of a digraph.
computeSlaterOrder(self, isProbabilistic=False, seed=None, sampleSize=1000, Debug=False)
Reversed return from computeSlaterRanking method.
computeSlaterRanking(self, isProbabilistic=False, seed=None, sampleSize=1000, Debug=False)
Renders a ranking of the actions with minimal Slater index.
Return a tuple: slaterOrder, slaterIndex
computeSymmetryDegree(self, InPercents=False, Comments=False)
Renders the symmetry degree (Decimal) of the irreflexive part of a digraph.
 
.. note::
 
   Empty and indeterminate digraphs are considered to be symmetric.
computeTopologicalRanking(self, Debug=False)
Mimetic Wrapper of the topologicalSort() method.
computeTransitivityDegree(self, InPercents=False, Comments=False)
Renders the transitivity degree (Decimal) of a digraph.
 
.. note:: 
 
   An empty or indeterminate digraph is considered to be transitive.
computeUnrelatedPairs(self)
Renders a list of more or less unrelated pairs.
computeValuationLevels(self, choice=None, Debug=False)
renders the symmetric closure of the
apparent valuations levels of self
in an increasingly ordered list.
If parameter choice is given, the
computation is limited to the actions
of the choice.
computeValuationPercentages(self, choice, percentiles, withValues=False)
Parameters: choice and list of percentiles.
renders a series of percentages of the characteristics valuation of
the arcs in the digraph.
computeValuationPercentiles(self, choice, percentages, withValues=False)
Parameters: choice and list of percentages.
renders a series of quantiles of the characteristics valuation of
the arcs in the digraph.
computeValuationStatistics(self, Sampling=False, Comments=False)
Renders the mean and variance of the valuation
of the non reflexive pairs.
computeValuedRankingRelation(self, ranking)
Renders the valued relation characteristics compatible 
with the given linar ranking. Discordant charcateristics 
are set to the indeterminate value.
computeWeakCondorcetLosers(self)
Wrapper for weakCondorcetLosers().
computeWeakCondorcetWinners(self)
Wrapper for weakCondorcetWinners().
computeupdown1(self, s, S)
Help method for show_MIS_HB2 method.
fills self.newmisset, self.upmis, self.downmis.
computeupdown2(self, s, S)
Help method for show_MIS_HB1 method.
Fills self.newmisset, self.upmis, self.downmis.
computeupdown2irred(self, s, S)
Help method for show_MIS_HB1 method.
Fills self.newmisset, self.upmis, self.downmis.
condorcetLosers(self)
Renders the set of decision actions x such that
self.relation[x][y] < self.valuationdomain['med']
for all y != x.
condorcetWinners(self)
Renders the set of decision actions x such that
self.relation[x][y] > self.valuationdomain['med']
for all y != x.
contra(self, v)
Parameter: choice.
Renders the negation of a choice v characteristic's vector.
convertRelationToDecimal(self)
Converts the float valued self.relation in a decimal valued one.
convertValuation2Integer(self, InSite=True, Comments=False)
Converts the self.relation valuation to integer values by converting the Decimals to Fractions and multiply by the least commun multiple of the fraction denominators.
 
*Parameters*:
 
    - If *Insite* == False (True by default) the method returns a modified copy of self.relation without altering the original self.relation, otherwise self.relation and self.valuationdomain is modified.
convertValuationToDecimal(self)
Convert the float valuation limits to Decimals.
coveringIndex(self, choice, direction='out')
Renders the covering index of a given choice in a set of objects,
ie the minimum number of choice members that cover each
non selected object.
crispKDistance(self, digraph, Debug=False)
Renders the crisp Kendall distance between two bipolar valued
digraphs.
 
.. warning::
 
     Obsolete! Is replaced by the self.computeBipolarCorrelation(other, MedianCut=True) Digraph method
detectChordlessCircuits(self, Comments=False, Debug=False)
Detects a chordless circuit in a digraph.
Returns a Boolean
detectChordlessPath(self, Pk, n2, Comments=False, Debug=False)
New procedure from Agrum study April 2009
recursive chordless path extraction starting from path
Pk = [n2, ...., n1] and ending in node n2.
Optimized with marking of visited chordless P1s.
determinateness(self, vec, inPercent=True)
Renders the determinateness of a characteristic vector *vec* = 
[(r(x),x),(r(y),y), ...] of length *n* in valuationdomain [Min,Med,Max]:
 
*result* =  sum_x( abs(r(x)-Med) ) / ( n*(Max-Med) )
 
If inPercent, *result* shifted (+1) and reduced (/2) to [0,1] range.
digraph2Graph(self, valuationDomain={'min': -1, 'med': 0, 'max': 1}, Debug=False, ConjunctiveConversion=True)
Convert a Digraph instance to a Graph instance.
dneighbors(self, node)
Renders the set of dominated out-neighbors of a node.
domin(self, choice)
Renders the dominance degree of a choice.
dominantChoices(self, S)
Generates all minimal dominant choices of a bipolar valued digraph.
 
.. note::
 
     Initiate with S = self.actions.copy().
domirred(self, choice)
Renders the crips +irredundance degree of a choice.
domirredval(self, choice, relation)
Renders the valued +irredundance degree of a choice.
domirredx(self, choice, x)
Renders the crips +irredundance degree of node x in a choice.
domkernelrestrict(self, prekernel)
Parameter: dominant prekernel
Renders dominant prekernel restricted relation.
exportGraphViz(self, fileName=None, actionsSubset=None, bestChoice=set(), worstChoice=set(), firstChoice=set(), lastChoice=set(), Comments=True, graphType='png', pictureFormat=None, graphSize='7,7', relation=None, bgcolor='cornsilk')
export GraphViz dot file  for graph drawing filtering.
exportPrincipalImage(self, plotFileName=None, pictureFormat='pdf', bgcolor='cornsilk', fontcolor='red3', fontsize='0.75', Reduced=False, Colwise=False, tempDir='.', Comments=False)
Export as PDF (default) the principal projection of
the valued relation using the three principal eigen vectors.
 
Implemeted picture formats are: 
'pdf' (default), 'png', 'jpeg' and 'xfig'.
 
The background color is set by default to 'cornsilk'. 
 
Font size and color are set by default to 'red3', resp. '0.75'. 
 
When *Reduced==True*, the valued relation characeteristics are centered and reduced.
 
When *Colwise==True*, the column vectors of the adjacency table are used for the principal projection, otherwise the rows (default) are used. Has no incidence when the *Digraph* instance *self*  is symmetric. 
 
.. warning::
 
    The method, writing and reading temporary files: 
    tempCol.r and rotationCol.csv, resp. tempRow.r and rotationRow.csv,
    by default in the working directory (./),
    is hence not safe for multiprocessing programs, unless a
    temporary directory *tempDir* is provided.
flatChoice(self, ch, Debug=False)
Converts set or list ch recursively to a flat list of items.
forcedBestSingleChoice(self)
Renders the set of most determined outranking singletons in self.
gammaSets(self)
Renders the dictionary of neighborhoods {node: (dx,ax)}
with set *dx* gathering the dominated, and set *ax* gathering
the absorbed neighborhood.
generateAbsPreKernels(self)
Generate all absorbent prekernels from independent choices generator.
generateDomPreKernels(self)
Generate all dominant prekernels from independent choices generator.
htmlChoiceVector(self, ch, ChoiceVector=True, choiceType='good')
Show procedure for annotated bipolar choices.
inDegrees(self)
renders the median cut indegrees
inDegreesDistribution(self)
Renders the distribution of indegrees.
independentChoices(self, U)
Generator for all independent choices with neighborhoods of a bipolar valued digraph:
 
.. note::
 
       * Initiate with U = self.singletons().
       * Yields [(independent choice, domnb, absnb, indnb)].
inner_prod(self, v1, v2)
Parameters: two choice characteristic vectors
Renders the inner product of two characteristic vetors.
intstab(self, choice)
Computes the independence degree of a choice.
irreflex(self, mat)
Puts diagonal entries of mat to valuationdomain['min']
isAsymmetricIndeterminate(self, Debug=False)
Checks the self.relation for assymmetric indeterminateness!!
 
.. warning::
 
    The reflexive links are ignored !!
isComplete(self, Debug=False)
checks the completeness property of self.relation by checking
for the absence of a link between two actions!!
 
.. warning::
 
    The reflexive links are ignored !!
isCyclic(self, Debug=False)
checks the cyclicity of self.relation by checking
for a reflexive loop in its transitive closure-
 
.. warning::
 
     self.relation is supposed to be irreflexive !
isIntegerValued(self, Debug=False)
Checks whether the decimal valuation of self is integer-valued
be using the as_integer_ratio() method of a Decimal 
giving a tuple (numerator,denominator). If denominator == 1, the
number is an integer.
isOutrankingDigraph(self, Comments=True, Debug=False)
Checks the outranking digraph characteristic condition (3.3).
 
relation[x][y] + relation[y][x)[y] >= 0.0
 
.. warning::
 
    The reflexive links are ignored and the valuation must be bipolar !!
isStrictOutrankingDigraph(self, Comments=True, Debug=False)
Checks the strict outranking digraph characteristic condition (3.1).
 
-(relation[x][y] + relation[y][x]) <= 0.0 , x != y
 
.. warning::
 
    The reflexive links are ignored and the valuation must be bipolar !!
isSymmetric(self, Comments=False)
True if symmetry degree == 1.0.
isTransitive(self, Comments=False)
True if transitivity degree == 1.0.
isWeaklyComplete(self, Debug=False)
checks the weakly completeness property of self.relation by checking
for the absence of a link between two actions!!
 
.. warning::
 
    The reflexive links are ignored !!
iterateRankingByChoosing(self, Odd=False, CoDual=False, Comments=True, Debug=False, Limited=None)
Renders a ranking by choosing result when progressively eliminating
all chordless (odd only) circuits with rising valuation cut levels.
 
Parameters
    CoDual = False (default)/True
    Limited = proportion (in [0,1]) * (max - med) valuationdomain
kChoices(self, A, k)
Renders all choices of length k from set A
matmult2(self, m, v)
Parameters: digraph relation and choice characteristic vector
matrix multiply vector by inner production
meanDegree(self)
Renders the mean degree of self.
!!! self.size must be set previously !!!
meanLength(self, Oriented=False)
Renders the (by default non-oriented) mean neighbourhoor depth of self.
!!! self.order must be set previously !!!
minimalChoices(self, S)
Generates all dominant or absorbent choices of a bipolar
valued digraph.
 
.. note:
 
   * Initiate with S = (actions, dict of dominant or absorbent closed neighborhoods)
   * See showMinDom and showMinAbs methods.
minimalValuationLevelForCircuitsElimination(self, Odd=True, Debug=False, Comments=False)
renders the minimal valuation level <lambda> that eliminates all
self.circuitsList stored odd chordless circuits from self.
 
.. warning::
 
    The <lambda> level polarised may still contain newly appearing chordless odd circuits !
neighbourhoodCollection(self, Oriented=False, Potential=False)
Renders the neighbourhood.
neighbourhoodDepthDistribution(self, Oriented=False)
Renders the distribtion of neighbourhood depths.
notGammaSets(self)
Renders the dictionary of neighborhoods {node: (dx,ax)}
with set *dx* gathering the not dominated, and set *ax* gathering
the not absorbed neighborhood.
notaneighbors(self, node)
Renders the set of absorbed not in-neighbors of a node.
notdneighbors(self, node)
Renders the set of not dominated out-neighbors of a node.
outDegrees(self)
renders the median cut outdegrees
outDegreesDistribution(self)
Renders the distribution of outdegrees.
plusirredundant(self, U)
Generates all +irredundant choices of a digraph.
powerset(self, U)
Generates all subsets of a set.
readPerrinMisset(self, file='curd.dat')
read method for 0-1-char-coded MISs by default from the perrinMIS.c curd.dat result file.
readabsvector(self, x, relation)
Parameter: action x
absorbent in vector.
readdomvector(self, x, relation)
Parameter: action x
dominant out vector.
recodeValuation(self, newMin=-1.0, newMax=1.0, ndigits=4, Debug=False)
Recodes the characteristic valuation domain according
to the parameters given. 
 
*ndigits* indicates the number of decimal digits of the valuation.
relationFct(self, x, y)
wrapper for self.relation dictionary access to ensure interoperability
with the sparse and big outranking digraph implementation model.
save(self, fileName='tempdigraph', option=None, DecimalValuation=True, decDigits=2)
Persistent storage of a Digraph class instance in the form of
a python source code file
saveCSV(self, fileName='tempdigraph', Normalized=False, Dual=False, Converse=False, Diagonal=False, Debug=False)
Persistent storage of a Digraph class instance in the form of
a csv file.
saveXMCDA2(self, fileName='temp', fileExt='xmcda2', Comments=True, relationName='R', relationType='binary', category='random', subcategory='valued', author='digraphs Module (RB)', reference='saved from Python', valuationType='standard', digits=2, servingD3=False)
save digraph in XMCDA 2.0 format. Deprecated now.
savedre(self, fileName='temp')
save digraph in nauty format.
sharp(self, x, y)
Paramaters: choice characteristic values.
Renders the sharpest of two characteristic values x and y.
sharpvec(self, v, w)
Paramaters: choice characteristic vectors.
Renders the sharpest of two characteristic vectors v and w.
showActions(self)
presentation methods for digraphs actions
showAll(self)
Detailed show method for genuine digraphs.
showAttributes(self)
Prints out the attributes of self.
showAutomorphismGenerators(self)
Renders the generators of the automorphism group.
showBadChoices(self, Recompute=True)
Characteristic values for potentially bad choices.
showBestChoiceRecommendation(self, Verbose=False, Comments=True, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True)
Shows the RuBis best choice recommendation.
 
.. note::
 
    Computes by default the Rubis best choice recommendation on the corresponding strict (codual) outranking digraph.
 
    By default, with BrokenCocs=True, we brake all chordless circuits at their weakest determined ( abs(r(x>y)) + abs(r(y>x)) ) link.
 
    When BrokenCocs=False we proceed like follows:
 
    In case of chordless circuits, if supporting arcs are more credible
    than the reversed negating arcs, we collapse the circuits into hyper nodes.
    Inversely,  if supporting arcs are not more credible than the reversed negating arcs,
    we brake the circuits on their weakest arc.
 
Usage example:
 
>>> from outrankingDigraphs import *
>>> t = Random3ObjectivesPerformanceTableau(seed=5)
>>> g = BipolarOutrankingDigraph(t)
>>> g.showBestChoiceRecommendation()
***********************
RuBis Best Choice Recommendation (BCR)
(in decreasing order of determinateness)   
Credibility domain:  [-100.0, 100.0]
=== >> potential first choices
* choice              : ['a04', 'a14', 'a19', 'a20']
   independence        : 1.19
   dominance           : 4.76
   absorbency          : -59.52
   covering (%)        : 75.00
   determinateness (%) : 57.86
   - most credible action(s) = { 'a14': 23.81, 'a19': 11.90, 'a04': 2.38, 'a20': 1.19, }  
=== >> potential last choices 
* choice              : ['a03', 'a12', 'a17']
  independence        : 4.76
  dominance           : -76.19
  absorbency          : 4.76
  covering (%)        : 0.00
  determinateness (%) : 65.39
  - most credible action(s) = { 'a03': 38.10, 'a12': 13.10, 'a17': 4.76, }
Execution time: 0.024 seconds
*****************************
showChoiceVector(self, ch, choiceType='good', ChoiceVector=True)
Show procedure for annotated bipolar choices.
showChordlessCircuits(self, Recompute=False)
Show method for chordless circuits observed in a Digraph instance.
 
If previous computation is required, stores the detected circuits in self.circuitsList attribute.
showComponents(self)
Shows the list of connected components of the digraph instance.
showCorrelation(self, corr=None, ndigits=3)
Renders the valued ordinal correlation index, the crisp Kendall tau index and their epistemic determination degree.
showFirstChoiceRecommendation(self, Verbose=False, Comments=True, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True)
Shows the RuBis first choice recommendation.
 
.. note::
 
    Computes by default the Rubis first choice recommendation on the corresponding strict (codual) outranking digraph.
 
    By default, with BrokenCocs=True, we brake all chordless circuits at their weakest determined ( abs(r(x>y)) + abs(r(y>x)) ) link.
 
    When BrokenCocs=False we proceed like follows:
 
    In case of chordless circuits, if supporting arcs are more credible
    than the reversed negating arcs, we collapse the circuits into hyper nodes.
    Inversely,  if supporting arcs are not more credible than the reversed negating arcs,
    we brake the circuits on their weakest arc.
 
Usage example:
 
>>> from outrankingDigraphs import *
>>> t = Random3ObjectivesPerformanceTableau(seed=5)
>>> g = BipolarOutrankingDigraph(t)
>>> g.showFirstChoiceRecommendation()
***********************
RuBis First Choice Recommendation (BCR)
(in decreasing order of determinateness)   
Credibility domain:  [-100.0, 100.0]
=== >> potential first choices
* choice              : ['a04', 'a14', 'a19', 'a20']
   independence        : 1.19
   dominance           : 4.76
   absorbency          : -59.52
   covering (%)        : 75.00
   determinateness (%) : 57.86
   - most credible action(s) = { 'a14': 23.81, 'a19': 11.90, 'a04': 2.38, 'a20': 1.19, }  
=== >> potential last choices 
* choice              : ['a03', 'a12', 'a17']
  independence        : 4.76
  dominance           : -76.19
  absorbency          : 4.76
  covering (%)        : 0.00
  determinateness (%) : 65.39
  - most credible action(s) = { 'a03': 38.10, 'a12': 13.10, 'a17': 4.76, }
Execution time: 0.024 seconds
*****************************
showGoodChoices(self, Recompute=True)
Characteristic values for potentially good choices.
showHTMLBestChoiceRecommendation(self, pageTitle=None, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True, htmlFileName=None)
showHTMLRelationHeatmap(self, actionsList=None, rankingRule='NetFlows', colorLevels=7, tableTitle='Relation Heatmap', relationName='r(x S y)', ndigits=2, fromIndex=None, toIndex=None, htmlFileName=None)
Launches a browser window with the colored relation map of self.
 
See corresponding :py:class:`~digraphs.Digraph.showHTMLRelationMap` method.
 
The *colorLevels* parameter may be set to 3, 5, 7 (default) or 9.
 
When the *actionsList* parameter is *None* (default), the digraphs actions list may be ranked with the *rankingRule* parameter set to the 'Copeland' (default) or to the 'Netlows' ranking rule.
 
When the *htmlFileName* parameter is set to a string value 'xxx', a html file named 'xxx.html' will be generated in the current working directory. Otherwise, a temporary file named 'tmp*.html' will be generated there.
 
Example::
 
    >>> from outrankingDigraphs import *
    >>> t = RandomCBPerformanceTableau(numberOfActions=25,seed=1)
    >>> g = BipolarOutrankingDigraph(t,ndigits=2)
    >>> gcd = ~(-g)  # strict outranking relation
    >>> gcd.showHTMLRelationHeatmap(colorLevels=7,ndigits=2)
    
.. image:: relationHeatmap.png
   :alt: Browser view of a relation map
   :width: 600 px
   :align: center
showHTMLRelationMap(self, actionsList=None, rankingRule='Copeland', Colored=True, tableTitle='Relation Map', relationName='r(x S y)', symbols=['+', '&middot;', '&nbsp;', '&#150;', '&#151'], fromIndex=None, toIndex=None, htmlFileName=None)
Launches a browser window with the colored relation map of self.
See corresponding Digraph.showRelationMap() method.
 
When *htmlFileName* parameter is set to a string value, a html file
with that name will be stored in the current working directory.
 
By default, a temporary file named: tmp*.html will be generated
instead in the current working directory.
 
Example::
 
    >>> from outrankingDigraphs import *
    >>> t = RandomCBPerformanceTableau(numberOfActions=25,seed=1)
    >>> g = BipolarOutrankingDigraph(t,Normalized=True)
    >>> gcd = ~(-g)  # strict outranking relation
    >>> gcd.showHTMLRelationMap(rankingRule="NetFlows")
    
.. image:: relationMap.png
   :alt: Browser view of a relation map
   :width: 600 px
   :align: center
showHTMLRelationTable(self, actionsList=None, relation=None, IntegerValues=False, ndigits=2, Colored=True, tableTitle='Valued Adjacency Matrix', relationName='r(x S y)', ReflexiveTerms=False, htmlFileName=None, fromIndex=None, toIndex=None)
Launches a browser window with the colored relation table of self.
showMIS(self, withListing=True)
Prints all maximal independent choices:
    Result in self.misset.
showMIS_AH(self, withListing=True)
Prints all MIS using the Hertz method.
 
Result saved in self.hertzmisset.
showMIS_HB2(self, withListing=True)
Prints all MIS using the Hertz-Bisdorff method.
 
Result saved in self.newmisset.
showMIS_RB(self, withListing=True)
Prints all MIS using the Bisdorff method.
 
Result saved in self.newmisset.
showMIS_UD(self, withListing=True)
Prints all MIS using the Hertz-Bisdorff method.
 
Result saved in self.newmisset.
showMaxAbsIrred(self, withListing=True)
Computing maximal -irredundant choices:
    Result in self.absirset.
showMaxDomIrred(self, withListing=True)
Computing maximal +irredundant choices:
   Result in self.domirset.
showMinAbs(self, withListing=True)
Prints minimal absorbent choices:
    Result in self.absset.
showMinDom(self, withListing=True)
Prints all minimal dominant choices:
    Result in self.domset.
showNeighborhoods(self)
Lists the gamma and the notGamma function of self.
showOrbits(self, InChoices, withListing=True)
Prints the orbits of Choices along the automorphisms of
the Digraph instance.
 
Example Python session for computing the non isomorphic MISs from the 12-cycle graph:
 
>>> from digraphs import *
>>> c12 = CirculantDigraph(order=12,circulants=[1,-1])
>>> c12.automorphismGenerators()
...
  Permutations
  {'1': '1', '2': '12', '3': '11', '4': '10', '5': 
   '9', '6': '8', '7': '7', '8': '6', '9': '5', '10': 
   '4', '11': '3', '12': '2'}
  {'1': '2', '2': '1', '3': '12', '4': '11', '5': '10', 
   '6': '9', '7': '8', '8': '7', '9': '6', '10': '5', 
   '11': '4', '12': '3'}
  Reflections {}
>>> print('grpsize = ', c12.automorphismGroupSize)
  grpsize = 24
>>> c12.showMIS(withListing=False)
  *---  Maximal independent choices ---*
  number of solutions:  29
  cardinality distribution
  card.:  [0, 1, 2, 3, 4,  5,  6, 7, 8, 9, 10, 11, 12]
  freq.:  [0, 0, 0, 0, 3, 24,  2, 0, 0, 0,  0,  0,  0]
  Results in c12.misset
>>> c12.showOrbits(c12.misset,withListing=False)
...
  *---- Global result ----
  Number of MIS:  29
  Number of orbits :  4
  Labelled representatives:
  1: ['2','4','6','8','10','12']
  2: ['2','5','8','11']
  3: ['2','4','6','9','11']
  4: ['1','4','7','9','11']
  Symmetry vector
  stabilizer size: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, ...]
  frequency      : [0, 2, 0, 0, 0, 0, 0, 1, 0,  0,  0,  1, ...]
 
*Figure*: The symmetry axes of the non isomorphic MISs of the 12-cycle:
 
.. image:: c12.png
   :width: 400 px
   :align: center
   :alt: The 4 non isomorphic MIS of the 12-cycle graph
 
*Reference*: R. Bisdorff and J.L. Marichal (2008). Counting non-isomorphic maximal independent sets of the n-cycle graph. *Journal of Integer Sequences*, Vol. 11 Article 08.5.7 (`openly accessible here <https://www.cs.uwaterloo.ca/journals/JIS/VOL11/Marichal/marichal.html>`_)
showOrbitsFromFile(self, InFile, withListing=True)
Prints the orbits of Choices along the automorphisms of
the digraph self by reading in the 0-1 misset file format.
See the :py:func:`digraphs.Digraph.readPerrinMisset` method.
showPreKernels(self, withListing=True)
Printing dominant and absorbent preKernels:
    Result in self.dompreKernels and self.abspreKernels
showRankingByBestChoosing(self, rankingByBestChoosing=None)
A show method for self.rankinByBestChoosing result.
 
.. warning::
 
     The self.computeRankingByBestChoosing(CoDual=False/True) method instantiating the self.rankingByBestChoosing slot is pre-required !
showRankingByChoosing(self, rankingByChoosing=None, WithCoverCredibility=False)
A show method for self.rankinByChoosing result.
 
When parameter *WithCoverCredibility* is set to True, the credibility of outranking, respectively being outranked is indicated at each selection step. 
 
.. warning::
 
     The self.computeRankingByChoosing(CoDual=False/True) method instantiating the self.rankingByChoosing slot is pre-required !
showRankingByLastChoosing(self, rankingByLastChoosing=None, Debug=None)
A show method for self.rankinByChoosing result.
 
.. warning::
 
     The self.computeRankingByLastChoosing(CoDual=False/True) method instantiating the self.rankingByChoosing slot is pre-required !
showRelation(self)
prints the relation valuation in ##.## format.
showRelationMap(self, symbols=None, rankingRule='Copeland', fromIndex=None, toIndex=None, actionsList=None)
Prints on the console, in text map format, the location of
certainly validated and certainly invalidated outranking situations.
 
By default, symbols = {'max':'┬','positive': '+', 'median': ' ',
                       'negative': '-', 'min': '┴'}
 
The default ordering of the output is following the Copeland ranking rule
from best to worst actions. Further available ranking rule is the 'NetFlows' net flows rule.
 
 
Example::
 
    >>> from outrankingDigraphs import *
    >>> t = RandomCBPerformanceTableau(numberOfActions=25,seed=1)
    >>> g = BipolarOutrankingDigraph(t,Normalized=True)
    >>> gcd = ~(-g)  # strict outranking relation
    >>> gcd.showRelationMap(rankingRule="NetFlows")
     -   ++++++++  +++++┬+┬┬+
    - -   + +++++ ++┬+┬+++┬++
    ┴+  ┴ + ++  ++++┬+┬┬++┬++
    -   ++ - ++++-++++++┬++┬+
       - - - ++- ┬- + -+┬+-┬┬
    -----  -      -┬┬┬-+  -┬┬
    ----    --+-+++++++++++++
    -- --+- --++ ++ +++-┬+-┬┬
    ----  -  -+-- ++--+++++ +
    ----- ++- --- +---++++┬ +
    -- -- ---+ -++-+++-+ +-++
    -- --┴---+  + +-++-+ -  +
    ---- ┴---+-- ++--++++ - +
      --┴┴--  --- -  --+ --┬┬
     ---------+--+ ----- +-┬┬
    -┴---┴- ---+- + ---+++┬ +
    -┴┴--┴---+--- ++ -++--+++
    -----┴--- ---+-+- ++---+ 
    -┴┴--------------- --++┬ 
    --┴---------------- --+┬ 
    ┴--┴┴ -┴--┴┴-┴ --++  ++-+
    ----┴┴--------------- -  
    ┴┴┴----+-┴+┴---┴-+---+ ┴+
    ┴┴-┴┴┴-┴- - -┴┴---┴┴+ ┬ -
    ----┴┴-┴-----┴┴---  - -- 
    Ranking rule: NetFlows
    >>>
showRelationTable(self, Sorted=True, rankingRule=None, IntegerValues=False, actionsSubset=None, relation=None, ndigits=2, ReflexiveTerms=True, fromIndex=None, toIndex=None)
Prints the relation valuation in actions X actions table format.
Copeland and NetFlows rankings my be used.
showRubisBestChoiceRecommendation(self, **kwargs)
Dummy for backward portable showBestChoiceRecommendation().
showRubyChoice(self, Verbose=False, Comments=True, _OldCoca=True)
Dummy for showBestChoiceRecommendation()
needed for older versions compatibility.
showSingletonRanking(self, Comments=True, Debug=False)
Calls self.computeSingletonRanking(comments=True,Debug = False).
Renders and prints the sorted bipolar net determinatation of outrankingness
minus outrankedness credibilities of all singleton choices.
 
res = ((netdet,sigleton,dom,absorb)+)
showStatistics(self)
Computes digraph statistics like order, size and arc-density.
showdre(self)
Shows relation in nauty format.
singletons(self)
list of singletons and neighborhoods
[(singx1, +nx1, -nx1, not(+nx1 or -nx1)),.... ]
sizeSubGraph(self, choice)
Output: (size, undeterm,arcDensity).
Renders the arc density of the induced subgraph.
strongComponents(self, setPotential=False)
Renders the set of strong components of self.
symDegreesDistribution(self)
Renders the distribution of symmetric degrees.
topologicalSort(self, Debug=False)
If self is acyclic, adds topological sort number to each node of self
and renders ordered list of nodes. Otherwise renders None.
Source: M. Golumbic Algorithmic Graph heory and Perfect Graphs,
Annals Of Discrete Mathematics 57 2nd Ed. , Elsevier 2004, Algorithm 2.4 p.44.
weakAneighbors(self, node)
Renders the set of absorbed in-neighbors of a node.
weakCondorcetLosers(self)
Renders the set of decision actions x such that
self.relation[x][y] <= self.valuationdomain['med']
for all y != x.
weakCondorcetWinners(self)
Renders the set of decision actions x such that
self.relation[x][y] >= self.valuationdomain['med']
for all y != x.
weakDneighbors(self, node)
Renders the set of dominated out-neighbors of a node.
weakGammaSets(self)
Renders the dictionary of neighborhoods {node: (dx,ax)}
zoomValuation(self, zoomFactor=1.0)
Zooms in or out, depending on the value of the zoomFactor provided,
the bipolar valuation of a digraph.

Data descriptors inherited from Digraph:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class PolarisedDigraph(Digraph)
    PolarisedDigraph(digraph=None, level=None, KeepValues=True, AlphaCut=False, StrictCut=False)
 
Renders the polarised valuation of a Digraph class instance:
 
*Parameters*:
     * If level = None, a default strict 50% cut level (0 in a normalized [-1,+1] valuation domain) is used.
     * If KeepValues = False, the polarisation results in a crisp {-1,0,1}-valued result.
     * If AlphaCut = True a genuine one-sided True-oriented cut is operated.
     * If StrictCut = True, the cut level value is excluded resulting in an open polarised valuation domain.
       By default the polarised valuation domain is closed and the complementary indeterminate domain is open.
 
 
Method resolution order:
PolarisedDigraph
Digraph
builtins.object

Methods defined here:
__init__(self, digraph=None, level=None, KeepValues=True, AlphaCut=False, StrictCut=False)
Initialize self.  See help(type(self)) for accurate signature.

Methods inherited from Digraph:
MISgen(self, S, I)
generator of maximal independent choices (voir Byskov 2004):
    * S ::= remaining nodes;
    * I ::= current independent choice
 
.. note::
 
        Inititalize: self.MISgen(self.actions.copy(),set())
__invert__(self)
Make the inverting operator ~self available for Digraph instances. 
 
Returns a ConverseDigraph instance of self.
__neg__(self)
Make the negation operator -self available for Digraph instances. 
 
Returns a DualDigraph instance of self.
__repr__(self)
Default presentation method for Digraph instances.
absirred(self, choice)
Renders the crips -irredundance degree of a choice.
absirredundant(self, U)
Generates all -irredundant choices of a digraph.
absirredval(self, choice, relation)
Renders the valued -irredundance degree of a choice.
absirredx(self, choice, x)
Computes the crips -irredundance degree of node x in a choice.
abskernelrestrict(self, prekernel)
Parameter: prekernel
Renders absorbent prekernel restricted relation.
absorb(self, choice)
Renders the absorbency degree of a choice.
absorbentChoices(self, S)
Generates all minimal absorbent choices of a bipolar valued digraph.
addValuationAttribute(self)
Adds the numpy valuation attribute
agglomerationDistribution(self)
Output: aggloCoeffDistribution, meanCoeff
Renders the distribution of agglomeration coefficients.
aneighbors(self, node)
Renders the set of absorbed in-neighbors of a node.
automorphismGenerators(self)
Adds automorphism group generators to the digraph instance.
 
.. note::
 
    Dependency: Uses the dreadnaut command from the nauty software package. See https://www3.cs.stonybrook.edu/~algorith/implement/nauty/implement.shtml
 
    On Ubuntu Linux:
      ...$ sudo apt-get install nauty
averageCoveringIndex(self, choice, direction='out')
Renders the average covering index of a given choice in a set of objects,
ie the average number of choice members that cover each
non selected object.
bipolarKCorrelation(self, digraph, Debug=False)
Renders the bipolar Kendall correlation between two bipolar valued
digraphs computed from the average valuation of the
XORDigraph(self,digraph) instance.
 
.. warning::
 
     Obsolete! Is replaced by the self.computeBipolarCorrelation(other) Digraph method
bipolarKDistance(self, digraph, Debug=False)
Renders the bipolar crisp Kendall distance between two bipolar valued
digraphs.
 
.. warning::
 
     Obsolete! Is replaced by the self.computeBipolarCorrelation(other, MedianCut=True) Digraph method
chordlessPaths(self, Pk, n2, Odd=False, Comments=False, Debug=False)
New procedure from Agrum study April 2009
recursive chordless path extraction starting from path
Pk = [n2, ...., n1] and ending in node n2.
Optimized with marking of visited chordless P1s.
circuitAverageCredibility(self, circ)
Renders the average linking credibility of a Chordless Circuit.
circuitCredibilities(self, circuit, Debug=False)
Renders the average linking credibilities and the minimal link of a Chordless Circuit.
circuitMaxCredibility(self, circ)
Renders the maximal linking credibility of a Chordless Circuit.
circuitMinCredibility(self, circ)
Renders the minimal linking credibility of a Chordless Circuit.
closeSymmetric(self, InSite=True)
Produces the symmetric closure of self.relation.
closeTransitive(self, Reverse=False, InSite=True, Comments=False)
Produces the transitive closure of self.relation
 
*Parameters*:
 
    - If *Reverse* == True (False default) all transitive links are dropped, otherwise all transitive links are closed with min[r(x,y),r(y,z)];
    - If *Insite* == False (True by default) the methods return a modified copy of self.relation without altering the original self.relation, otherwise self.relation is modified.
components(self)
Renders the list of connected components.
computeAllDensities(self, choice=None)
parameter: choice in self
renders six densitiy parameters:
arc density, double arc density,
single arc density, strict single arc density,
absence arc density, strict absence arc densitiy.
computeArrowRaynaudOrder(self)
Renders a linear ordering from worst to best of the actions following Arrow&Raynaud's rule.
computeArrowRaynaudRanking(self)
renders a linear ranking from best to worst of the actions following Arrow&Raynaud's rule.
computeAverageValuation(self)
Computes the bipolar average correlation between
self and the crisp complete digraph of same order
of the irreflexive and determined arcs of the digraph
computeBadChoices(self, Comments=False)
Computes characteristic values for potentially bad choices.
 
.. note::
 
     Returns a tuple with following content:
 
     [(0)-determ,(1)degirred,(2)degi,(3)degd,(4)dega,(5)str(choice),(6)absvec]
computeBadPirlotChoices(self, Comments=False)
Characteristic values for potentially bad choices
using the Pirlot's fixpoint algorithm.
computeBestChoiceRecommendation(self, Verbose=False, Comments=False, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True)
Sets self.bestChoice, self.bestChoiceData, self.worstChoice and self.worstChoiceData
with the showBestChoiceRecommendation method.
 
First and last choices data is the following:
[(0)-determ,(1)degirred,(2)degi,(3)degd,(4)dega,(5)str(choice),(6)domvec,(7)cover]
 
self.bestChoice = self.bestChoiceData[5]
self.worstChoice = self.worstChoiceData[5]
computeBipolarCorrelation(self, other, MedianCut=False, filterRelation=None, Debug=False)
obsolete: dummy replacement for Digraph.computeOrdinalCorrelation method
computeChordlessCircuits(self, Odd=False, Comments=False, Debug=False)
Renders the set of all chordless circuits detected in a digraph.
Result is stored in <self.circuitsList>
holding a possibly empty list of tuples with at position 0 the
list of adjacent actions of the circuit and at position 1
the set of actions in the stored circuit.
 
When *Odd* is True, only chordless circuits with an odd length
are collected.
computeChordlessCircuitsMP(self, Odd=False, Threading=False, nbrOfCPUs=None, startMethod=None, Comments=False, Debug=False)
Multiprocessing version of computeChordlessCircuits().
 
Renders the set of all chordless odd circuits detected in a digraph.
Result (possible empty list) stored in <self.circuitsList>
holding a possibly empty list tuples with at position 0 the
list of adjacent actions of the circuit and at position 1
the set of actions in the stored circuit.
Inspired by Dias, Castonguay, Longo, Jradi, Algorithmica (2015).
 
Returns a possibly empty list of tuples (circuit,frozenset(circuit)).
 
If Odd == True, only circuits of odd length are retained in the result.
computeCoSize(self)
Renders the number of non validated non reflexive arcs
computeConcentrationIndex(self, X, N)
Renders the Gini concentration index of the X serie.
N contains the partial frequencies.
Based on the triangle summation formula.
computeConcentrationIndexTrapez(self, X, N)
Renders the Gini concentration index of the X serie.
N contains the partial frequencies.
Based on the triangles summation formula.
computeCondorcetLosers(self)
Wrapper for condorcetLosers().
computeCondorcetWinners(self)
Wrapper for condorcetWinners().
computeCopelandOrder(self)
renders a linear ordering from worst to best of the actions following Arrow&Raynaud's rule.
computeCopelandRanking(self)
renders a linear ranking from best to worst of the actions following Arrow&Raynaud's rule.
computeCutLevelDensities(self, choice, level)
parameter: choice in self, robustness level
renders three robust densitiy parameters:
robust double arc density,
robust single arc density,
robust absence arc densitiy.
computeDensities(self, choice)
parameter: choice in self
renders the four densitiy parameters:
arc density, double arc density, single arc density, absence arc density.
computeDeterminateness(self, InPercents=False)
Computes the Kendalll distance of self
with the all median-valued indeterminate digraph of order n.
 
Return the average determination of the irreflexive part of the digraph.
 
*determination* = sum_(x,y) { abs[ r(xRy) - Med ] } / n(n-1)
 
If *InPercents* is True, returns the average determination in percentage of
(Max - Med) difference.
 
>>> from outrankingDigraphs import BipolarOutrankingDigraph
>>> from randomPerfTabs import Random3ObjectivesPerformanceTableau
>>> t = Random3ObjectivesPerformanceTableau(numberOfActions=7,numberOfCriteria=7,seed=101)
>>> g = BipolarOutrankingDigraph(t,Normalized=True)
>>> g
*------- Object instance description ------*
Instance class      : BipolarOutrankingDigraph
Instance name       : rel_random3ObjectivesPerfTab
Actions             : 7
Criteria            : 7
Size                : 27
Determinateness (%) : 65.67
Valuation domain    : [-1.00;1.00]
>>> print(g.computeDeterminateness())
0.3134920634920634920634920638
>>> print(g.computeDeterminateness(InPercents=True))
65.67460317460317460317460320
>>> g.recodeValuation(0,1)
>>> g
*------- Object instance description ------*
Instance class      : BipolarOutrankingDigraph
Instance name       : rel_random3ObjectivesPerfTab
Actions             : 7
Criteria            : 7
Size                : 27
Determinateness (%) : 65.67
Valuation domain    : [0.00;1.00]
>>> print(g.computeDeterminateness())
0.1567460317460317460317460318
>>> print(g.computeDeterminateness(InPercents=True))
65.67460317460317460317460320
computeDiameter(self, Oriented=True)
Renders the (by default oriented) diameter of the digraph instance
computeDigraphCentres(self, WeakDistances=False, Comments=False)
The centers of a digraph are the nodes with finite minimal shortes path lengths.
 
The maximal neighborhood distances are stored in *self.maximalNeighborhoodDistances*.
 
The corresponding digraph radius and diameter are stored respectively  in *self.radius* and *self.diameter*.
 
With *Comments* = True, all these results are printed out.
 
*Source*: Claude Berge, *The Theory of Graphs*, Dover (2001) pp. 119, original in French Dunod (1958)
computeDynamicProgrammingStages(self, source, sink, Debug=False)
Renders the discrete stages of the optimal substructure for
dynamic pogramming digrahs from a given source node 
to a given sink sink node.
 
Returns a list of list of action identifyers.
computeGoodChoiceVector(self, ker, Comments=False)
| Computing Characteristic values for dominant pre-kernels
| using the von Neumann dual fixoint equation
computeGoodChoices(self, Comments=False)
Computes characteristic values for potentially good choices.
 
..note::
 
     Return a tuple with following content:
 
     [(0)-determ,(1)degirred,(2)degi,(3)degd,(4)dega,(5)str(choice),(6)domvec,(7)cover]
computeGoodPirlotChoices(self, Comments=False)
Characteristic values for potentially good choices
using the Pirlot fixpoint algorithm.
computeIncomparabilityDegree(self, InPercents=False, Comments=False)
Renders the incomparability degree (Decimal), i.e. the relative number of symmetric indeterminate relations of the irreflexive part of a digraph.
computeKemenyIndex(self, otherRelation)
renders the Kemeny index of the self.relation
compared with a given crisp valued relation of a compatible
other digraph (same nodes or actions).
computeKemenyOrder(self, orderLimit=7, Debug=False)
Renders a ordering from worst to best of the actions with maximal Kemeny index.
Return a tuple: kemenyOrder (from worst to best), kemenyIndex
computeKemenyRanking(self, orderLimit=7, seed=None, sampleSize=1000, Debug=False)
Renders a ranking from best to worst of the actions with maximal Kemeny index.
 
.. note::
 
     Returns a tuple: kemenyRanking (from best to worst), kemenyIndex.
computeKernelVector(self, kernel, Initial=True, Comments=False)
| Computing Characteristic values for dominant pre-kernels
| using the von Neumann dual fixpoint equation
computeKohlerOrder(self)
Renders an ordering (worst to best) of the actions following Kohler's rule.
computeKohlerRanking(self)
Renders a ranking (best to worst) of the actions following Kohler's rule.
computeMaxHoleSize(self, Comments=False)
Renders the length of the largest chordless cycle
in the corresponding disjunctive undirected graph.
computeMeanInDegree(self)
Renders the mean indegree of self.
!!! self.size must be set previously !!!
computeMeanOutDegree(self)
Renders the mean degree of self.
!!! self.size must be set previously !!!
computeMeanSymDegree(self)
Renders the mean degree of self.
!!! self.size must be set previously !!!
computeMedianOutDegree(self)
Renders the median outdegree of self.
!!! self.size must be set previously !!!
computeMedianSymDegree(self)
Renders the median symmetric degree of self.
!!! self.size must be set previously !!!
computeMoreOrLessUnrelatedPairs(self)
Renders a list of more or less unrelated pairs.
computeNetFlowsOrder(self)
Renders an ordered list (from best to worst) of the actions
following the net flows ranking rule.
computeNetFlowsOrderDict(self)
Renders an ordered list (from worst to best) of the actions
following the net flows ranking rule.
computeNetFlowsRanking(self)
Renders an ordered list (from best to worst) of the actions
following the net flows ranking rule.
computeNetFlowsRankingDict(self)
Renders an ordered list (from best to worst) of the actions
following the net flows ranking rule.
computeODistance(self, op2, comments=False)
renders the squared normalized distance of
two digraph valuations.
 
.. note::
 
     op2 = digraphs of same order as self.
computeOrbit(self, choice, withListing=False)
renders the set of isomorph copies of a choice following
the automorphism of the digraph self
computeOrderCorrelation(self, order, Debug=False)
Renders the ordinal correlation K of a digraph instance
when compared with a given linear order (from worst to best) of its actions
 
K = sum_{x != y} [ min( max(-self.relation(x,y)),other.relation(x,y), max(self.relation(x,y),-other.relation(x,y)) ]
 
K /= sum_{x!=y} [ min(abs(self.relation(x,y),abs(other.relation(x,y)) ]
 
.. note::
 
     Renders a dictionary with the key 'correlation' containing the actual bipolar correlation index and the key 'determination' containing the minimal determination level D of self and the other relation.
 
     D = sum_{x != y} min(abs(self.relation(x,y)),abs(other.relation(x,y)) / n(n-1)
 
     where n is the number of actions considered.
 
     The correlation index with a completely indeterminate relation
     is by convention 0.0 at determination level 0.0 .
 
.. warning::
 
     self must be a normalized outranking digraph instance !
computeOrdinalCorrelation(self, other, MedianCut=False, filterRelation=None, Debug=False)
Renders the bipolar correlation K of a
self.relation when compared
with a given compatible (same actions set)) digraph or
a [-1,1] valued compatible relation (same actions set).
 
If MedianCut=True, the correlation is computed on the median polarized relations.
 
If filterRelation is not None, the correlation is computed on the partial domain corresponding to the determined part of the filter relation.
 
.. warning::
 
     Notice that the 'other' relation and/or the 'filterRelation',
     the case given, must both be normalized, ie [-1,1]-valued !
 
K = sum_{x != y} [ min( max(-self.relation[x][y]),other.relation[x][y]), max(self.relation[x][y],-other.relation[x][y]) ]
 
K /= sum_{x!=y} [ min(abs(self.relation[x][y]),abs(other.relation[x][y])) ]
 
.. note::
 
     Renders a tuple with at position 0 the actual bipolar correlation index
     and in position 1 the minimal determination level D of self and
     the other relation.
 
     D = sum_{x != y} min(abs(self.relation[x][y]),abs(other.relation[x][y])) / n(n-1)
 
     where n is the number of actions considered.
 
     The correlation index with a completely indeterminate relation
     is by convention 0.0 at determination level 0.0 .
computeOrdinalCorrelationMP(self, other, MedianCut=False, Threading=False, nbrOfCPUs=None, startMethod=None, Comments=False, Debug=False)
Multi processing version of the digraphs.computeOrdinalCorrelation() method.
 
.. note::
     The relation filtering and the MedinaCut option are not implemented in the MP version.
computePairwiseClusterComparison(self, K1, K2, Debug=False)
Computes the pairwise cluster comparison credibility vector
from bipolar-valued digraph g. with K1 and K2 disjoint
lists of action keys from g actions disctionary.
Returns the dictionary
{'I': Decimal(),'P+':Decimal(),'P-':Decimal(),'R' :Decimal()}
where one and only one item is strictly positive.
computePreKernels(self)
computing dominant and absorbent preKernels:
    Result in self.dompreKernels and self.abspreKernels
computePreRankingRelation(self, preRanking, Normalized=True, Debug=False)
Renders the bipolar-valued relation obtained from
a given preRanking in decreasing levels (list of lists) result.
computePreorderRelation(self, preorder, Normalized=True, Debug=False)
Renders the bipolar-valued relation obtained from
a given preordering in increasing levels (list of lists) result.
computePrincipalOrder(self, Colwise=False, Comments=False)
Rendesr an ordering from wrost to best of the decision actions.
computePrincipalRanking(self, Colwise=False, Comments=False)
Rendesr a ranking from best to worst of the decision actions.
computePrincipalScores(self, plotFileName=None, Colwise=False, imageType=None, tempDir=None, bgcolor='cornsilk', Comments=False, Debug=False)
Renders a ordered list of the first principal eigenvector of the covariance of the valued outdegrees of self.
 
.. note::
 
   The method, relying on writing and reading temporary files by default in a temporary directory is threading and multiprocessing safe !
   (see Digraph.exportPrincipalImage method)
computePrudentBetaLevel(self, Debug=False)
computes alpha, ie the lowest valuation level, for which the
bipolarly polarised digraph doesn't contain a chordless circuit.
computeRankingByBestChoosing(self, CoDual=False, Debug=False)
Computes a weak preordering of the self.actions by recursive
best choice elagations.
 
Stores in self.rankingByBestChoosing['result'] a list of (P+,bestChoice) tuples
where P+ gives the best choice complement outranking
average valuation via the computePairwiseClusterComparison
method.
 
If self.rankingByBestChoosing['CoDual'] is True, 
the ranking-by-choosing was computed on the codual of self.
computeRankingByBestChoosingRelation(self, rankingByBestChoosing=None, Debug=False)
Renders the bipolar-valued relation obtained from
the self.rankingByBestChoosing result.
computeRankingByChoosing(self, actionsSubset=None, Debug=False, CoDual=False)
Computes a weak preordring of the self.actions by iterating
jointly first and last choice elagations.
 
Stores in self.rankingByChoosing['result'] a list of ((P+,bestChoice),(P-,worstChoice)) pairs
where P+ (resp. P-) gives the best (resp. worst) choice complement outranking
(resp. outranked) average valuation via the computePairwiseClusterComparison
method.
 
If self.rankingByChoosing['CoDual'] is True, the ranking-by-choosing was computed on the codual of self.
computeRankingByChoosingRelation(self, rankingByChoosing=None, actionsSubset=None, Debug=False)
Renders the bipolar-valued relation obtained from
the self.rankingByChoosing result.
computeRankingByLastChoosing(self, CoDual=False, Debug=False)
Computes a weak preordring of the self.actions by iterating
worst choice elagations.
 
Stores in self.rankingByLastChoosing['result'] a list of (P-,worstChoice) pairs
where P- gives the worst choice complement outranked
average valuation via the computePairwiseClusterComparison
method.
 
If self.rankingByChoosing['CoDual'] is True, the ranking-by-last-chossing 
was computed on the codual of self.
computeRankingByLastChoosingRelation(self, rankingByLastChoosing=None, Debug=False)
Renders the bipolar-valued relation obtained from
the self.rankingByLastChoosing result.
computeRankingCorrelation(self, ranking, Debug=False)
Renders the ordinal correlation K of a digraph instance
when compared with a given linear ranking of its actions
 
K = sum_{x != y} [ min( max(-self.relation(x,y)),other.relation(x,y), max(self.relation(x,y),-other.relation(x,y)) ]
 
K /= sum_{x!=y} [ min(abs(self.relation(x,y),abs(other.relation(x,y)) ]
 
.. note::
 
     Renders a tuple with at position 0 the actual bipolar correlation index
     and in position 1 the minimal determination level D of self and
     the other relation.
 
     D = sum_{x != y} min(abs(self.relation(x,y)),abs(other.relation(x,y)) / n(n-1)
 
     where n is the number of actions considered.
 
     The correlation index with a completely indeterminate relation
     is by convention 0.0 at determination level 0.0 .
computeRelationalStructure(self, Debug=False)
Renders the counted decomposition of the valued relations into
the following type of links:
gt '>', eq '=', lt '<', incomp '<>',
leq '<=', geq '>=', indeterm '?'
computeRubisChoice(self, Comments=False, _OldCoca=False, BrokenCocs=True, Threading=False, nbrOfCPUs=1)
Renders self.strictGoodChoices, self.nullChoices
self.strictBadChoices, self.nonRobustChoices.
 
.. warning::
    Changes in site the outranking digraph by
    adding or braking chordless odd outranking circuits.
computeRubyChoice(self, Comments=False, _OldCoca=False)
dummy for computeRubisChoice()
old versions compatibility.
computeShortestPathLengths(self, WeakPaths=False, Comments=False, Debug=False)
Renders a double dictionary with the directed distances, i.e. the shortest path lengths between all self.actions
 
Equals *None* if there does not exist a directed path between two actions.
 
*Source*: Claude Berge, *The Theory of Graphs*, Dover (2001) pp. 119, original in French Dunod (1958)
computeSingletonRanking(self, Comments=False, Debug=False)
Renders the sorted bipolar net determinatation of outrankingness
minus outrankedness credibilities of all singleton choices.
 
res = ((netdet,singleton,dom,absorb)+)
computeSize(self)
Renders the number of validated non reflexive arcs
computeSizeTransitiveClosure(self)
Renders the size of the transitive closure of a digraph.
computeSlaterOrder(self, isProbabilistic=False, seed=None, sampleSize=1000, Debug=False)
Reversed return from computeSlaterRanking method.
computeSlaterRanking(self, isProbabilistic=False, seed=None, sampleSize=1000, Debug=False)
Renders a ranking of the actions with minimal Slater index.
Return a tuple: slaterOrder, slaterIndex
computeSymmetryDegree(self, InPercents=False, Comments=False)
Renders the symmetry degree (Decimal) of the irreflexive part of a digraph.
 
.. note::
 
   Empty and indeterminate digraphs are considered to be symmetric.
computeTopologicalRanking(self, Debug=False)
Mimetic Wrapper of the topologicalSort() method.
computeTransitivityDegree(self, InPercents=False, Comments=False)
Renders the transitivity degree (Decimal) of a digraph.
 
.. note:: 
 
   An empty or indeterminate digraph is considered to be transitive.
computeUnrelatedPairs(self)
Renders a list of more or less unrelated pairs.
computeValuationLevels(self, choice=None, Debug=False)
renders the symmetric closure of the
apparent valuations levels of self
in an increasingly ordered list.
If parameter choice is given, the
computation is limited to the actions
of the choice.
computeValuationPercentages(self, choice, percentiles, withValues=False)
Parameters: choice and list of percentiles.
renders a series of percentages of the characteristics valuation of
the arcs in the digraph.
computeValuationPercentiles(self, choice, percentages, withValues=False)
Parameters: choice and list of percentages.
renders a series of quantiles of the characteristics valuation of
the arcs in the digraph.
computeValuationStatistics(self, Sampling=False, Comments=False)
Renders the mean and variance of the valuation
of the non reflexive pairs.
computeValuedRankingRelation(self, ranking)
Renders the valued relation characteristics compatible 
with the given linar ranking. Discordant charcateristics 
are set to the indeterminate value.
computeWeakCondorcetLosers(self)
Wrapper for weakCondorcetLosers().
computeWeakCondorcetWinners(self)
Wrapper for weakCondorcetWinners().
computeupdown1(self, s, S)
Help method for show_MIS_HB2 method.
fills self.newmisset, self.upmis, self.downmis.
computeupdown2(self, s, S)
Help method for show_MIS_HB1 method.
Fills self.newmisset, self.upmis, self.downmis.
computeupdown2irred(self, s, S)
Help method for show_MIS_HB1 method.
Fills self.newmisset, self.upmis, self.downmis.
condorcetLosers(self)
Renders the set of decision actions x such that
self.relation[x][y] < self.valuationdomain['med']
for all y != x.
condorcetWinners(self)
Renders the set of decision actions x such that
self.relation[x][y] > self.valuationdomain['med']
for all y != x.
contra(self, v)
Parameter: choice.
Renders the negation of a choice v characteristic's vector.
convertRelationToDecimal(self)
Converts the float valued self.relation in a decimal valued one.
convertValuation2Integer(self, InSite=True, Comments=False)
Converts the self.relation valuation to integer values by converting the Decimals to Fractions and multiply by the least commun multiple of the fraction denominators.
 
*Parameters*:
 
    - If *Insite* == False (True by default) the method returns a modified copy of self.relation without altering the original self.relation, otherwise self.relation and self.valuationdomain is modified.
convertValuationToDecimal(self)
Convert the float valuation limits to Decimals.
coveringIndex(self, choice, direction='out')
Renders the covering index of a given choice in a set of objects,
ie the minimum number of choice members that cover each
non selected object.
crispKDistance(self, digraph, Debug=False)
Renders the crisp Kendall distance between two bipolar valued
digraphs.
 
.. warning::
 
     Obsolete! Is replaced by the self.computeBipolarCorrelation(other, MedianCut=True) Digraph method
detectChordlessCircuits(self, Comments=False, Debug=False)
Detects a chordless circuit in a digraph.
Returns a Boolean
detectChordlessPath(self, Pk, n2, Comments=False, Debug=False)
New procedure from Agrum study April 2009
recursive chordless path extraction starting from path
Pk = [n2, ...., n1] and ending in node n2.
Optimized with marking of visited chordless P1s.
determinateness(self, vec, inPercent=True)
Renders the determinateness of a characteristic vector *vec* = 
[(r(x),x),(r(y),y), ...] of length *n* in valuationdomain [Min,Med,Max]:
 
*result* =  sum_x( abs(r(x)-Med) ) / ( n*(Max-Med) )
 
If inPercent, *result* shifted (+1) and reduced (/2) to [0,1] range.
digraph2Graph(self, valuationDomain={'min': -1, 'med': 0, 'max': 1}, Debug=False, ConjunctiveConversion=True)
Convert a Digraph instance to a Graph instance.
dneighbors(self, node)
Renders the set of dominated out-neighbors of a node.
domin(self, choice)
Renders the dominance degree of a choice.
dominantChoices(self, S)
Generates all minimal dominant choices of a bipolar valued digraph.
 
.. note::
 
     Initiate with S = self.actions.copy().
domirred(self, choice)
Renders the crips +irredundance degree of a choice.
domirredval(self, choice, relation)
Renders the valued +irredundance degree of a choice.
domirredx(self, choice, x)
Renders the crips +irredundance degree of node x in a choice.
domkernelrestrict(self, prekernel)
Parameter: dominant prekernel
Renders dominant prekernel restricted relation.
exportGraphViz(self, fileName=None, actionsSubset=None, bestChoice=set(), worstChoice=set(), firstChoice=set(), lastChoice=set(), Comments=True, graphType='png', pictureFormat=None, graphSize='7,7', relation=None, bgcolor='cornsilk')
export GraphViz dot file  for graph drawing filtering.
exportPrincipalImage(self, plotFileName=None, pictureFormat='pdf', bgcolor='cornsilk', fontcolor='red3', fontsize='0.75', Reduced=False, Colwise=False, tempDir='.', Comments=False)
Export as PDF (default) the principal projection of
the valued relation using the three principal eigen vectors.
 
Implemeted picture formats are: 
'pdf' (default), 'png', 'jpeg' and 'xfig'.
 
The background color is set by default to 'cornsilk'. 
 
Font size and color are set by default to 'red3', resp. '0.75'. 
 
When *Reduced==True*, the valued relation characeteristics are centered and reduced.
 
When *Colwise==True*, the column vectors of the adjacency table are used for the principal projection, otherwise the rows (default) are used. Has no incidence when the *Digraph* instance *self*  is symmetric. 
 
.. warning::
 
    The method, writing and reading temporary files: 
    tempCol.r and rotationCol.csv, resp. tempRow.r and rotationRow.csv,
    by default in the working directory (./),
    is hence not safe for multiprocessing programs, unless a
    temporary directory *tempDir* is provided.
flatChoice(self, ch, Debug=False)
Converts set or list ch recursively to a flat list of items.
forcedBestSingleChoice(self)
Renders the set of most determined outranking singletons in self.
gammaSets(self)
Renders the dictionary of neighborhoods {node: (dx,ax)}
with set *dx* gathering the dominated, and set *ax* gathering
the absorbed neighborhood.
generateAbsPreKernels(self)
Generate all absorbent prekernels from independent choices generator.
generateDomPreKernels(self)
Generate all dominant prekernels from independent choices generator.
htmlChoiceVector(self, ch, ChoiceVector=True, choiceType='good')
Show procedure for annotated bipolar choices.
inDegrees(self)
renders the median cut indegrees
inDegreesDistribution(self)
Renders the distribution of indegrees.
independentChoices(self, U)
Generator for all independent choices with neighborhoods of a bipolar valued digraph:
 
.. note::
 
       * Initiate with U = self.singletons().
       * Yields [(independent choice, domnb, absnb, indnb)].
inner_prod(self, v1, v2)
Parameters: two choice characteristic vectors
Renders the inner product of two characteristic vetors.
intstab(self, choice)
Computes the independence degree of a choice.
irreflex(self, mat)
Puts diagonal entries of mat to valuationdomain['min']
isAsymmetricIndeterminate(self, Debug=False)
Checks the self.relation for assymmetric indeterminateness!!
 
.. warning::
 
    The reflexive links are ignored !!
isComplete(self, Debug=False)
checks the completeness property of self.relation by checking
for the absence of a link between two actions!!
 
.. warning::
 
    The reflexive links are ignored !!
isCyclic(self, Debug=False)
checks the cyclicity of self.relation by checking
for a reflexive loop in its transitive closure-
 
.. warning::
 
     self.relation is supposed to be irreflexive !
isIntegerValued(self, Debug=False)
Checks whether the decimal valuation of self is integer-valued
be using the as_integer_ratio() method of a Decimal 
giving a tuple (numerator,denominator). If denominator == 1, the
number is an integer.
isOutrankingDigraph(self, Comments=True, Debug=False)
Checks the outranking digraph characteristic condition (3.3).
 
relation[x][y] + relation[y][x)[y] >= 0.0
 
.. warning::
 
    The reflexive links are ignored and the valuation must be bipolar !!
isStrictOutrankingDigraph(self, Comments=True, Debug=False)
Checks the strict outranking digraph characteristic condition (3.1).
 
-(relation[x][y] + relation[y][x]) <= 0.0 , x != y
 
.. warning::
 
    The reflexive links are ignored and the valuation must be bipolar !!
isSymmetric(self, Comments=False)
True if symmetry degree == 1.0.
isTransitive(self, Comments=False)
True if transitivity degree == 1.0.
isWeaklyComplete(self, Debug=False)
checks the weakly completeness property of self.relation by checking
for the absence of a link between two actions!!
 
.. warning::
 
    The reflexive links are ignored !!
iterateRankingByChoosing(self, Odd=False, CoDual=False, Comments=True, Debug=False, Limited=None)
Renders a ranking by choosing result when progressively eliminating
all chordless (odd only) circuits with rising valuation cut levels.
 
Parameters
    CoDual = False (default)/True
    Limited = proportion (in [0,1]) * (max - med) valuationdomain
kChoices(self, A, k)
Renders all choices of length k from set A
matmult2(self, m, v)
Parameters: digraph relation and choice characteristic vector
matrix multiply vector by inner production
meanDegree(self)
Renders the mean degree of self.
!!! self.size must be set previously !!!
meanLength(self, Oriented=False)
Renders the (by default non-oriented) mean neighbourhoor depth of self.
!!! self.order must be set previously !!!
minimalChoices(self, S)
Generates all dominant or absorbent choices of a bipolar
valued digraph.
 
.. note:
 
   * Initiate with S = (actions, dict of dominant or absorbent closed neighborhoods)
   * See showMinDom and showMinAbs methods.
minimalValuationLevelForCircuitsElimination(self, Odd=True, Debug=False, Comments=False)
renders the minimal valuation level <lambda> that eliminates all
self.circuitsList stored odd chordless circuits from self.
 
.. warning::
 
    The <lambda> level polarised may still contain newly appearing chordless odd circuits !
neighbourhoodCollection(self, Oriented=False, Potential=False)
Renders the neighbourhood.
neighbourhoodDepthDistribution(self, Oriented=False)
Renders the distribtion of neighbourhood depths.
notGammaSets(self)
Renders the dictionary of neighborhoods {node: (dx,ax)}
with set *dx* gathering the not dominated, and set *ax* gathering
the not absorbed neighborhood.
notaneighbors(self, node)
Renders the set of absorbed not in-neighbors of a node.
notdneighbors(self, node)
Renders the set of not dominated out-neighbors of a node.
outDegrees(self)
renders the median cut outdegrees
outDegreesDistribution(self)
Renders the distribution of outdegrees.
plusirredundant(self, U)
Generates all +irredundant choices of a digraph.
powerset(self, U)
Generates all subsets of a set.
readPerrinMisset(self, file='curd.dat')
read method for 0-1-char-coded MISs by default from the perrinMIS.c curd.dat result file.
readabsvector(self, x, relation)
Parameter: action x
absorbent in vector.
readdomvector(self, x, relation)
Parameter: action x
dominant out vector.
recodeValuation(self, newMin=-1.0, newMax=1.0, ndigits=4, Debug=False)
Recodes the characteristic valuation domain according
to the parameters given. 
 
*ndigits* indicates the number of decimal digits of the valuation.
relationFct(self, x, y)
wrapper for self.relation dictionary access to ensure interoperability
with the sparse and big outranking digraph implementation model.
save(self, fileName='tempdigraph', option=None, DecimalValuation=True, decDigits=2)
Persistent storage of a Digraph class instance in the form of
a python source code file
saveCSV(self, fileName='tempdigraph', Normalized=False, Dual=False, Converse=False, Diagonal=False, Debug=False)
Persistent storage of a Digraph class instance in the form of
a csv file.
saveXMCDA2(self, fileName='temp', fileExt='xmcda2', Comments=True, relationName='R', relationType='binary', category='random', subcategory='valued', author='digraphs Module (RB)', reference='saved from Python', valuationType='standard', digits=2, servingD3=False)
save digraph in XMCDA 2.0 format. Deprecated now.
savedre(self, fileName='temp')
save digraph in nauty format.
sharp(self, x, y)
Paramaters: choice characteristic values.
Renders the sharpest of two characteristic values x and y.
sharpvec(self, v, w)
Paramaters: choice characteristic vectors.
Renders the sharpest of two characteristic vectors v and w.
showActions(self)
presentation methods for digraphs actions
showAll(self)
Detailed show method for genuine digraphs.
showAttributes(self)
Prints out the attributes of self.
showAutomorphismGenerators(self)
Renders the generators of the automorphism group.
showBadChoices(self, Recompute=True)
Characteristic values for potentially bad choices.
showBestChoiceRecommendation(self, Verbose=False, Comments=True, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True)
Shows the RuBis best choice recommendation.
 
.. note::
 
    Computes by default the Rubis best choice recommendation on the corresponding strict (codual) outranking digraph.
 
    By default, with BrokenCocs=True, we brake all chordless circuits at their weakest determined ( abs(r(x>y)) + abs(r(y>x)) ) link.
 
    When BrokenCocs=False we proceed like follows:
 
    In case of chordless circuits, if supporting arcs are more credible
    than the reversed negating arcs, we collapse the circuits into hyper nodes.
    Inversely,  if supporting arcs are not more credible than the reversed negating arcs,
    we brake the circuits on their weakest arc.
 
Usage example:
 
>>> from outrankingDigraphs import *
>>> t = Random3ObjectivesPerformanceTableau(seed=5)
>>> g = BipolarOutrankingDigraph(t)
>>> g.showBestChoiceRecommendation()
***********************
RuBis Best Choice Recommendation (BCR)
(in decreasing order of determinateness)   
Credibility domain:  [-100.0, 100.0]
=== >> potential first choices
* choice              : ['a04', 'a14', 'a19', 'a20']
   independence        : 1.19
   dominance           : 4.76
   absorbency          : -59.52
   covering (%)        : 75.00
   determinateness (%) : 57.86
   - most credible action(s) = { 'a14': 23.81, 'a19': 11.90, 'a04': 2.38, 'a20': 1.19, }  
=== >> potential last choices 
* choice              : ['a03', 'a12', 'a17']
  independence        : 4.76
  dominance           : -76.19
  absorbency          : 4.76
  covering (%)        : 0.00
  determinateness (%) : 65.39
  - most credible action(s) = { 'a03': 38.10, 'a12': 13.10, 'a17': 4.76, }
Execution time: 0.024 seconds
*****************************
showChoiceVector(self, ch, choiceType='good', ChoiceVector=True)
Show procedure for annotated bipolar choices.
showChordlessCircuits(self, Recompute=False)
Show method for chordless circuits observed in a Digraph instance.
 
If previous computation is required, stores the detected circuits in self.circuitsList attribute.
showComponents(self)
Shows the list of connected components of the digraph instance.
showCorrelation(self, corr=None, ndigits=3)
Renders the valued ordinal correlation index, the crisp Kendall tau index and their epistemic determination degree.
showFirstChoiceRecommendation(self, Verbose=False, Comments=True, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True)
Shows the RuBis first choice recommendation.
 
.. note::
 
    Computes by default the Rubis first choice recommendation on the corresponding strict (codual) outranking digraph.
 
    By default, with BrokenCocs=True, we brake all chordless circuits at their weakest determined ( abs(r(x>y)) + abs(r(y>x)) ) link.
 
    When BrokenCocs=False we proceed like follows:
 
    In case of chordless circuits, if supporting arcs are more credible
    than the reversed negating arcs, we collapse the circuits into hyper nodes.
    Inversely,  if supporting arcs are not more credible than the reversed negating arcs,
    we brake the circuits on their weakest arc.
 
Usage example:
 
>>> from outrankingDigraphs import *
>>> t = Random3ObjectivesPerformanceTableau(seed=5)
>>> g = BipolarOutrankingDigraph(t)
>>> g.showFirstChoiceRecommendation()
***********************
RuBis First Choice Recommendation (BCR)
(in decreasing order of determinateness)   
Credibility domain:  [-100.0, 100.0]
=== >> potential first choices
* choice              : ['a04', 'a14', 'a19', 'a20']
   independence        : 1.19
   dominance           : 4.76
   absorbency          : -59.52
   covering (%)        : 75.00
   determinateness (%) : 57.86
   - most credible action(s) = { 'a14': 23.81, 'a19': 11.90, 'a04': 2.38, 'a20': 1.19, }  
=== >> potential last choices 
* choice              : ['a03', 'a12', 'a17']
  independence        : 4.76
  dominance           : -76.19
  absorbency          : 4.76
  covering (%)        : 0.00
  determinateness (%) : 65.39
  - most credible action(s) = { 'a03': 38.10, 'a12': 13.10, 'a17': 4.76, }
Execution time: 0.024 seconds
*****************************
showGoodChoices(self, Recompute=True)
Characteristic values for potentially good choices.
showHTMLBestChoiceRecommendation(self, pageTitle=None, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True, htmlFileName=None)
showHTMLRelationHeatmap(self, actionsList=None, rankingRule='NetFlows', colorLevels=7, tableTitle='Relation Heatmap', relationName='r(x S y)', ndigits=2, fromIndex=None, toIndex=None, htmlFileName=None)
Launches a browser window with the colored relation map of self.
 
See corresponding :py:class:`~digraphs.Digraph.showHTMLRelationMap` method.
 
The *colorLevels* parameter may be set to 3, 5, 7 (default) or 9.
 
When the *actionsList* parameter is *None* (default), the digraphs actions list may be ranked with the *rankingRule* parameter set to the 'Copeland' (default) or to the 'Netlows' ranking rule.
 
When the *htmlFileName* parameter is set to a string value 'xxx', a html file named 'xxx.html' will be generated in the current working directory. Otherwise, a temporary file named 'tmp*.html' will be generated there.
 
Example::
 
    >>> from outrankingDigraphs import *
    >>> t = RandomCBPerformanceTableau(numberOfActions=25,seed=1)
    >>> g = BipolarOutrankingDigraph(t,ndigits=2)
    >>> gcd = ~(-g)  # strict outranking relation
    >>> gcd.showHTMLRelationHeatmap(colorLevels=7,ndigits=2)
    
.. image:: relationHeatmap.png
   :alt: Browser view of a relation map
   :width: 600 px
   :align: center
showHTMLRelationMap(self, actionsList=None, rankingRule='Copeland', Colored=True, tableTitle='Relation Map', relationName='r(x S y)', symbols=['+', '&middot;', '&nbsp;', '&#150;', '&#151'], fromIndex=None, toIndex=None, htmlFileName=None)
Launches a browser window with the colored relation map of self.
See corresponding Digraph.showRelationMap() method.
 
When *htmlFileName* parameter is set to a string value, a html file
with that name will be stored in the current working directory.
 
By default, a temporary file named: tmp*.html will be generated
instead in the current working directory.
 
Example::
 
    >>> from outrankingDigraphs import *
    >>> t = RandomCBPerformanceTableau(numberOfActions=25,seed=1)
    >>> g = BipolarOutrankingDigraph(t,Normalized=True)
    >>> gcd = ~(-g)  # strict outranking relation
    >>> gcd.showHTMLRelationMap(rankingRule="NetFlows")
    
.. image:: relationMap.png
   :alt: Browser view of a relation map
   :width: 600 px
   :align: center
showHTMLRelationTable(self, actionsList=None, relation=None, IntegerValues=False, ndigits=2, Colored=True, tableTitle='Valued Adjacency Matrix', relationName='r(x S y)', ReflexiveTerms=False, htmlFileName=None, fromIndex=None, toIndex=None)
Launches a browser window with the colored relation table of self.
showMIS(self, withListing=True)
Prints all maximal independent choices:
    Result in self.misset.
showMIS_AH(self, withListing=True)
Prints all MIS using the Hertz method.
 
Result saved in self.hertzmisset.
showMIS_HB2(self, withListing=True)
Prints all MIS using the Hertz-Bisdorff method.
 
Result saved in self.newmisset.
showMIS_RB(self, withListing=True)
Prints all MIS using the Bisdorff method.
 
Result saved in self.newmisset.
showMIS_UD(self, withListing=True)
Prints all MIS using the Hertz-Bisdorff method.
 
Result saved in self.newmisset.
showMaxAbsIrred(self, withListing=True)
Computing maximal -irredundant choices:
    Result in self.absirset.
showMaxDomIrred(self, withListing=True)
Computing maximal +irredundant choices:
   Result in self.domirset.
showMinAbs(self, withListing=True)
Prints minimal absorbent choices:
    Result in self.absset.
showMinDom(self, withListing=True)
Prints all minimal dominant choices:
    Result in self.domset.
showNeighborhoods(self)
Lists the gamma and the notGamma function of self.
showOrbits(self, InChoices, withListing=True)
Prints the orbits of Choices along the automorphisms of
the Digraph instance.
 
Example Python session for computing the non isomorphic MISs from the 12-cycle graph:
 
>>> from digraphs import *
>>> c12 = CirculantDigraph(order=12,circulants=[1,-1])
>>> c12.automorphismGenerators()
...
  Permutations
  {'1': '1', '2': '12', '3': '11', '4': '10', '5': 
   '9', '6': '8', '7': '7', '8': '6', '9': '5', '10': 
   '4', '11': '3', '12': '2'}
  {'1': '2', '2': '1', '3': '12', '4': '11', '5': '10', 
   '6': '9', '7': '8', '8': '7', '9': '6', '10': '5', 
   '11': '4', '12': '3'}
  Reflections {}
>>> print('grpsize = ', c12.automorphismGroupSize)
  grpsize = 24
>>> c12.showMIS(withListing=False)
  *---  Maximal independent choices ---*
  number of solutions:  29
  cardinality distribution
  card.:  [0, 1, 2, 3, 4,  5,  6, 7, 8, 9, 10, 11, 12]
  freq.:  [0, 0, 0, 0, 3, 24,  2, 0, 0, 0,  0,  0,  0]
  Results in c12.misset
>>> c12.showOrbits(c12.misset,withListing=False)
...
  *---- Global result ----
  Number of MIS:  29
  Number of orbits :  4
  Labelled representatives:
  1: ['2','4','6','8','10','12']
  2: ['2','5','8','11']
  3: ['2','4','6','9','11']
  4: ['1','4','7','9','11']
  Symmetry vector
  stabilizer size: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, ...]
  frequency      : [0, 2, 0, 0, 0, 0, 0, 1, 0,  0,  0,  1, ...]
 
*Figure*: The symmetry axes of the non isomorphic MISs of the 12-cycle:
 
.. image:: c12.png
   :width: 400 px
   :align: center
   :alt: The 4 non isomorphic MIS of the 12-cycle graph
 
*Reference*: R. Bisdorff and J.L. Marichal (2008). Counting non-isomorphic maximal independent sets of the n-cycle graph. *Journal of Integer Sequences*, Vol. 11 Article 08.5.7 (`openly accessible here <https://www.cs.uwaterloo.ca/journals/JIS/VOL11/Marichal/marichal.html>`_)
showOrbitsFromFile(self, InFile, withListing=True)
Prints the orbits of Choices along the automorphisms of
the digraph self by reading in the 0-1 misset file format.
See the :py:func:`digraphs.Digraph.readPerrinMisset` method.
showPreKernels(self, withListing=True)
Printing dominant and absorbent preKernels:
    Result in self.dompreKernels and self.abspreKernels
showRankingByBestChoosing(self, rankingByBestChoosing=None)
A show method for self.rankinByBestChoosing result.
 
.. warning::
 
     The self.computeRankingByBestChoosing(CoDual=False/True) method instantiating the self.rankingByBestChoosing slot is pre-required !
showRankingByChoosing(self, rankingByChoosing=None, WithCoverCredibility=False)
A show method for self.rankinByChoosing result.
 
When parameter *WithCoverCredibility* is set to True, the credibility of outranking, respectively being outranked is indicated at each selection step. 
 
.. warning::
 
     The self.computeRankingByChoosing(CoDual=False/True) method instantiating the self.rankingByChoosing slot is pre-required !
showRankingByLastChoosing(self, rankingByLastChoosing=None, Debug=None)
A show method for self.rankinByChoosing result.
 
.. warning::
 
     The self.computeRankingByLastChoosing(CoDual=False/True) method instantiating the self.rankingByChoosing slot is pre-required !
showRelation(self)
prints the relation valuation in ##.## format.
showRelationMap(self, symbols=None, rankingRule='Copeland', fromIndex=None, toIndex=None, actionsList=None)
Prints on the console, in text map format, the location of
certainly validated and certainly invalidated outranking situations.
 
By default, symbols = {'max':'┬','positive': '+', 'median': ' ',
                       'negative': '-', 'min': '┴'}
 
The default ordering of the output is following the Copeland ranking rule
from best to worst actions. Further available ranking rule is the 'NetFlows' net flows rule.
 
 
Example::
 
    >>> from outrankingDigraphs import *
    >>> t = RandomCBPerformanceTableau(numberOfActions=25,seed=1)
    >>> g = BipolarOutrankingDigraph(t,Normalized=True)
    >>> gcd = ~(-g)  # strict outranking relation
    >>> gcd.showRelationMap(rankingRule="NetFlows")
     -   ++++++++  +++++┬+┬┬+
    - -   + +++++ ++┬+┬+++┬++
    ┴+  ┴ + ++  ++++┬+┬┬++┬++
    -   ++ - ++++-++++++┬++┬+
       - - - ++- ┬- + -+┬+-┬┬
    -----  -      -┬┬┬-+  -┬┬
    ----    --+-+++++++++++++
    -- --+- --++ ++ +++-┬+-┬┬
    ----  -  -+-- ++--+++++ +
    ----- ++- --- +---++++┬ +
    -- -- ---+ -++-+++-+ +-++
    -- --┴---+  + +-++-+ -  +
    ---- ┴---+-- ++--++++ - +
      --┴┴--  --- -  --+ --┬┬
     ---------+--+ ----- +-┬┬
    -┴---┴- ---+- + ---+++┬ +
    -┴┴--┴---+--- ++ -++--+++
    -----┴--- ---+-+- ++---+ 
    -┴┴--------------- --++┬ 
    --┴---------------- --+┬ 
    ┴--┴┴ -┴--┴┴-┴ --++  ++-+
    ----┴┴--------------- -  
    ┴┴┴----+-┴+┴---┴-+---+ ┴+
    ┴┴-┴┴┴-┴- - -┴┴---┴┴+ ┬ -
    ----┴┴-┴-----┴┴---  - -- 
    Ranking rule: NetFlows
    >>>
showRelationTable(self, Sorted=True, rankingRule=None, IntegerValues=False, actionsSubset=None, relation=None, ndigits=2, ReflexiveTerms=True, fromIndex=None, toIndex=None)
Prints the relation valuation in actions X actions table format.
Copeland and NetFlows rankings my be used.
showRubisBestChoiceRecommendation(self, **kwargs)
Dummy for backward portable showBestChoiceRecommendation().
showRubyChoice(self, Verbose=False, Comments=True, _OldCoca=True)
Dummy for showBestChoiceRecommendation()
needed for older versions compatibility.
showShort(self)
concise presentation method for genuine digraphs.
showSingletonRanking(self, Comments=True, Debug=False)
Calls self.computeSingletonRanking(comments=True,Debug = False).
Renders and prints the sorted bipolar net determinatation of outrankingness
minus outrankedness credibilities of all singleton choices.
 
res = ((netdet,sigleton,dom,absorb)+)
showStatistics(self)
Computes digraph statistics like order, size and arc-density.
showdre(self)
Shows relation in nauty format.
singletons(self)
list of singletons and neighborhoods
[(singx1, +nx1, -nx1, not(+nx1 or -nx1)),.... ]
sizeSubGraph(self, choice)
Output: (size, undeterm,arcDensity).
Renders the arc density of the induced subgraph.
strongComponents(self, setPotential=False)
Renders the set of strong components of self.
symDegreesDistribution(self)
Renders the distribution of symmetric degrees.
topologicalSort(self, Debug=False)
If self is acyclic, adds topological sort number to each node of self
and renders ordered list of nodes. Otherwise renders None.
Source: M. Golumbic Algorithmic Graph heory and Perfect Graphs,
Annals Of Discrete Mathematics 57 2nd Ed. , Elsevier 2004, Algorithm 2.4 p.44.
weakAneighbors(self, node)
Renders the set of absorbed in-neighbors of a node.
weakCondorcetLosers(self)
Renders the set of decision actions x such that
self.relation[x][y] <= self.valuationdomain['med']
for all y != x.
weakCondorcetWinners(self)
Renders the set of decision actions x such that
self.relation[x][y] >= self.valuationdomain['med']
for all y != x.
weakDneighbors(self, node)
Renders the set of dominated out-neighbors of a node.
weakGammaSets(self)
Renders the dictionary of neighborhoods {node: (dx,ax)}
zoomValuation(self, zoomFactor=1.0)
Zooms in or out, depending on the value of the zoomFactor provided,
the bipolar valuation of a digraph.

Data descriptors inherited from Digraph:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class RedhefferDigraph(Digraph)
    RedhefferDigraph(order=5, valuationdomain=(-1.0, 1.0))
 
Specialization of the general Digraph class for generating
temporary Redheffer digraphs.
 
https://en.wikipedia.org/wiki/Redheffer_matrix
 
Parameters:
    order > 0; valuationdomain=(Min,Max).
 
 
Method resolution order:
RedhefferDigraph
Digraph
builtins.object

Methods defined here:
__init__(self, order=5, valuationdomain=(-1.0, 1.0))
Initialize self.  See help(type(self)) for accurate signature.

Methods inherited from Digraph:
MISgen(self, S, I)
generator of maximal independent choices (voir Byskov 2004):
    * S ::= remaining nodes;
    * I ::= current independent choice
 
.. note::
 
        Inititalize: self.MISgen(self.actions.copy(),set())
__invert__(self)
Make the inverting operator ~self available for Digraph instances. 
 
Returns a ConverseDigraph instance of self.
__neg__(self)
Make the negation operator -self available for Digraph instances. 
 
Returns a DualDigraph instance of self.
__repr__(self)
Default presentation method for Digraph instances.
absirred(self, choice)
Renders the crips -irredundance degree of a choice.
absirredundant(self, U)
Generates all -irredundant choices of a digraph.
absirredval(self, choice, relation)
Renders the valued -irredundance degree of a choice.
absirredx(self, choice, x)
Computes the crips -irredundance degree of node x in a choice.
abskernelrestrict(self, prekernel)
Parameter: prekernel
Renders absorbent prekernel restricted relation.
absorb(self, choice)
Renders the absorbency degree of a choice.
absorbentChoices(self, S)
Generates all minimal absorbent choices of a bipolar valued digraph.
addValuationAttribute(self)
Adds the numpy valuation attribute
agglomerationDistribution(self)
Output: aggloCoeffDistribution, meanCoeff
Renders the distribution of agglomeration coefficients.
aneighbors(self, node)
Renders the set of absorbed in-neighbors of a node.
automorphismGenerators(self)
Adds automorphism group generators to the digraph instance.
 
.. note::
 
    Dependency: Uses the dreadnaut command from the nauty software package. See https://www3.cs.stonybrook.edu/~algorith/implement/nauty/implement.shtml
 
    On Ubuntu Linux:
      ...$ sudo apt-get install nauty
averageCoveringIndex(self, choice, direction='out')
Renders the average covering index of a given choice in a set of objects,
ie the average number of choice members that cover each
non selected object.
bipolarKCorrelation(self, digraph, Debug=False)
Renders the bipolar Kendall correlation between two bipolar valued
digraphs computed from the average valuation of the
XORDigraph(self,digraph) instance.
 
.. warning::
 
     Obsolete! Is replaced by the self.computeBipolarCorrelation(other) Digraph method
bipolarKDistance(self, digraph, Debug=False)
Renders the bipolar crisp Kendall distance between two bipolar valued
digraphs.
 
.. warning::
 
     Obsolete! Is replaced by the self.computeBipolarCorrelation(other, MedianCut=True) Digraph method
chordlessPaths(self, Pk, n2, Odd=False, Comments=False, Debug=False)
New procedure from Agrum study April 2009
recursive chordless path extraction starting from path
Pk = [n2, ...., n1] and ending in node n2.
Optimized with marking of visited chordless P1s.
circuitAverageCredibility(self, circ)
Renders the average linking credibility of a Chordless Circuit.
circuitCredibilities(self, circuit, Debug=False)
Renders the average linking credibilities and the minimal link of a Chordless Circuit.
circuitMaxCredibility(self, circ)
Renders the maximal linking credibility of a Chordless Circuit.
circuitMinCredibility(self, circ)
Renders the minimal linking credibility of a Chordless Circuit.
closeSymmetric(self, InSite=True)
Produces the symmetric closure of self.relation.
closeTransitive(self, Reverse=False, InSite=True, Comments=False)
Produces the transitive closure of self.relation
 
*Parameters*:
 
    - If *Reverse* == True (False default) all transitive links are dropped, otherwise all transitive links are closed with min[r(x,y),r(y,z)];
    - If *Insite* == False (True by default) the methods return a modified copy of self.relation without altering the original self.relation, otherwise self.relation is modified.
components(self)
Renders the list of connected components.
computeAllDensities(self, choice=None)
parameter: choice in self
renders six densitiy parameters:
arc density, double arc density,
single arc density, strict single arc density,
absence arc density, strict absence arc densitiy.
computeArrowRaynaudOrder(self)
Renders a linear ordering from worst to best of the actions following Arrow&Raynaud's rule.
computeArrowRaynaudRanking(self)
renders a linear ranking from best to worst of the actions following Arrow&Raynaud's rule.
computeAverageValuation(self)
Computes the bipolar average correlation between
self and the crisp complete digraph of same order
of the irreflexive and determined arcs of the digraph
computeBadChoices(self, Comments=False)
Computes characteristic values for potentially bad choices.
 
.. note::
 
     Returns a tuple with following content:
 
     [(0)-determ,(1)degirred,(2)degi,(3)degd,(4)dega,(5)str(choice),(6)absvec]
computeBadPirlotChoices(self, Comments=False)
Characteristic values for potentially bad choices
using the Pirlot's fixpoint algorithm.
computeBestChoiceRecommendation(self, Verbose=False, Comments=False, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True)
Sets self.bestChoice, self.bestChoiceData, self.worstChoice and self.worstChoiceData
with the showBestChoiceRecommendation method.
 
First and last choices data is the following:
[(0)-determ,(1)degirred,(2)degi,(3)degd,(4)dega,(5)str(choice),(6)domvec,(7)cover]
 
self.bestChoice = self.bestChoiceData[5]
self.worstChoice = self.worstChoiceData[5]
computeBipolarCorrelation(self, other, MedianCut=False, filterRelation=None, Debug=False)
obsolete: dummy replacement for Digraph.computeOrdinalCorrelation method
computeChordlessCircuits(self, Odd=False, Comments=False, Debug=False)
Renders the set of all chordless circuits detected in a digraph.
Result is stored in <self.circuitsList>
holding a possibly empty list of tuples with at position 0 the
list of adjacent actions of the circuit and at position 1
the set of actions in the stored circuit.
 
When *Odd* is True, only chordless circuits with an odd length
are collected.
computeChordlessCircuitsMP(self, Odd=False, Threading=False, nbrOfCPUs=None, startMethod=None, Comments=False, Debug=False)
Multiprocessing version of computeChordlessCircuits().
 
Renders the set of all chordless odd circuits detected in a digraph.
Result (possible empty list) stored in <self.circuitsList>
holding a possibly empty list tuples with at position 0 the
list of adjacent actions of the circuit and at position 1
the set of actions in the stored circuit.
Inspired by Dias, Castonguay, Longo, Jradi, Algorithmica (2015).
 
Returns a possibly empty list of tuples (circuit,frozenset(circuit)).
 
If Odd == True, only circuits of odd length are retained in the result.
computeCoSize(self)
Renders the number of non validated non reflexive arcs
computeConcentrationIndex(self, X, N)
Renders the Gini concentration index of the X serie.
N contains the partial frequencies.
Based on the triangle summation formula.
computeConcentrationIndexTrapez(self, X, N)
Renders the Gini concentration index of the X serie.
N contains the partial frequencies.
Based on the triangles summation formula.
computeCondorcetLosers(self)
Wrapper for condorcetLosers().
computeCondorcetWinners(self)
Wrapper for condorcetWinners().
computeCopelandOrder(self)
renders a linear ordering from worst to best of the actions following Arrow&Raynaud's rule.
computeCopelandRanking(self)
renders a linear ranking from best to worst of the actions following Arrow&Raynaud's rule.
computeCutLevelDensities(self, choice, level)
parameter: choice in self, robustness level
renders three robust densitiy parameters:
robust double arc density,
robust single arc density,
robust absence arc densitiy.
computeDensities(self, choice)
parameter: choice in self
renders the four densitiy parameters:
arc density, double arc density, single arc density, absence arc density.
computeDeterminateness(self, InPercents=False)
Computes the Kendalll distance of self
with the all median-valued indeterminate digraph of order n.
 
Return the average determination of the irreflexive part of the digraph.
 
*determination* = sum_(x,y) { abs[ r(xRy) - Med ] } / n(n-1)
 
If *InPercents* is True, returns the average determination in percentage of
(Max - Med) difference.
 
>>> from outrankingDigraphs import BipolarOutrankingDigraph
>>> from randomPerfTabs import Random3ObjectivesPerformanceTableau
>>> t = Random3ObjectivesPerformanceTableau(numberOfActions=7,numberOfCriteria=7,seed=101)
>>> g = BipolarOutrankingDigraph(t,Normalized=True)
>>> g
*------- Object instance description ------*
Instance class      : BipolarOutrankingDigraph
Instance name       : rel_random3ObjectivesPerfTab
Actions             : 7
Criteria            : 7
Size                : 27
Determinateness (%) : 65.67
Valuation domain    : [-1.00;1.00]
>>> print(g.computeDeterminateness())
0.3134920634920634920634920638
>>> print(g.computeDeterminateness(InPercents=True))
65.67460317460317460317460320
>>> g.recodeValuation(0,1)
>>> g
*------- Object instance description ------*
Instance class      : BipolarOutrankingDigraph
Instance name       : rel_random3ObjectivesPerfTab
Actions             : 7
Criteria            : 7
Size                : 27
Determinateness (%) : 65.67
Valuation domain    : [0.00;1.00]
>>> print(g.computeDeterminateness())
0.1567460317460317460317460318
>>> print(g.computeDeterminateness(InPercents=True))
65.67460317460317460317460320
computeDiameter(self, Oriented=True)
Renders the (by default oriented) diameter of the digraph instance
computeDigraphCentres(self, WeakDistances=False, Comments=False)
The centers of a digraph are the nodes with finite minimal shortes path lengths.
 
The maximal neighborhood distances are stored in *self.maximalNeighborhoodDistances*.
 
The corresponding digraph radius and diameter are stored respectively  in *self.radius* and *self.diameter*.
 
With *Comments* = True, all these results are printed out.
 
*Source*: Claude Berge, *The Theory of Graphs*, Dover (2001) pp. 119, original in French Dunod (1958)
computeDynamicProgrammingStages(self, source, sink, Debug=False)
Renders the discrete stages of the optimal substructure for
dynamic pogramming digrahs from a given source node 
to a given sink sink node.
 
Returns a list of list of action identifyers.
computeGoodChoiceVector(self, ker, Comments=False)
| Computing Characteristic values for dominant pre-kernels
| using the von Neumann dual fixoint equation
computeGoodChoices(self, Comments=False)
Computes characteristic values for potentially good choices.
 
..note::
 
     Return a tuple with following content:
 
     [(0)-determ,(1)degirred,(2)degi,(3)degd,(4)dega,(5)str(choice),(6)domvec,(7)cover]
computeGoodPirlotChoices(self, Comments=False)
Characteristic values for potentially good choices
using the Pirlot fixpoint algorithm.
computeIncomparabilityDegree(self, InPercents=False, Comments=False)
Renders the incomparability degree (Decimal), i.e. the relative number of symmetric indeterminate relations of the irreflexive part of a digraph.
computeKemenyIndex(self, otherRelation)
renders the Kemeny index of the self.relation
compared with a given crisp valued relation of a compatible
other digraph (same nodes or actions).
computeKemenyOrder(self, orderLimit=7, Debug=False)
Renders a ordering from worst to best of the actions with maximal Kemeny index.
Return a tuple: kemenyOrder (from worst to best), kemenyIndex
computeKemenyRanking(self, orderLimit=7, seed=None, sampleSize=1000, Debug=False)
Renders a ranking from best to worst of the actions with maximal Kemeny index.
 
.. note::
 
     Returns a tuple: kemenyRanking (from best to worst), kemenyIndex.
computeKernelVector(self, kernel, Initial=True, Comments=False)
| Computing Characteristic values for dominant pre-kernels
| using the von Neumann dual fixpoint equation
computeKohlerOrder(self)
Renders an ordering (worst to best) of the actions following Kohler's rule.
computeKohlerRanking(self)
Renders a ranking (best to worst) of the actions following Kohler's rule.
computeMaxHoleSize(self, Comments=False)
Renders the length of the largest chordless cycle
in the corresponding disjunctive undirected graph.
computeMeanInDegree(self)
Renders the mean indegree of self.
!!! self.size must be set previously !!!
computeMeanOutDegree(self)
Renders the mean degree of self.
!!! self.size must be set previously !!!
computeMeanSymDegree(self)
Renders the mean degree of self.
!!! self.size must be set previously !!!
computeMedianOutDegree(self)
Renders the median outdegree of self.
!!! self.size must be set previously !!!
computeMedianSymDegree(self)
Renders the median symmetric degree of self.
!!! self.size must be set previously !!!
computeMoreOrLessUnrelatedPairs(self)
Renders a list of more or less unrelated pairs.
computeNetFlowsOrder(self)
Renders an ordered list (from best to worst) of the actions
following the net flows ranking rule.
computeNetFlowsOrderDict(self)
Renders an ordered list (from worst to best) of the actions
following the net flows ranking rule.
computeNetFlowsRanking(self)
Renders an ordered list (from best to worst) of the actions
following the net flows ranking rule.
computeNetFlowsRankingDict(self)
Renders an ordered list (from best to worst) of the actions
following the net flows ranking rule.
computeODistance(self, op2, comments=False)
renders the squared normalized distance of
two digraph valuations.
 
.. note::
 
     op2 = digraphs of same order as self.
computeOrbit(self, choice, withListing=False)
renders the set of isomorph copies of a choice following
the automorphism of the digraph self
computeOrderCorrelation(self, order, Debug=False)
Renders the ordinal correlation K of a digraph instance
when compared with a given linear order (from worst to best) of its actions
 
K = sum_{x != y} [ min( max(-self.relation(x,y)),other.relation(x,y), max(self.relation(x,y),-other.relation(x,y)) ]
 
K /= sum_{x!=y} [ min(abs(self.relation(x,y),abs(other.relation(x,y)) ]
 
.. note::
 
     Renders a dictionary with the key 'correlation' containing the actual bipolar correlation index and the key 'determination' containing the minimal determination level D of self and the other relation.
 
     D = sum_{x != y} min(abs(self.relation(x,y)),abs(other.relation(x,y)) / n(n-1)
 
     where n is the number of actions considered.
 
     The correlation index with a completely indeterminate relation
     is by convention 0.0 at determination level 0.0 .
 
.. warning::
 
     self must be a normalized outranking digraph instance !
computeOrdinalCorrelation(self, other, MedianCut=False, filterRelation=None, Debug=False)
Renders the bipolar correlation K of a
self.relation when compared
with a given compatible (same actions set)) digraph or
a [-1,1] valued compatible relation (same actions set).
 
If MedianCut=True, the correlation is computed on the median polarized relations.
 
If filterRelation is not None, the correlation is computed on the partial domain corresponding to the determined part of the filter relation.
 
.. warning::
 
     Notice that the 'other' relation and/or the 'filterRelation',
     the case given, must both be normalized, ie [-1,1]-valued !
 
K = sum_{x != y} [ min( max(-self.relation[x][y]),other.relation[x][y]), max(self.relation[x][y],-other.relation[x][y]) ]
 
K /= sum_{x!=y} [ min(abs(self.relation[x][y]),abs(other.relation[x][y])) ]
 
.. note::
 
     Renders a tuple with at position 0 the actual bipolar correlation index
     and in position 1 the minimal determination level D of self and
     the other relation.
 
     D = sum_{x != y} min(abs(self.relation[x][y]),abs(other.relation[x][y])) / n(n-1)
 
     where n is the number of actions considered.
 
     The correlation index with a completely indeterminate relation
     is by convention 0.0 at determination level 0.0 .
computeOrdinalCorrelationMP(self, other, MedianCut=False, Threading=False, nbrOfCPUs=None, startMethod=None, Comments=False, Debug=False)
Multi processing version of the digraphs.computeOrdinalCorrelation() method.
 
.. note::
     The relation filtering and the MedinaCut option are not implemented in the MP version.
computePairwiseClusterComparison(self, K1, K2, Debug=False)
Computes the pairwise cluster comparison credibility vector
from bipolar-valued digraph g. with K1 and K2 disjoint
lists of action keys from g actions disctionary.
Returns the dictionary
{'I': Decimal(),'P+':Decimal(),'P-':Decimal(),'R' :Decimal()}
where one and only one item is strictly positive.
computePreKernels(self)
computing dominant and absorbent preKernels:
    Result in self.dompreKernels and self.abspreKernels
computePreRankingRelation(self, preRanking, Normalized=True, Debug=False)
Renders the bipolar-valued relation obtained from
a given preRanking in decreasing levels (list of lists) result.
computePreorderRelation(self, preorder, Normalized=True, Debug=False)
Renders the bipolar-valued relation obtained from
a given preordering in increasing levels (list of lists) result.
computePrincipalOrder(self, Colwise=False, Comments=False)
Rendesr an ordering from wrost to best of the decision actions.
computePrincipalRanking(self, Colwise=False, Comments=False)
Rendesr a ranking from best to worst of the decision actions.
computePrincipalScores(self, plotFileName=None, Colwise=False, imageType=None, tempDir=None, bgcolor='cornsilk', Comments=False, Debug=False)
Renders a ordered list of the first principal eigenvector of the covariance of the valued outdegrees of self.
 
.. note::
 
   The method, relying on writing and reading temporary files by default in a temporary directory is threading and multiprocessing safe !
   (see Digraph.exportPrincipalImage method)
computePrudentBetaLevel(self, Debug=False)
computes alpha, ie the lowest valuation level, for which the
bipolarly polarised digraph doesn't contain a chordless circuit.
computeRankingByBestChoosing(self, CoDual=False, Debug=False)
Computes a weak preordering of the self.actions by recursive
best choice elagations.
 
Stores in self.rankingByBestChoosing['result'] a list of (P+,bestChoice) tuples
where P+ gives the best choice complement outranking
average valuation via the computePairwiseClusterComparison
method.
 
If self.rankingByBestChoosing['CoDual'] is True, 
the ranking-by-choosing was computed on the codual of self.
computeRankingByBestChoosingRelation(self, rankingByBestChoosing=None, Debug=False)
Renders the bipolar-valued relation obtained from
the self.rankingByBestChoosing result.
computeRankingByChoosing(self, actionsSubset=None, Debug=False, CoDual=False)
Computes a weak preordring of the self.actions by iterating
jointly first and last choice elagations.
 
Stores in self.rankingByChoosing['result'] a list of ((P+,bestChoice),(P-,worstChoice)) pairs
where P+ (resp. P-) gives the best (resp. worst) choice complement outranking
(resp. outranked) average valuation via the computePairwiseClusterComparison
method.
 
If self.rankingByChoosing['CoDual'] is True, the ranking-by-choosing was computed on the codual of self.
computeRankingByChoosingRelation(self, rankingByChoosing=None, actionsSubset=None, Debug=False)
Renders the bipolar-valued relation obtained from
the self.rankingByChoosing result.
computeRankingByLastChoosing(self, CoDual=False, Debug=False)
Computes a weak preordring of the self.actions by iterating
worst choice elagations.
 
Stores in self.rankingByLastChoosing['result'] a list of (P-,worstChoice) pairs
where P- gives the worst choice complement outranked
average valuation via the computePairwiseClusterComparison
method.
 
If self.rankingByChoosing['CoDual'] is True, the ranking-by-last-chossing 
was computed on the codual of self.
computeRankingByLastChoosingRelation(self, rankingByLastChoosing=None, Debug=False)
Renders the bipolar-valued relation obtained from
the self.rankingByLastChoosing result.
computeRankingCorrelation(self, ranking, Debug=False)
Renders the ordinal correlation K of a digraph instance
when compared with a given linear ranking of its actions
 
K = sum_{x != y} [ min( max(-self.relation(x,y)),other.relation(x,y), max(self.relation(x,y),-other.relation(x,y)) ]
 
K /= sum_{x!=y} [ min(abs(self.relation(x,y),abs(other.relation(x,y)) ]
 
.. note::
 
     Renders a tuple with at position 0 the actual bipolar correlation index
     and in position 1 the minimal determination level D of self and
     the other relation.
 
     D = sum_{x != y} min(abs(self.relation(x,y)),abs(other.relation(x,y)) / n(n-1)
 
     where n is the number of actions considered.
 
     The correlation index with a completely indeterminate relation
     is by convention 0.0 at determination level 0.0 .
computeRelationalStructure(self, Debug=False)
Renders the counted decomposition of the valued relations into
the following type of links:
gt '>', eq '=', lt '<', incomp '<>',
leq '<=', geq '>=', indeterm '?'
computeRubisChoice(self, Comments=False, _OldCoca=False, BrokenCocs=True, Threading=False, nbrOfCPUs=1)
Renders self.strictGoodChoices, self.nullChoices
self.strictBadChoices, self.nonRobustChoices.
 
.. warning::
    Changes in site the outranking digraph by
    adding or braking chordless odd outranking circuits.
computeRubyChoice(self, Comments=False, _OldCoca=False)
dummy for computeRubisChoice()
old versions compatibility.
computeShortestPathLengths(self, WeakPaths=False, Comments=False, Debug=False)
Renders a double dictionary with the directed distances, i.e. the shortest path lengths between all self.actions
 
Equals *None* if there does not exist a directed path between two actions.
 
*Source*: Claude Berge, *The Theory of Graphs*, Dover (2001) pp. 119, original in French Dunod (1958)
computeSingletonRanking(self, Comments=False, Debug=False)
Renders the sorted bipolar net determinatation of outrankingness
minus outrankedness credibilities of all singleton choices.
 
res = ((netdet,singleton,dom,absorb)+)
computeSize(self)
Renders the number of validated non reflexive arcs
computeSizeTransitiveClosure(self)
Renders the size of the transitive closure of a digraph.
computeSlaterOrder(self, isProbabilistic=False, seed=None, sampleSize=1000, Debug=False)
Reversed return from computeSlaterRanking method.
computeSlaterRanking(self, isProbabilistic=False, seed=None, sampleSize=1000, Debug=False)
Renders a ranking of the actions with minimal Slater index.
Return a tuple: slaterOrder, slaterIndex
computeSymmetryDegree(self, InPercents=False, Comments=False)
Renders the symmetry degree (Decimal) of the irreflexive part of a digraph.
 
.. note::
 
   Empty and indeterminate digraphs are considered to be symmetric.
computeTopologicalRanking(self, Debug=False)
Mimetic Wrapper of the topologicalSort() method.
computeTransitivityDegree(self, InPercents=False, Comments=False)
Renders the transitivity degree (Decimal) of a digraph.
 
.. note:: 
 
   An empty or indeterminate digraph is considered to be transitive.
computeUnrelatedPairs(self)
Renders a list of more or less unrelated pairs.
computeValuationLevels(self, choice=None, Debug=False)
renders the symmetric closure of the
apparent valuations levels of self
in an increasingly ordered list.
If parameter choice is given, the
computation is limited to the actions
of the choice.
computeValuationPercentages(self, choice, percentiles, withValues=False)
Parameters: choice and list of percentiles.
renders a series of percentages of the characteristics valuation of
the arcs in the digraph.
computeValuationPercentiles(self, choice, percentages, withValues=False)
Parameters: choice and list of percentages.
renders a series of quantiles of the characteristics valuation of
the arcs in the digraph.
computeValuationStatistics(self, Sampling=False, Comments=False)
Renders the mean and variance of the valuation
of the non reflexive pairs.
computeValuedRankingRelation(self, ranking)
Renders the valued relation characteristics compatible 
with the given linar ranking. Discordant charcateristics 
are set to the indeterminate value.
computeWeakCondorcetLosers(self)
Wrapper for weakCondorcetLosers().
computeWeakCondorcetWinners(self)
Wrapper for weakCondorcetWinners().
computeupdown1(self, s, S)
Help method for show_MIS_HB2 method.
fills self.newmisset, self.upmis, self.downmis.
computeupdown2(self, s, S)
Help method for show_MIS_HB1 method.
Fills self.newmisset, self.upmis, self.downmis.
computeupdown2irred(self, s, S)
Help method for show_MIS_HB1 method.
Fills self.newmisset, self.upmis, self.downmis.
condorcetLosers(self)
Renders the set of decision actions x such that
self.relation[x][y] < self.valuationdomain['med']
for all y != x.
condorcetWinners(self)
Renders the set of decision actions x such that
self.relation[x][y] > self.valuationdomain['med']
for all y != x.
contra(self, v)
Parameter: choice.
Renders the negation of a choice v characteristic's vector.
convertRelationToDecimal(self)
Converts the float valued self.relation in a decimal valued one.
convertValuation2Integer(self, InSite=True, Comments=False)
Converts the self.relation valuation to integer values by converting the Decimals to Fractions and multiply by the least commun multiple of the fraction denominators.
 
*Parameters*:
 
    - If *Insite* == False (True by default) the method returns a modified copy of self.relation without altering the original self.relation, otherwise self.relation and self.valuationdomain is modified.
convertValuationToDecimal(self)
Convert the float valuation limits to Decimals.
coveringIndex(self, choice, direction='out')
Renders the covering index of a given choice in a set of objects,
ie the minimum number of choice members that cover each
non selected object.
crispKDistance(self, digraph, Debug=False)
Renders the crisp Kendall distance between two bipolar valued
digraphs.
 
.. warning::
 
     Obsolete! Is replaced by the self.computeBipolarCorrelation(other, MedianCut=True) Digraph method
detectChordlessCircuits(self, Comments=False, Debug=False)
Detects a chordless circuit in a digraph.
Returns a Boolean
detectChordlessPath(self, Pk, n2, Comments=False, Debug=False)
New procedure from Agrum study April 2009
recursive chordless path extraction starting from path
Pk = [n2, ...., n1] and ending in node n2.
Optimized with marking of visited chordless P1s.
determinateness(self, vec, inPercent=True)
Renders the determinateness of a characteristic vector *vec* = 
[(r(x),x),(r(y),y), ...] of length *n* in valuationdomain [Min,Med,Max]:
 
*result* =  sum_x( abs(r(x)-Med) ) / ( n*(Max-Med) )
 
If inPercent, *result* shifted (+1) and reduced (/2) to [0,1] range.
digraph2Graph(self, valuationDomain={'min': -1, 'med': 0, 'max': 1}, Debug=False, ConjunctiveConversion=True)
Convert a Digraph instance to a Graph instance.
dneighbors(self, node)
Renders the set of dominated out-neighbors of a node.
domin(self, choice)
Renders the dominance degree of a choice.
dominantChoices(self, S)
Generates all minimal dominant choices of a bipolar valued digraph.
 
.. note::
 
     Initiate with S = self.actions.copy().
domirred(self, choice)
Renders the crips +irredundance degree of a choice.
domirredval(self, choice, relation)
Renders the valued +irredundance degree of a choice.
domirredx(self, choice, x)
Renders the crips +irredundance degree of node x in a choice.
domkernelrestrict(self, prekernel)
Parameter: dominant prekernel
Renders dominant prekernel restricted relation.
exportGraphViz(self, fileName=None, actionsSubset=None, bestChoice=set(), worstChoice=set(), firstChoice=set(), lastChoice=set(), Comments=True, graphType='png', pictureFormat=None, graphSize='7,7', relation=None, bgcolor='cornsilk')
export GraphViz dot file  for graph drawing filtering.
exportPrincipalImage(self, plotFileName=None, pictureFormat='pdf', bgcolor='cornsilk', fontcolor='red3', fontsize='0.75', Reduced=False, Colwise=False, tempDir='.', Comments=False)
Export as PDF (default) the principal projection of
the valued relation using the three principal eigen vectors.
 
Implemeted picture formats are: 
'pdf' (default), 'png', 'jpeg' and 'xfig'.
 
The background color is set by default to 'cornsilk'. 
 
Font size and color are set by default to 'red3', resp. '0.75'. 
 
When *Reduced==True*, the valued relation characeteristics are centered and reduced.
 
When *Colwise==True*, the column vectors of the adjacency table are used for the principal projection, otherwise the rows (default) are used. Has no incidence when the *Digraph* instance *self*  is symmetric. 
 
.. warning::
 
    The method, writing and reading temporary files: 
    tempCol.r and rotationCol.csv, resp. tempRow.r and rotationRow.csv,
    by default in the working directory (./),
    is hence not safe for multiprocessing programs, unless a
    temporary directory *tempDir* is provided.
flatChoice(self, ch, Debug=False)
Converts set or list ch recursively to a flat list of items.
forcedBestSingleChoice(self)
Renders the set of most determined outranking singletons in self.
gammaSets(self)
Renders the dictionary of neighborhoods {node: (dx,ax)}
with set *dx* gathering the dominated, and set *ax* gathering
the absorbed neighborhood.
generateAbsPreKernels(self)
Generate all absorbent prekernels from independent choices generator.
generateDomPreKernels(self)
Generate all dominant prekernels from independent choices generator.
htmlChoiceVector(self, ch, ChoiceVector=True, choiceType='good')
Show procedure for annotated bipolar choices.
inDegrees(self)
renders the median cut indegrees
inDegreesDistribution(self)
Renders the distribution of indegrees.
independentChoices(self, U)
Generator for all independent choices with neighborhoods of a bipolar valued digraph:
 
.. note::
 
       * Initiate with U = self.singletons().
       * Yields [(independent choice, domnb, absnb, indnb)].
inner_prod(self, v1, v2)
Parameters: two choice characteristic vectors
Renders the inner product of two characteristic vetors.
intstab(self, choice)
Computes the independence degree of a choice.
irreflex(self, mat)
Puts diagonal entries of mat to valuationdomain['min']
isAsymmetricIndeterminate(self, Debug=False)
Checks the self.relation for assymmetric indeterminateness!!
 
.. warning::
 
    The reflexive links are ignored !!
isComplete(self, Debug=False)
checks the completeness property of self.relation by checking
for the absence of a link between two actions!!
 
.. warning::
 
    The reflexive links are ignored !!
isCyclic(self, Debug=False)
checks the cyclicity of self.relation by checking
for a reflexive loop in its transitive closure-
 
.. warning::
 
     self.relation is supposed to be irreflexive !
isIntegerValued(self, Debug=False)
Checks whether the decimal valuation of self is integer-valued
be using the as_integer_ratio() method of a Decimal 
giving a tuple (numerator,denominator). If denominator == 1, the
number is an integer.
isOutrankingDigraph(self, Comments=True, Debug=False)
Checks the outranking digraph characteristic condition (3.3).
 
relation[x][y] + relation[y][x)[y] >= 0.0
 
.. warning::
 
    The reflexive links are ignored and the valuation must be bipolar !!
isStrictOutrankingDigraph(self, Comments=True, Debug=False)
Checks the strict outranking digraph characteristic condition (3.1).
 
-(relation[x][y] + relation[y][x]) <= 0.0 , x != y
 
.. warning::
 
    The reflexive links are ignored and the valuation must be bipolar !!
isSymmetric(self, Comments=False)
True if symmetry degree == 1.0.
isTransitive(self, Comments=False)
True if transitivity degree == 1.0.
isWeaklyComplete(self, Debug=False)
checks the weakly completeness property of self.relation by checking
for the absence of a link between two actions!!
 
.. warning::
 
    The reflexive links are ignored !!
iterateRankingByChoosing(self, Odd=False, CoDual=False, Comments=True, Debug=False, Limited=None)
Renders a ranking by choosing result when progressively eliminating
all chordless (odd only) circuits with rising valuation cut levels.
 
Parameters
    CoDual = False (default)/True
    Limited = proportion (in [0,1]) * (max - med) valuationdomain
kChoices(self, A, k)
Renders all choices of length k from set A
matmult2(self, m, v)
Parameters: digraph relation and choice characteristic vector
matrix multiply vector by inner production
meanDegree(self)
Renders the mean degree of self.
!!! self.size must be set previously !!!
meanLength(self, Oriented=False)
Renders the (by default non-oriented) mean neighbourhoor depth of self.
!!! self.order must be set previously !!!
minimalChoices(self, S)
Generates all dominant or absorbent choices of a bipolar
valued digraph.
 
.. note:
 
   * Initiate with S = (actions, dict of dominant or absorbent closed neighborhoods)
   * See showMinDom and showMinAbs methods.
minimalValuationLevelForCircuitsElimination(self, Odd=True, Debug=False, Comments=False)
renders the minimal valuation level <lambda> that eliminates all
self.circuitsList stored odd chordless circuits from self.
 
.. warning::
 
    The <lambda> level polarised may still contain newly appearing chordless odd circuits !
neighbourhoodCollection(self, Oriented=False, Potential=False)
Renders the neighbourhood.
neighbourhoodDepthDistribution(self, Oriented=False)
Renders the distribtion of neighbourhood depths.
notGammaSets(self)
Renders the dictionary of neighborhoods {node: (dx,ax)}
with set *dx* gathering the not dominated, and set *ax* gathering
the not absorbed neighborhood.
notaneighbors(self, node)
Renders the set of absorbed not in-neighbors of a node.
notdneighbors(self, node)
Renders the set of not dominated out-neighbors of a node.
outDegrees(self)
renders the median cut outdegrees
outDegreesDistribution(self)
Renders the distribution of outdegrees.
plusirredundant(self, U)
Generates all +irredundant choices of a digraph.
powerset(self, U)
Generates all subsets of a set.
readPerrinMisset(self, file='curd.dat')
read method for 0-1-char-coded MISs by default from the perrinMIS.c curd.dat result file.
readabsvector(self, x, relation)
Parameter: action x
absorbent in vector.
readdomvector(self, x, relation)
Parameter: action x
dominant out vector.
recodeValuation(self, newMin=-1.0, newMax=1.0, ndigits=4, Debug=False)
Recodes the characteristic valuation domain according
to the parameters given. 
 
*ndigits* indicates the number of decimal digits of the valuation.
relationFct(self, x, y)
wrapper for self.relation dictionary access to ensure interoperability
with the sparse and big outranking digraph implementation model.
save(self, fileName='tempdigraph', option=None, DecimalValuation=True, decDigits=2)
Persistent storage of a Digraph class instance in the form of
a python source code file
saveCSV(self, fileName='tempdigraph', Normalized=False, Dual=False, Converse=False, Diagonal=False, Debug=False)
Persistent storage of a Digraph class instance in the form of
a csv file.
saveXMCDA2(self, fileName='temp', fileExt='xmcda2', Comments=True, relationName='R', relationType='binary', category='random', subcategory='valued', author='digraphs Module (RB)', reference='saved from Python', valuationType='standard', digits=2, servingD3=False)
save digraph in XMCDA 2.0 format. Deprecated now.
savedre(self, fileName='temp')
save digraph in nauty format.
sharp(self, x, y)
Paramaters: choice characteristic values.
Renders the sharpest of two characteristic values x and y.
sharpvec(self, v, w)
Paramaters: choice characteristic vectors.
Renders the sharpest of two characteristic vectors v and w.
showActions(self)
presentation methods for digraphs actions
showAll(self)
Detailed show method for genuine digraphs.
showAttributes(self)
Prints out the attributes of self.
showAutomorphismGenerators(self)
Renders the generators of the automorphism group.
showBadChoices(self, Recompute=True)
Characteristic values for potentially bad choices.
showBestChoiceRecommendation(self, Verbose=False, Comments=True, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True)
Shows the RuBis best choice recommendation.
 
.. note::
 
    Computes by default the Rubis best choice recommendation on the corresponding strict (codual) outranking digraph.
 
    By default, with BrokenCocs=True, we brake all chordless circuits at their weakest determined ( abs(r(x>y)) + abs(r(y>x)) ) link.
 
    When BrokenCocs=False we proceed like follows:
 
    In case of chordless circuits, if supporting arcs are more credible
    than the reversed negating arcs, we collapse the circuits into hyper nodes.
    Inversely,  if supporting arcs are not more credible than the reversed negating arcs,
    we brake the circuits on their weakest arc.
 
Usage example:
 
>>> from outrankingDigraphs import *
>>> t = Random3ObjectivesPerformanceTableau(seed=5)
>>> g = BipolarOutrankingDigraph(t)
>>> g.showBestChoiceRecommendation()
***********************
RuBis Best Choice Recommendation (BCR)
(in decreasing order of determinateness)   
Credibility domain:  [-100.0, 100.0]
=== >> potential first choices
* choice              : ['a04', 'a14', 'a19', 'a20']
   independence        : 1.19
   dominance           : 4.76
   absorbency          : -59.52
   covering (%)        : 75.00
   determinateness (%) : 57.86
   - most credible action(s) = { 'a14': 23.81, 'a19': 11.90, 'a04': 2.38, 'a20': 1.19, }  
=== >> potential last choices 
* choice              : ['a03', 'a12', 'a17']
  independence        : 4.76
  dominance           : -76.19
  absorbency          : 4.76
  covering (%)        : 0.00
  determinateness (%) : 65.39
  - most credible action(s) = { 'a03': 38.10, 'a12': 13.10, 'a17': 4.76, }
Execution time: 0.024 seconds
*****************************
showChoiceVector(self, ch, choiceType='good', ChoiceVector=True)
Show procedure for annotated bipolar choices.
showChordlessCircuits(self, Recompute=False)
Show method for chordless circuits observed in a Digraph instance.
 
If previous computation is required, stores the detected circuits in self.circuitsList attribute.
showComponents(self)
Shows the list of connected components of the digraph instance.
showCorrelation(self, corr=None, ndigits=3)
Renders the valued ordinal correlation index, the crisp Kendall tau index and their epistemic determination degree.
showFirstChoiceRecommendation(self, Verbose=False, Comments=True, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True)
Shows the RuBis first choice recommendation.
 
.. note::
 
    Computes by default the Rubis first choice recommendation on the corresponding strict (codual) outranking digraph.
 
    By default, with BrokenCocs=True, we brake all chordless circuits at their weakest determined ( abs(r(x>y)) + abs(r(y>x)) ) link.
 
    When BrokenCocs=False we proceed like follows:
 
    In case of chordless circuits, if supporting arcs are more credible
    than the reversed negating arcs, we collapse the circuits into hyper nodes.
    Inversely,  if supporting arcs are not more credible than the reversed negating arcs,
    we brake the circuits on their weakest arc.
 
Usage example:
 
>>> from outrankingDigraphs import *
>>> t = Random3ObjectivesPerformanceTableau(seed=5)
>>> g = BipolarOutrankingDigraph(t)
>>> g.showFirstChoiceRecommendation()
***********************
RuBis First Choice Recommendation (BCR)
(in decreasing order of determinateness)   
Credibility domain:  [-100.0, 100.0]
=== >> potential first choices
* choice              : ['a04', 'a14', 'a19', 'a20']
   independence        : 1.19
   dominance           : 4.76
   absorbency          : -59.52
   covering (%)        : 75.00
   determinateness (%) : 57.86
   - most credible action(s) = { 'a14': 23.81, 'a19': 11.90, 'a04': 2.38, 'a20': 1.19, }  
=== >> potential last choices 
* choice              : ['a03', 'a12', 'a17']
  independence        : 4.76
  dominance           : -76.19
  absorbency          : 4.76
  covering (%)        : 0.00
  determinateness (%) : 65.39
  - most credible action(s) = { 'a03': 38.10, 'a12': 13.10, 'a17': 4.76, }
Execution time: 0.024 seconds
*****************************
showGoodChoices(self, Recompute=True)
Characteristic values for potentially good choices.
showHTMLBestChoiceRecommendation(self, pageTitle=None, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True, htmlFileName=None)
showHTMLRelationHeatmap(self, actionsList=None, rankingRule='NetFlows', colorLevels=7, tableTitle='Relation Heatmap', relationName='r(x S y)', ndigits=2, fromIndex=None, toIndex=None, htmlFileName=None)
Launches a browser window with the colored relation map of self.
 
See corresponding :py:class:`~digraphs.Digraph.showHTMLRelationMap` method.
 
The *colorLevels* parameter may be set to 3, 5, 7 (default) or 9.
 
When the *actionsList* parameter is *None* (default), the digraphs actions list may be ranked with the *rankingRule* parameter set to the 'Copeland' (default) or to the 'Netlows' ranking rule.
 
When the *htmlFileName* parameter is set to a string value 'xxx', a html file named 'xxx.html' will be generated in the current working directory. Otherwise, a temporary file named 'tmp*.html' will be generated there.
 
Example::
 
    >>> from outrankingDigraphs import *
    >>> t = RandomCBPerformanceTableau(numberOfActions=25,seed=1)
    >>> g = BipolarOutrankingDigraph(t,ndigits=2)
    >>> gcd = ~(-g)  # strict outranking relation
    >>> gcd.showHTMLRelationHeatmap(colorLevels=7,ndigits=2)
    
.. image:: relationHeatmap.png
   :alt: Browser view of a relation map
   :width: 600 px
   :align: center
showHTMLRelationMap(self, actionsList=None, rankingRule='Copeland', Colored=True, tableTitle='Relation Map', relationName='r(x S y)', symbols=['+', '&middot;', '&nbsp;', '&#150;', '&#151'], fromIndex=None, toIndex=None, htmlFileName=None)
Launches a browser window with the colored relation map of self.
See corresponding Digraph.showRelationMap() method.
 
When *htmlFileName* parameter is set to a string value, a html file
with that name will be stored in the current working directory.
 
By default, a temporary file named: tmp*.html will be generated
instead in the current working directory.
 
Example::
 
    >>> from outrankingDigraphs import *
    >>> t = RandomCBPerformanceTableau(numberOfActions=25,seed=1)
    >>> g = BipolarOutrankingDigraph(t,Normalized=True)
    >>> gcd = ~(-g)  # strict outranking relation
    >>> gcd.showHTMLRelationMap(rankingRule="NetFlows")
    
.. image:: relationMap.png
   :alt: Browser view of a relation map
   :width: 600 px
   :align: center
showHTMLRelationTable(self, actionsList=None, relation=None, IntegerValues=False, ndigits=2, Colored=True, tableTitle='Valued Adjacency Matrix', relationName='r(x S y)', ReflexiveTerms=False, htmlFileName=None, fromIndex=None, toIndex=None)
Launches a browser window with the colored relation table of self.
showMIS(self, withListing=True)
Prints all maximal independent choices:
    Result in self.misset.
showMIS_AH(self, withListing=True)
Prints all MIS using the Hertz method.
 
Result saved in self.hertzmisset.
showMIS_HB2(self, withListing=True)
Prints all MIS using the Hertz-Bisdorff method.
 
Result saved in self.newmisset.
showMIS_RB(self, withListing=True)
Prints all MIS using the Bisdorff method.
 
Result saved in self.newmisset.
showMIS_UD(self, withListing=True)
Prints all MIS using the Hertz-Bisdorff method.
 
Result saved in self.newmisset.
showMaxAbsIrred(self, withListing=True)
Computing maximal -irredundant choices:
    Result in self.absirset.
showMaxDomIrred(self, withListing=True)
Computing maximal +irredundant choices:
   Result in self.domirset.
showMinAbs(self, withListing=True)
Prints minimal absorbent choices:
    Result in self.absset.
showMinDom(self, withListing=True)
Prints all minimal dominant choices:
    Result in self.domset.
showNeighborhoods(self)
Lists the gamma and the notGamma function of self.
showOrbits(self, InChoices, withListing=True)
Prints the orbits of Choices along the automorphisms of
the Digraph instance.
 
Example Python session for computing the non isomorphic MISs from the 12-cycle graph:
 
>>> from digraphs import *
>>> c12 = CirculantDigraph(order=12,circulants=[1,-1])
>>> c12.automorphismGenerators()
...
  Permutations
  {'1': '1', '2': '12', '3': '11', '4': '10', '5': 
   '9', '6': '8', '7': '7', '8': '6', '9': '5', '10': 
   '4', '11': '3', '12': '2'}
  {'1': '2', '2': '1', '3': '12', '4': '11', '5': '10', 
   '6': '9', '7': '8', '8': '7', '9': '6', '10': '5', 
   '11': '4', '12': '3'}
  Reflections {}
>>> print('grpsize = ', c12.automorphismGroupSize)
  grpsize = 24
>>> c12.showMIS(withListing=False)
  *---  Maximal independent choices ---*
  number of solutions:  29
  cardinality distribution
  card.:  [0, 1, 2, 3, 4,  5,  6, 7, 8, 9, 10, 11, 12]
  freq.:  [0, 0, 0, 0, 3, 24,  2, 0, 0, 0,  0,  0,  0]
  Results in c12.misset
>>> c12.showOrbits(c12.misset,withListing=False)
...
  *---- Global result ----
  Number of MIS:  29
  Number of orbits :  4
  Labelled representatives:
  1: ['2','4','6','8','10','12']
  2: ['2','5','8','11']
  3: ['2','4','6','9','11']
  4: ['1','4','7','9','11']
  Symmetry vector
  stabilizer size: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, ...]
  frequency      : [0, 2, 0, 0, 0, 0, 0, 1, 0,  0,  0,  1, ...]
 
*Figure*: The symmetry axes of the non isomorphic MISs of the 12-cycle:
 
.. image:: c12.png
   :width: 400 px
   :align: center
   :alt: The 4 non isomorphic MIS of the 12-cycle graph
 
*Reference*: R. Bisdorff and J.L. Marichal (2008). Counting non-isomorphic maximal independent sets of the n-cycle graph. *Journal of Integer Sequences*, Vol. 11 Article 08.5.7 (`openly accessible here <https://www.cs.uwaterloo.ca/journals/JIS/VOL11/Marichal/marichal.html>`_)
showOrbitsFromFile(self, InFile, withListing=True)
Prints the orbits of Choices along the automorphisms of
the digraph self by reading in the 0-1 misset file format.
See the :py:func:`digraphs.Digraph.readPerrinMisset` method.
showPreKernels(self, withListing=True)
Printing dominant and absorbent preKernels:
    Result in self.dompreKernels and self.abspreKernels
showRankingByBestChoosing(self, rankingByBestChoosing=None)
A show method for self.rankinByBestChoosing result.
 
.. warning::
 
     The self.computeRankingByBestChoosing(CoDual=False/True) method instantiating the self.rankingByBestChoosing slot is pre-required !
showRankingByChoosing(self, rankingByChoosing=None, WithCoverCredibility=False)
A show method for self.rankinByChoosing result.
 
When parameter *WithCoverCredibility* is set to True, the credibility of outranking, respectively being outranked is indicated at each selection step. 
 
.. warning::
 
     The self.computeRankingByChoosing(CoDual=False/True) method instantiating the self.rankingByChoosing slot is pre-required !
showRankingByLastChoosing(self, rankingByLastChoosing=None, Debug=None)
A show method for self.rankinByChoosing result.
 
.. warning::
 
     The self.computeRankingByLastChoosing(CoDual=False/True) method instantiating the self.rankingByChoosing slot is pre-required !
showRelation(self)
prints the relation valuation in ##.## format.
showRelationMap(self, symbols=None, rankingRule='Copeland', fromIndex=None, toIndex=None, actionsList=None)
Prints on the console, in text map format, the location of
certainly validated and certainly invalidated outranking situations.
 
By default, symbols = {'max':'┬','positive': '+', 'median': ' ',
                       'negative': '-', 'min': '┴'}
 
The default ordering of the output is following the Copeland ranking rule
from best to worst actions. Further available ranking rule is the 'NetFlows' net flows rule.
 
 
Example::
 
    >>> from outrankingDigraphs import *
    >>> t = RandomCBPerformanceTableau(numberOfActions=25,seed=1)
    >>> g = BipolarOutrankingDigraph(t,Normalized=True)
    >>> gcd = ~(-g)  # strict outranking relation
    >>> gcd.showRelationMap(rankingRule="NetFlows")
     -   ++++++++  +++++┬+┬┬+
    - -   + +++++ ++┬+┬+++┬++
    ┴+  ┴ + ++  ++++┬+┬┬++┬++
    -   ++ - ++++-++++++┬++┬+
       - - - ++- ┬- + -+┬+-┬┬
    -----  -      -┬┬┬-+  -┬┬
    ----    --+-+++++++++++++
    -- --+- --++ ++ +++-┬+-┬┬
    ----  -  -+-- ++--+++++ +
    ----- ++- --- +---++++┬ +
    -- -- ---+ -++-+++-+ +-++
    -- --┴---+  + +-++-+ -  +
    ---- ┴---+-- ++--++++ - +
      --┴┴--  --- -  --+ --┬┬
     ---------+--+ ----- +-┬┬
    -┴---┴- ---+- + ---+++┬ +
    -┴┴--┴---+--- ++ -++--+++
    -----┴--- ---+-+- ++---+ 
    -┴┴--------------- --++┬ 
    --┴---------------- --+┬ 
    ┴--┴┴ -┴--┴┴-┴ --++  ++-+
    ----┴┴--------------- -  
    ┴┴┴----+-┴+┴---┴-+---+ ┴+
    ┴┴-┴┴┴-┴- - -┴┴---┴┴+ ┬ -
    ----┴┴-┴-----┴┴---  - -- 
    Ranking rule: NetFlows
    >>>
showRelationTable(self, Sorted=True, rankingRule=None, IntegerValues=False, actionsSubset=None, relation=None, ndigits=2, ReflexiveTerms=True, fromIndex=None, toIndex=None)
Prints the relation valuation in actions X actions table format.
Copeland and NetFlows rankings my be used.
showRubisBestChoiceRecommendation(self, **kwargs)
Dummy for backward portable showBestChoiceRecommendation().
showRubyChoice(self, Verbose=False, Comments=True, _OldCoca=True)
Dummy for showBestChoiceRecommendation()
needed for older versions compatibility.
showShort(self)
concise presentation method for genuine digraphs.
showSingletonRanking(self, Comments=True, Debug=False)
Calls self.computeSingletonRanking(comments=True,Debug = False).
Renders and prints the sorted bipolar net determinatation of outrankingness
minus outrankedness credibilities of all singleton choices.
 
res = ((netdet,sigleton,dom,absorb)+)
showStatistics(self)
Computes digraph statistics like order, size and arc-density.
showdre(self)
Shows relation in nauty format.
singletons(self)
list of singletons and neighborhoods
[(singx1, +nx1, -nx1, not(+nx1 or -nx1)),.... ]
sizeSubGraph(self, choice)
Output: (size, undeterm,arcDensity).
Renders the arc density of the induced subgraph.
strongComponents(self, setPotential=False)
Renders the set of strong components of self.
symDegreesDistribution(self)
Renders the distribution of symmetric degrees.
topologicalSort(self, Debug=False)
If self is acyclic, adds topological sort number to each node of self
and renders ordered list of nodes. Otherwise renders None.
Source: M. Golumbic Algorithmic Graph heory and Perfect Graphs,
Annals Of Discrete Mathematics 57 2nd Ed. , Elsevier 2004, Algorithm 2.4 p.44.
weakAneighbors(self, node)
Renders the set of absorbed in-neighbors of a node.
weakCondorcetLosers(self)
Renders the set of decision actions x such that
self.relation[x][y] <= self.valuationdomain['med']
for all y != x.
weakCondorcetWinners(self)
Renders the set of decision actions x such that
self.relation[x][y] >= self.valuationdomain['med']
for all y != x.
weakDneighbors(self, node)
Renders the set of dominated out-neighbors of a node.
weakGammaSets(self)
Renders the dictionary of neighborhoods {node: (dx,ax)}
zoomValuation(self, zoomFactor=1.0)
Zooms in or out, depending on the value of the zoomFactor provided,
the bipolar valuation of a digraph.

Data descriptors inherited from Digraph:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class StrongComponentsCollapsedDigraph(Digraph)
    StrongComponentsCollapsedDigraph(digraph=None)
 
Reduction of Digraph object to its strong components.
 
 
Method resolution order:
StrongComponentsCollapsedDigraph
Digraph
builtins.object

Methods defined here:
__init__(self, digraph=None)
Initialize self.  See help(type(self)) for accurate signature.
showComponents(self)
Shows the list of connected components of the digraph instance.

Methods inherited from Digraph:
MISgen(self, S, I)
generator of maximal independent choices (voir Byskov 2004):
    * S ::= remaining nodes;
    * I ::= current independent choice
 
.. note::
 
        Inititalize: self.MISgen(self.actions.copy(),set())
__invert__(self)
Make the inverting operator ~self available for Digraph instances. 
 
Returns a ConverseDigraph instance of self.
__neg__(self)
Make the negation operator -self available for Digraph instances. 
 
Returns a DualDigraph instance of self.
__repr__(self)
Default presentation method for Digraph instances.
absirred(self, choice)
Renders the crips -irredundance degree of a choice.
absirredundant(self, U)
Generates all -irredundant choices of a digraph.
absirredval(self, choice, relation)
Renders the valued -irredundance degree of a choice.
absirredx(self, choice, x)
Computes the crips -irredundance degree of node x in a choice.
abskernelrestrict(self, prekernel)
Parameter: prekernel
Renders absorbent prekernel restricted relation.
absorb(self, choice)
Renders the absorbency degree of a choice.
absorbentChoices(self, S)
Generates all minimal absorbent choices of a bipolar valued digraph.
addValuationAttribute(self)
Adds the numpy valuation attribute
agglomerationDistribution(self)
Output: aggloCoeffDistribution, meanCoeff
Renders the distribution of agglomeration coefficients.
aneighbors(self, node)
Renders the set of absorbed in-neighbors of a node.
automorphismGenerators(self)
Adds automorphism group generators to the digraph instance.
 
.. note::
 
    Dependency: Uses the dreadnaut command from the nauty software package. See https://www3.cs.stonybrook.edu/~algorith/implement/nauty/implement.shtml
 
    On Ubuntu Linux:
      ...$ sudo apt-get install nauty
averageCoveringIndex(self, choice, direction='out')
Renders the average covering index of a given choice in a set of objects,
ie the average number of choice members that cover each
non selected object.
bipolarKCorrelation(self, digraph, Debug=False)
Renders the bipolar Kendall correlation between two bipolar valued
digraphs computed from the average valuation of the
XORDigraph(self,digraph) instance.
 
.. warning::
 
     Obsolete! Is replaced by the self.computeBipolarCorrelation(other) Digraph method
bipolarKDistance(self, digraph, Debug=False)
Renders the bipolar crisp Kendall distance between two bipolar valued
digraphs.
 
.. warning::
 
     Obsolete! Is replaced by the self.computeBipolarCorrelation(other, MedianCut=True) Digraph method
chordlessPaths(self, Pk, n2, Odd=False, Comments=False, Debug=False)
New procedure from Agrum study April 2009
recursive chordless path extraction starting from path
Pk = [n2, ...., n1] and ending in node n2.
Optimized with marking of visited chordless P1s.
circuitAverageCredibility(self, circ)
Renders the average linking credibility of a Chordless Circuit.
circuitCredibilities(self, circuit, Debug=False)
Renders the average linking credibilities and the minimal link of a Chordless Circuit.
circuitMaxCredibility(self, circ)
Renders the maximal linking credibility of a Chordless Circuit.
circuitMinCredibility(self, circ)
Renders the minimal linking credibility of a Chordless Circuit.
closeSymmetric(self, InSite=True)
Produces the symmetric closure of self.relation.
closeTransitive(self, Reverse=False, InSite=True, Comments=False)
Produces the transitive closure of self.relation
 
*Parameters*:
 
    - If *Reverse* == True (False default) all transitive links are dropped, otherwise all transitive links are closed with min[r(x,y),r(y,z)];
    - If *Insite* == False (True by default) the methods return a modified copy of self.relation without altering the original self.relation, otherwise self.relation is modified.
components(self)
Renders the list of connected components.
computeAllDensities(self, choice=None)
parameter: choice in self
renders six densitiy parameters:
arc density, double arc density,
single arc density, strict single arc density,
absence arc density, strict absence arc densitiy.
computeArrowRaynaudOrder(self)
Renders a linear ordering from worst to best of the actions following Arrow&Raynaud's rule.
computeArrowRaynaudRanking(self)
renders a linear ranking from best to worst of the actions following Arrow&Raynaud's rule.
computeAverageValuation(self)
Computes the bipolar average correlation between
self and the crisp complete digraph of same order
of the irreflexive and determined arcs of the digraph
computeBadChoices(self, Comments=False)
Computes characteristic values for potentially bad choices.
 
.. note::
 
     Returns a tuple with following content:
 
     [(0)-determ,(1)degirred,(2)degi,(3)degd,(4)dega,(5)str(choice),(6)absvec]
computeBadPirlotChoices(self, Comments=False)
Characteristic values for potentially bad choices
using the Pirlot's fixpoint algorithm.
computeBestChoiceRecommendation(self, Verbose=False, Comments=False, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True)
Sets self.bestChoice, self.bestChoiceData, self.worstChoice and self.worstChoiceData
with the showBestChoiceRecommendation method.
 
First and last choices data is the following:
[(0)-determ,(1)degirred,(2)degi,(3)degd,(4)dega,(5)str(choice),(6)domvec,(7)cover]
 
self.bestChoice = self.bestChoiceData[5]
self.worstChoice = self.worstChoiceData[5]
computeBipolarCorrelation(self, other, MedianCut=False, filterRelation=None, Debug=False)
obsolete: dummy replacement for Digraph.computeOrdinalCorrelation method
computeChordlessCircuits(self, Odd=False, Comments=False, Debug=False)
Renders the set of all chordless circuits detected in a digraph.
Result is stored in <self.circuitsList>
holding a possibly empty list of tuples with at position 0 the
list of adjacent actions of the circuit and at position 1
the set of actions in the stored circuit.
 
When *Odd* is True, only chordless circuits with an odd length
are collected.
computeChordlessCircuitsMP(self, Odd=False, Threading=False, nbrOfCPUs=None, startMethod=None, Comments=False, Debug=False)
Multiprocessing version of computeChordlessCircuits().
 
Renders the set of all chordless odd circuits detected in a digraph.
Result (possible empty list) stored in <self.circuitsList>
holding a possibly empty list tuples with at position 0 the
list of adjacent actions of the circuit and at position 1
the set of actions in the stored circuit.
Inspired by Dias, Castonguay, Longo, Jradi, Algorithmica (2015).
 
Returns a possibly empty list of tuples (circuit,frozenset(circuit)).
 
If Odd == True, only circuits of odd length are retained in the result.
computeCoSize(self)
Renders the number of non validated non reflexive arcs
computeConcentrationIndex(self, X, N)
Renders the Gini concentration index of the X serie.
N contains the partial frequencies.
Based on the triangle summation formula.
computeConcentrationIndexTrapez(self, X, N)
Renders the Gini concentration index of the X serie.
N contains the partial frequencies.
Based on the triangles summation formula.
computeCondorcetLosers(self)
Wrapper for condorcetLosers().
computeCondorcetWinners(self)
Wrapper for condorcetWinners().
computeCopelandOrder(self)
renders a linear ordering from worst to best of the actions following Arrow&Raynaud's rule.
computeCopelandRanking(self)
renders a linear ranking from best to worst of the actions following Arrow&Raynaud's rule.
computeCutLevelDensities(self, choice, level)
parameter: choice in self, robustness level
renders three robust densitiy parameters:
robust double arc density,
robust single arc density,
robust absence arc densitiy.
computeDensities(self, choice)
parameter: choice in self
renders the four densitiy parameters:
arc density, double arc density, single arc density, absence arc density.
computeDeterminateness(self, InPercents=False)
Computes the Kendalll distance of self
with the all median-valued indeterminate digraph of order n.
 
Return the average determination of the irreflexive part of the digraph.
 
*determination* = sum_(x,y) { abs[ r(xRy) - Med ] } / n(n-1)
 
If *InPercents* is True, returns the average determination in percentage of
(Max - Med) difference.
 
>>> from outrankingDigraphs import BipolarOutrankingDigraph
>>> from randomPerfTabs import Random3ObjectivesPerformanceTableau
>>> t = Random3ObjectivesPerformanceTableau(numberOfActions=7,numberOfCriteria=7,seed=101)
>>> g = BipolarOutrankingDigraph(t,Normalized=True)
>>> g
*------- Object instance description ------*
Instance class      : BipolarOutrankingDigraph
Instance name       : rel_random3ObjectivesPerfTab
Actions             : 7
Criteria            : 7
Size                : 27
Determinateness (%) : 65.67
Valuation domain    : [-1.00;1.00]
>>> print(g.computeDeterminateness())
0.3134920634920634920634920638
>>> print(g.computeDeterminateness(InPercents=True))
65.67460317460317460317460320
>>> g.recodeValuation(0,1)
>>> g
*------- Object instance description ------*
Instance class      : BipolarOutrankingDigraph
Instance name       : rel_random3ObjectivesPerfTab
Actions             : 7
Criteria            : 7
Size                : 27
Determinateness (%) : 65.67
Valuation domain    : [0.00;1.00]
>>> print(g.computeDeterminateness())
0.1567460317460317460317460318
>>> print(g.computeDeterminateness(InPercents=True))
65.67460317460317460317460320
computeDiameter(self, Oriented=True)
Renders the (by default oriented) diameter of the digraph instance
computeDigraphCentres(self, WeakDistances=False, Comments=False)
The centers of a digraph are the nodes with finite minimal shortes path lengths.
 
The maximal neighborhood distances are stored in *self.maximalNeighborhoodDistances*.
 
The corresponding digraph radius and diameter are stored respectively  in *self.radius* and *self.diameter*.
 
With *Comments* = True, all these results are printed out.
 
*Source*: Claude Berge, *The Theory of Graphs*, Dover (2001) pp. 119, original in French Dunod (1958)
computeDynamicProgrammingStages(self, source, sink, Debug=False)
Renders the discrete stages of the optimal substructure for
dynamic pogramming digrahs from a given source node 
to a given sink sink node.
 
Returns a list of list of action identifyers.
computeGoodChoiceVector(self, ker, Comments=False)
| Computing Characteristic values for dominant pre-kernels
| using the von Neumann dual fixoint equation
computeGoodChoices(self, Comments=False)
Computes characteristic values for potentially good choices.
 
..note::
 
     Return a tuple with following content:
 
     [(0)-determ,(1)degirred,(2)degi,(3)degd,(4)dega,(5)str(choice),(6)domvec,(7)cover]
computeGoodPirlotChoices(self, Comments=False)
Characteristic values for potentially good choices
using the Pirlot fixpoint algorithm.
computeIncomparabilityDegree(self, InPercents=False, Comments=False)
Renders the incomparability degree (Decimal), i.e. the relative number of symmetric indeterminate relations of the irreflexive part of a digraph.
computeKemenyIndex(self, otherRelation)
renders the Kemeny index of the self.relation
compared with a given crisp valued relation of a compatible
other digraph (same nodes or actions).
computeKemenyOrder(self, orderLimit=7, Debug=False)
Renders a ordering from worst to best of the actions with maximal Kemeny index.
Return a tuple: kemenyOrder (from worst to best), kemenyIndex
computeKemenyRanking(self, orderLimit=7, seed=None, sampleSize=1000, Debug=False)
Renders a ranking from best to worst of the actions with maximal Kemeny index.
 
.. note::
 
     Returns a tuple: kemenyRanking (from best to worst), kemenyIndex.
computeKernelVector(self, kernel, Initial=True, Comments=False)
| Computing Characteristic values for dominant pre-kernels
| using the von Neumann dual fixpoint equation
computeKohlerOrder(self)
Renders an ordering (worst to best) of the actions following Kohler's rule.
computeKohlerRanking(self)
Renders a ranking (best to worst) of the actions following Kohler's rule.
computeMaxHoleSize(self, Comments=False)
Renders the length of the largest chordless cycle
in the corresponding disjunctive undirected graph.
computeMeanInDegree(self)
Renders the mean indegree of self.
!!! self.size must be set previously !!!
computeMeanOutDegree(self)
Renders the mean degree of self.
!!! self.size must be set previously !!!
computeMeanSymDegree(self)
Renders the mean degree of self.
!!! self.size must be set previously !!!
computeMedianOutDegree(self)
Renders the median outdegree of self.
!!! self.size must be set previously !!!
computeMedianSymDegree(self)
Renders the median symmetric degree of self.
!!! self.size must be set previously !!!
computeMoreOrLessUnrelatedPairs(self)
Renders a list of more or less unrelated pairs.
computeNetFlowsOrder(self)
Renders an ordered list (from best to worst) of the actions
following the net flows ranking rule.
computeNetFlowsOrderDict(self)
Renders an ordered list (from worst to best) of the actions
following the net flows ranking rule.
computeNetFlowsRanking(self)
Renders an ordered list (from best to worst) of the actions
following the net flows ranking rule.
computeNetFlowsRankingDict(self)
Renders an ordered list (from best to worst) of the actions
following the net flows ranking rule.
computeODistance(self, op2, comments=False)
renders the squared normalized distance of
two digraph valuations.
 
.. note::
 
     op2 = digraphs of same order as self.
computeOrbit(self, choice, withListing=False)
renders the set of isomorph copies of a choice following
the automorphism of the digraph self
computeOrderCorrelation(self, order, Debug=False)
Renders the ordinal correlation K of a digraph instance
when compared with a given linear order (from worst to best) of its actions
 
K = sum_{x != y} [ min( max(-self.relation(x,y)),other.relation(x,y), max(self.relation(x,y),-other.relation(x,y)) ]
 
K /= sum_{x!=y} [ min(abs(self.relation(x,y),abs(other.relation(x,y)) ]
 
.. note::
 
     Renders a dictionary with the key 'correlation' containing the actual bipolar correlation index and the key 'determination' containing the minimal determination level D of self and the other relation.
 
     D = sum_{x != y} min(abs(self.relation(x,y)),abs(other.relation(x,y)) / n(n-1)
 
     where n is the number of actions considered.
 
     The correlation index with a completely indeterminate relation
     is by convention 0.0 at determination level 0.0 .
 
.. warning::
 
     self must be a normalized outranking digraph instance !
computeOrdinalCorrelation(self, other, MedianCut=False, filterRelation=None, Debug=False)
Renders the bipolar correlation K of a
self.relation when compared
with a given compatible (same actions set)) digraph or
a [-1,1] valued compatible relation (same actions set).
 
If MedianCut=True, the correlation is computed on the median polarized relations.
 
If filterRelation is not None, the correlation is computed on the partial domain corresponding to the determined part of the filter relation.
 
.. warning::
 
     Notice that the 'other' relation and/or the 'filterRelation',
     the case given, must both be normalized, ie [-1,1]-valued !
 
K = sum_{x != y} [ min( max(-self.relation[x][y]),other.relation[x][y]), max(self.relation[x][y],-other.relation[x][y]) ]
 
K /= sum_{x!=y} [ min(abs(self.relation[x][y]),abs(other.relation[x][y])) ]
 
.. note::
 
     Renders a tuple with at position 0 the actual bipolar correlation index
     and in position 1 the minimal determination level D of self and
     the other relation.
 
     D = sum_{x != y} min(abs(self.relation[x][y]),abs(other.relation[x][y])) / n(n-1)
 
     where n is the number of actions considered.
 
     The correlation index with a completely indeterminate relation
     is by convention 0.0 at determination level 0.0 .
computeOrdinalCorrelationMP(self, other, MedianCut=False, Threading=False, nbrOfCPUs=None, startMethod=None, Comments=False, Debug=False)
Multi processing version of the digraphs.computeOrdinalCorrelation() method.
 
.. note::
     The relation filtering and the MedinaCut option are not implemented in the MP version.
computePairwiseClusterComparison(self, K1, K2, Debug=False)
Computes the pairwise cluster comparison credibility vector
from bipolar-valued digraph g. with K1 and K2 disjoint
lists of action keys from g actions disctionary.
Returns the dictionary
{'I': Decimal(),'P+':Decimal(),'P-':Decimal(),'R' :Decimal()}
where one and only one item is strictly positive.
computePreKernels(self)
computing dominant and absorbent preKernels:
    Result in self.dompreKernels and self.abspreKernels
computePreRankingRelation(self, preRanking, Normalized=True, Debug=False)
Renders the bipolar-valued relation obtained from
a given preRanking in decreasing levels (list of lists) result.
computePreorderRelation(self, preorder, Normalized=True, Debug=False)
Renders the bipolar-valued relation obtained from
a given preordering in increasing levels (list of lists) result.
computePrincipalOrder(self, Colwise=False, Comments=False)
Rendesr an ordering from wrost to best of the decision actions.
computePrincipalRanking(self, Colwise=False, Comments=False)
Rendesr a ranking from best to worst of the decision actions.
computePrincipalScores(self, plotFileName=None, Colwise=False, imageType=None, tempDir=None, bgcolor='cornsilk', Comments=False, Debug=False)
Renders a ordered list of the first principal eigenvector of the covariance of the valued outdegrees of self.
 
.. note::
 
   The method, relying on writing and reading temporary files by default in a temporary directory is threading and multiprocessing safe !
   (see Digraph.exportPrincipalImage method)
computePrudentBetaLevel(self, Debug=False)
computes alpha, ie the lowest valuation level, for which the
bipolarly polarised digraph doesn't contain a chordless circuit.
computeRankingByBestChoosing(self, CoDual=False, Debug=False)
Computes a weak preordering of the self.actions by recursive
best choice elagations.
 
Stores in self.rankingByBestChoosing['result'] a list of (P+,bestChoice) tuples
where P+ gives the best choice complement outranking
average valuation via the computePairwiseClusterComparison
method.
 
If self.rankingByBestChoosing['CoDual'] is True, 
the ranking-by-choosing was computed on the codual of self.
computeRankingByBestChoosingRelation(self, rankingByBestChoosing=None, Debug=False)
Renders the bipolar-valued relation obtained from
the self.rankingByBestChoosing result.
computeRankingByChoosing(self, actionsSubset=None, Debug=False, CoDual=False)
Computes a weak preordring of the self.actions by iterating
jointly first and last choice elagations.
 
Stores in self.rankingByChoosing['result'] a list of ((P+,bestChoice),(P-,worstChoice)) pairs
where P+ (resp. P-) gives the best (resp. worst) choice complement outranking
(resp. outranked) average valuation via the computePairwiseClusterComparison
method.
 
If self.rankingByChoosing['CoDual'] is True, the ranking-by-choosing was computed on the codual of self.
computeRankingByChoosingRelation(self, rankingByChoosing=None, actionsSubset=None, Debug=False)
Renders the bipolar-valued relation obtained from
the self.rankingByChoosing result.
computeRankingByLastChoosing(self, CoDual=False, Debug=False)
Computes a weak preordring of the self.actions by iterating
worst choice elagations.
 
Stores in self.rankingByLastChoosing['result'] a list of (P-,worstChoice) pairs
where P- gives the worst choice complement outranked
average valuation via the computePairwiseClusterComparison
method.
 
If self.rankingByChoosing['CoDual'] is True, the ranking-by-last-chossing 
was computed on the codual of self.
computeRankingByLastChoosingRelation(self, rankingByLastChoosing=None, Debug=False)
Renders the bipolar-valued relation obtained from
the self.rankingByLastChoosing result.
computeRankingCorrelation(self, ranking, Debug=False)
Renders the ordinal correlation K of a digraph instance
when compared with a given linear ranking of its actions
 
K = sum_{x != y} [ min( max(-self.relation(x,y)),other.relation(x,y), max(self.relation(x,y),-other.relation(x,y)) ]
 
K /= sum_{x!=y} [ min(abs(self.relation(x,y),abs(other.relation(x,y)) ]
 
.. note::
 
     Renders a tuple with at position 0 the actual bipolar correlation index
     and in position 1 the minimal determination level D of self and
     the other relation.
 
     D = sum_{x != y} min(abs(self.relation(x,y)),abs(other.relation(x,y)) / n(n-1)
 
     where n is the number of actions considered.
 
     The correlation index with a completely indeterminate relation
     is by convention 0.0 at determination level 0.0 .
computeRelationalStructure(self, Debug=False)
Renders the counted decomposition of the valued relations into
the following type of links:
gt '>', eq '=', lt '<', incomp '<>',
leq '<=', geq '>=', indeterm '?'
computeRubisChoice(self, Comments=False, _OldCoca=False, BrokenCocs=True, Threading=False, nbrOfCPUs=1)
Renders self.strictGoodChoices, self.nullChoices
self.strictBadChoices, self.nonRobustChoices.
 
.. warning::
    Changes in site the outranking digraph by
    adding or braking chordless odd outranking circuits.
computeRubyChoice(self, Comments=False, _OldCoca=False)
dummy for computeRubisChoice()
old versions compatibility.
computeShortestPathLengths(self, WeakPaths=False, Comments=False, Debug=False)
Renders a double dictionary with the directed distances, i.e. the shortest path lengths between all self.actions
 
Equals *None* if there does not exist a directed path between two actions.
 
*Source*: Claude Berge, *The Theory of Graphs*, Dover (2001) pp. 119, original in French Dunod (1958)
computeSingletonRanking(self, Comments=False, Debug=False)
Renders the sorted bipolar net determinatation of outrankingness
minus outrankedness credibilities of all singleton choices.
 
res = ((netdet,singleton,dom,absorb)+)
computeSize(self)
Renders the number of validated non reflexive arcs
computeSizeTransitiveClosure(self)
Renders the size of the transitive closure of a digraph.
computeSlaterOrder(self, isProbabilistic=False, seed=None, sampleSize=1000, Debug=False)
Reversed return from computeSlaterRanking method.
computeSlaterRanking(self, isProbabilistic=False, seed=None, sampleSize=1000, Debug=False)
Renders a ranking of the actions with minimal Slater index.
Return a tuple: slaterOrder, slaterIndex
computeSymmetryDegree(self, InPercents=False, Comments=False)
Renders the symmetry degree (Decimal) of the irreflexive part of a digraph.
 
.. note::
 
   Empty and indeterminate digraphs are considered to be symmetric.
computeTopologicalRanking(self, Debug=False)
Mimetic Wrapper of the topologicalSort() method.
computeTransitivityDegree(self, InPercents=False, Comments=False)
Renders the transitivity degree (Decimal) of a digraph.
 
.. note:: 
 
   An empty or indeterminate digraph is considered to be transitive.
computeUnrelatedPairs(self)
Renders a list of more or less unrelated pairs.
computeValuationLevels(self, choice=None, Debug=False)
renders the symmetric closure of the
apparent valuations levels of self
in an increasingly ordered list.
If parameter choice is given, the
computation is limited to the actions
of the choice.
computeValuationPercentages(self, choice, percentiles, withValues=False)
Parameters: choice and list of percentiles.
renders a series of percentages of the characteristics valuation of
the arcs in the digraph.
computeValuationPercentiles(self, choice, percentages, withValues=False)
Parameters: choice and list of percentages.
renders a series of quantiles of the characteristics valuation of
the arcs in the digraph.
computeValuationStatistics(self, Sampling=False, Comments=False)
Renders the mean and variance of the valuation
of the non reflexive pairs.
computeValuedRankingRelation(self, ranking)
Renders the valued relation characteristics compatible 
with the given linar ranking. Discordant charcateristics 
are set to the indeterminate value.
computeWeakCondorcetLosers(self)
Wrapper for weakCondorcetLosers().
computeWeakCondorcetWinners(self)
Wrapper for weakCondorcetWinners().
computeupdown1(self, s, S)
Help method for show_MIS_HB2 method.
fills self.newmisset, self.upmis, self.downmis.
computeupdown2(self, s, S)
Help method for show_MIS_HB1 method.
Fills self.newmisset, self.upmis, self.downmis.
computeupdown2irred(self, s, S)
Help method for show_MIS_HB1 method.
Fills self.newmisset, self.upmis, self.downmis.
condorcetLosers(self)
Renders the set of decision actions x such that
self.relation[x][y] < self.valuationdomain['med']
for all y != x.
condorcetWinners(self)
Renders the set of decision actions x such that
self.relation[x][y] > self.valuationdomain['med']
for all y != x.
contra(self, v)
Parameter: choice.
Renders the negation of a choice v characteristic's vector.
convertRelationToDecimal(self)
Converts the float valued self.relation in a decimal valued one.
convertValuation2Integer(self, InSite=True, Comments=False)
Converts the self.relation valuation to integer values by converting the Decimals to Fractions and multiply by the least commun multiple of the fraction denominators.
 
*Parameters*:
 
    - If *Insite* == False (True by default) the method returns a modified copy of self.relation without altering the original self.relation, otherwise self.relation and self.valuationdomain is modified.
convertValuationToDecimal(self)
Convert the float valuation limits to Decimals.
coveringIndex(self, choice, direction='out')
Renders the covering index of a given choice in a set of objects,
ie the minimum number of choice members that cover each
non selected object.
crispKDistance(self, digraph, Debug=False)
Renders the crisp Kendall distance between two bipolar valued
digraphs.
 
.. warning::
 
     Obsolete! Is replaced by the self.computeBipolarCorrelation(other, MedianCut=True) Digraph method
detectChordlessCircuits(self, Comments=False, Debug=False)
Detects a chordless circuit in a digraph.
Returns a Boolean
detectChordlessPath(self, Pk, n2, Comments=False, Debug=False)
New procedure from Agrum study April 2009
recursive chordless path extraction starting from path
Pk = [n2, ...., n1] and ending in node n2.
Optimized with marking of visited chordless P1s.
determinateness(self, vec, inPercent=True)
Renders the determinateness of a characteristic vector *vec* = 
[(r(x),x),(r(y),y), ...] of length *n* in valuationdomain [Min,Med,Max]:
 
*result* =  sum_x( abs(r(x)-Med) ) / ( n*(Max-Med) )
 
If inPercent, *result* shifted (+1) and reduced (/2) to [0,1] range.
digraph2Graph(self, valuationDomain={'min': -1, 'med': 0, 'max': 1}, Debug=False, ConjunctiveConversion=True)
Convert a Digraph instance to a Graph instance.
dneighbors(self, node)
Renders the set of dominated out-neighbors of a node.
domin(self, choice)
Renders the dominance degree of a choice.
dominantChoices(self, S)
Generates all minimal dominant choices of a bipolar valued digraph.
 
.. note::
 
     Initiate with S = self.actions.copy().
domirred(self, choice)
Renders the crips +irredundance degree of a choice.
domirredval(self, choice, relation)
Renders the valued +irredundance degree of a choice.
domirredx(self, choice, x)
Renders the crips +irredundance degree of node x in a choice.
domkernelrestrict(self, prekernel)
Parameter: dominant prekernel
Renders dominant prekernel restricted relation.
exportGraphViz(self, fileName=None, actionsSubset=None, bestChoice=set(), worstChoice=set(), firstChoice=set(), lastChoice=set(), Comments=True, graphType='png', pictureFormat=None, graphSize='7,7', relation=None, bgcolor='cornsilk')
export GraphViz dot file  for graph drawing filtering.
exportPrincipalImage(self, plotFileName=None, pictureFormat='pdf', bgcolor='cornsilk', fontcolor='red3', fontsize='0.75', Reduced=False, Colwise=False, tempDir='.', Comments=False)
Export as PDF (default) the principal projection of
the valued relation using the three principal eigen vectors.
 
Implemeted picture formats are: 
'pdf' (default), 'png', 'jpeg' and 'xfig'.
 
The background color is set by default to 'cornsilk'. 
 
Font size and color are set by default to 'red3', resp. '0.75'. 
 
When *Reduced==True*, the valued relation characeteristics are centered and reduced.
 
When *Colwise==True*, the column vectors of the adjacency table are used for the principal projection, otherwise the rows (default) are used. Has no incidence when the *Digraph* instance *self*  is symmetric. 
 
.. warning::
 
    The method, writing and reading temporary files: 
    tempCol.r and rotationCol.csv, resp. tempRow.r and rotationRow.csv,
    by default in the working directory (./),
    is hence not safe for multiprocessing programs, unless a
    temporary directory *tempDir* is provided.
flatChoice(self, ch, Debug=False)
Converts set or list ch recursively to a flat list of items.
forcedBestSingleChoice(self)
Renders the set of most determined outranking singletons in self.
gammaSets(self)
Renders the dictionary of neighborhoods {node: (dx,ax)}
with set *dx* gathering the dominated, and set *ax* gathering
the absorbed neighborhood.
generateAbsPreKernels(self)
Generate all absorbent prekernels from independent choices generator.
generateDomPreKernels(self)
Generate all dominant prekernels from independent choices generator.
htmlChoiceVector(self, ch, ChoiceVector=True, choiceType='good')
Show procedure for annotated bipolar choices.
inDegrees(self)
renders the median cut indegrees
inDegreesDistribution(self)
Renders the distribution of indegrees.
independentChoices(self, U)
Generator for all independent choices with neighborhoods of a bipolar valued digraph:
 
.. note::
 
       * Initiate with U = self.singletons().
       * Yields [(independent choice, domnb, absnb, indnb)].
inner_prod(self, v1, v2)
Parameters: two choice characteristic vectors
Renders the inner product of two characteristic vetors.
intstab(self, choice)
Computes the independence degree of a choice.
irreflex(self, mat)
Puts diagonal entries of mat to valuationdomain['min']
isAsymmetricIndeterminate(self, Debug=False)
Checks the self.relation for assymmetric indeterminateness!!
 
.. warning::
 
    The reflexive links are ignored !!
isComplete(self, Debug=False)
checks the completeness property of self.relation by checking
for the absence of a link between two actions!!
 
.. warning::
 
    The reflexive links are ignored !!
isCyclic(self, Debug=False)
checks the cyclicity of self.relation by checking
for a reflexive loop in its transitive closure-
 
.. warning::
 
     self.relation is supposed to be irreflexive !
isIntegerValued(self, Debug=False)
Checks whether the decimal valuation of self is integer-valued
be using the as_integer_ratio() method of a Decimal 
giving a tuple (numerator,denominator). If denominator == 1, the
number is an integer.
isOutrankingDigraph(self, Comments=True, Debug=False)
Checks the outranking digraph characteristic condition (3.3).
 
relation[x][y] + relation[y][x)[y] >= 0.0
 
.. warning::
 
    The reflexive links are ignored and the valuation must be bipolar !!
isStrictOutrankingDigraph(self, Comments=True, Debug=False)
Checks the strict outranking digraph characteristic condition (3.1).
 
-(relation[x][y] + relation[y][x]) <= 0.0 , x != y
 
.. warning::
 
    The reflexive links are ignored and the valuation must be bipolar !!
isSymmetric(self, Comments=False)
True if symmetry degree == 1.0.
isTransitive(self, Comments=False)
True if transitivity degree == 1.0.
isWeaklyComplete(self, Debug=False)
checks the weakly completeness property of self.relation by checking
for the absence of a link between two actions!!
 
.. warning::
 
    The reflexive links are ignored !!
iterateRankingByChoosing(self, Odd=False, CoDual=False, Comments=True, Debug=False, Limited=None)
Renders a ranking by choosing result when progressively eliminating
all chordless (odd only) circuits with rising valuation cut levels.
 
Parameters
    CoDual = False (default)/True
    Limited = proportion (in [0,1]) * (max - med) valuationdomain
kChoices(self, A, k)
Renders all choices of length k from set A
matmult2(self, m, v)
Parameters: digraph relation and choice characteristic vector
matrix multiply vector by inner production
meanDegree(self)
Renders the mean degree of self.
!!! self.size must be set previously !!!
meanLength(self, Oriented=False)
Renders the (by default non-oriented) mean neighbourhoor depth of self.
!!! self.order must be set previously !!!
minimalChoices(self, S)
Generates all dominant or absorbent choices of a bipolar
valued digraph.
 
.. note:
 
   * Initiate with S = (actions, dict of dominant or absorbent closed neighborhoods)
   * See showMinDom and showMinAbs methods.
minimalValuationLevelForCircuitsElimination(self, Odd=True, Debug=False, Comments=False)
renders the minimal valuation level <lambda> that eliminates all
self.circuitsList stored odd chordless circuits from self.
 
.. warning::
 
    The <lambda> level polarised may still contain newly appearing chordless odd circuits !
neighbourhoodCollection(self, Oriented=False, Potential=False)
Renders the neighbourhood.
neighbourhoodDepthDistribution(self, Oriented=False)
Renders the distribtion of neighbourhood depths.
notGammaSets(self)
Renders the dictionary of neighborhoods {node: (dx,ax)}
with set *dx* gathering the not dominated, and set *ax* gathering
the not absorbed neighborhood.
notaneighbors(self, node)
Renders the set of absorbed not in-neighbors of a node.
notdneighbors(self, node)
Renders the set of not dominated out-neighbors of a node.
outDegrees(self)
renders the median cut outdegrees
outDegreesDistribution(self)
Renders the distribution of outdegrees.
plusirredundant(self, U)
Generates all +irredundant choices of a digraph.
powerset(self, U)
Generates all subsets of a set.
readPerrinMisset(self, file='curd.dat')
read method for 0-1-char-coded MISs by default from the perrinMIS.c curd.dat result file.
readabsvector(self, x, relation)
Parameter: action x
absorbent in vector.
readdomvector(self, x, relation)
Parameter: action x
dominant out vector.
recodeValuation(self, newMin=-1.0, newMax=1.0, ndigits=4, Debug=False)
Recodes the characteristic valuation domain according
to the parameters given. 
 
*ndigits* indicates the number of decimal digits of the valuation.
relationFct(self, x, y)
wrapper for self.relation dictionary access to ensure interoperability
with the sparse and big outranking digraph implementation model.
save(self, fileName='tempdigraph', option=None, DecimalValuation=True, decDigits=2)
Persistent storage of a Digraph class instance in the form of
a python source code file
saveCSV(self, fileName='tempdigraph', Normalized=False, Dual=False, Converse=False, Diagonal=False, Debug=False)
Persistent storage of a Digraph class instance in the form of
a csv file.
saveXMCDA2(self, fileName='temp', fileExt='xmcda2', Comments=True, relationName='R', relationType='binary', category='random', subcategory='valued', author='digraphs Module (RB)', reference='saved from Python', valuationType='standard', digits=2, servingD3=False)
save digraph in XMCDA 2.0 format. Deprecated now.
savedre(self, fileName='temp')
save digraph in nauty format.
sharp(self, x, y)
Paramaters: choice characteristic values.
Renders the sharpest of two characteristic values x and y.
sharpvec(self, v, w)
Paramaters: choice characteristic vectors.
Renders the sharpest of two characteristic vectors v and w.
showActions(self)
presentation methods for digraphs actions
showAll(self)
Detailed show method for genuine digraphs.
showAttributes(self)
Prints out the attributes of self.
showAutomorphismGenerators(self)
Renders the generators of the automorphism group.
showBadChoices(self, Recompute=True)
Characteristic values for potentially bad choices.
showBestChoiceRecommendation(self, Verbose=False, Comments=True, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True)
Shows the RuBis best choice recommendation.
 
.. note::
 
    Computes by default the Rubis best choice recommendation on the corresponding strict (codual) outranking digraph.
 
    By default, with BrokenCocs=True, we brake all chordless circuits at their weakest determined ( abs(r(x>y)) + abs(r(y>x)) ) link.
 
    When BrokenCocs=False we proceed like follows:
 
    In case of chordless circuits, if supporting arcs are more credible
    than the reversed negating arcs, we collapse the circuits into hyper nodes.
    Inversely,  if supporting arcs are not more credible than the reversed negating arcs,
    we brake the circuits on their weakest arc.
 
Usage example:
 
>>> from outrankingDigraphs import *
>>> t = Random3ObjectivesPerformanceTableau(seed=5)
>>> g = BipolarOutrankingDigraph(t)
>>> g.showBestChoiceRecommendation()
***********************
RuBis Best Choice Recommendation (BCR)
(in decreasing order of determinateness)   
Credibility domain:  [-100.0, 100.0]
=== >> potential first choices
* choice              : ['a04', 'a14', 'a19', 'a20']
   independence        : 1.19
   dominance           : 4.76
   absorbency          : -59.52
   covering (%)        : 75.00
   determinateness (%) : 57.86
   - most credible action(s) = { 'a14': 23.81, 'a19': 11.90, 'a04': 2.38, 'a20': 1.19, }  
=== >> potential last choices 
* choice              : ['a03', 'a12', 'a17']
  independence        : 4.76
  dominance           : -76.19
  absorbency          : 4.76
  covering (%)        : 0.00
  determinateness (%) : 65.39
  - most credible action(s) = { 'a03': 38.10, 'a12': 13.10, 'a17': 4.76, }
Execution time: 0.024 seconds
*****************************
showChoiceVector(self, ch, choiceType='good', ChoiceVector=True)
Show procedure for annotated bipolar choices.
showChordlessCircuits(self, Recompute=False)
Show method for chordless circuits observed in a Digraph instance.
 
If previous computation is required, stores the detected circuits in self.circuitsList attribute.
showCorrelation(self, corr=None, ndigits=3)
Renders the valued ordinal correlation index, the crisp Kendall tau index and their epistemic determination degree.
showFirstChoiceRecommendation(self, Verbose=False, Comments=True, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True)
Shows the RuBis first choice recommendation.
 
.. note::
 
    Computes by default the Rubis first choice recommendation on the corresponding strict (codual) outranking digraph.
 
    By default, with BrokenCocs=True, we brake all chordless circuits at their weakest determined ( abs(r(x>y)) + abs(r(y>x)) ) link.
 
    When BrokenCocs=False we proceed like follows:
 
    In case of chordless circuits, if supporting arcs are more credible
    than the reversed negating arcs, we collapse the circuits into hyper nodes.
    Inversely,  if supporting arcs are not more credible than the reversed negating arcs,
    we brake the circuits on their weakest arc.
 
Usage example:
 
>>> from outrankingDigraphs import *
>>> t = Random3ObjectivesPerformanceTableau(seed=5)
>>> g = BipolarOutrankingDigraph(t)
>>> g.showFirstChoiceRecommendation()
***********************
RuBis First Choice Recommendation (BCR)
(in decreasing order of determinateness)   
Credibility domain:  [-100.0, 100.0]
=== >> potential first choices
* choice              : ['a04', 'a14', 'a19', 'a20']
   independence        : 1.19
   dominance           : 4.76
   absorbency          : -59.52
   covering (%)        : 75.00
   determinateness (%) : 57.86
   - most credible action(s) = { 'a14': 23.81, 'a19': 11.90, 'a04': 2.38, 'a20': 1.19, }  
=== >> potential last choices 
* choice              : ['a03', 'a12', 'a17']
  independence        : 4.76
  dominance           : -76.19
  absorbency          : 4.76
  covering (%)        : 0.00
  determinateness (%) : 65.39
  - most credible action(s) = { 'a03': 38.10, 'a12': 13.10, 'a17': 4.76, }
Execution time: 0.024 seconds
*****************************
showGoodChoices(self, Recompute=True)
Characteristic values for potentially good choices.
showHTMLBestChoiceRecommendation(self, pageTitle=None, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True, htmlFileName=None)
showHTMLRelationHeatmap(self, actionsList=None, rankingRule='NetFlows', colorLevels=7, tableTitle='Relation Heatmap', relationName='r(x S y)', ndigits=2, fromIndex=None, toIndex=None, htmlFileName=None)
Launches a browser window with the colored relation map of self.
 
See corresponding :py:class:`~digraphs.Digraph.showHTMLRelationMap` method.
 
The *colorLevels* parameter may be set to 3, 5, 7 (default) or 9.
 
When the *actionsList* parameter is *None* (default), the digraphs actions list may be ranked with the *rankingRule* parameter set to the 'Copeland' (default) or to the 'Netlows' ranking rule.
 
When the *htmlFileName* parameter is set to a string value 'xxx', a html file named 'xxx.html' will be generated in the current working directory. Otherwise, a temporary file named 'tmp*.html' will be generated there.
 
Example::
 
    >>> from outrankingDigraphs import *
    >>> t = RandomCBPerformanceTableau(numberOfActions=25,seed=1)
    >>> g = BipolarOutrankingDigraph(t,ndigits=2)
    >>> gcd = ~(-g)  # strict outranking relation
    >>> gcd.showHTMLRelationHeatmap(colorLevels=7,ndigits=2)
    
.. image:: relationHeatmap.png
   :alt: Browser view of a relation map
   :width: 600 px
   :align: center
showHTMLRelationMap(self, actionsList=None, rankingRule='Copeland', Colored=True, tableTitle='Relation Map', relationName='r(x S y)', symbols=['+', '&middot;', '&nbsp;', '&#150;', '&#151'], fromIndex=None, toIndex=None, htmlFileName=None)
Launches a browser window with the colored relation map of self.
See corresponding Digraph.showRelationMap() method.
 
When *htmlFileName* parameter is set to a string value, a html file
with that name will be stored in the current working directory.
 
By default, a temporary file named: tmp*.html will be generated
instead in the current working directory.
 
Example::
 
    >>> from outrankingDigraphs import *
    >>> t = RandomCBPerformanceTableau(numberOfActions=25,seed=1)
    >>> g = BipolarOutrankingDigraph(t,Normalized=True)
    >>> gcd = ~(-g)  # strict outranking relation
    >>> gcd.showHTMLRelationMap(rankingRule="NetFlows")
    
.. image:: relationMap.png
   :alt: Browser view of a relation map
   :width: 600 px
   :align: center
showHTMLRelationTable(self, actionsList=None, relation=None, IntegerValues=False, ndigits=2, Colored=True, tableTitle='Valued Adjacency Matrix', relationName='r(x S y)', ReflexiveTerms=False, htmlFileName=None, fromIndex=None, toIndex=None)
Launches a browser window with the colored relation table of self.
showMIS(self, withListing=True)
Prints all maximal independent choices:
    Result in self.misset.
showMIS_AH(self, withListing=True)
Prints all MIS using the Hertz method.
 
Result saved in self.hertzmisset.
showMIS_HB2(self, withListing=True)
Prints all MIS using the Hertz-Bisdorff method.
 
Result saved in self.newmisset.
showMIS_RB(self, withListing=True)
Prints all MIS using the Bisdorff method.
 
Result saved in self.newmisset.
showMIS_UD(self, withListing=True)
Prints all MIS using the Hertz-Bisdorff method.
 
Result saved in self.newmisset.
showMaxAbsIrred(self, withListing=True)
Computing maximal -irredundant choices:
    Result in self.absirset.
showMaxDomIrred(self, withListing=True)
Computing maximal +irredundant choices:
   Result in self.domirset.
showMinAbs(self, withListing=True)
Prints minimal absorbent choices:
    Result in self.absset.
showMinDom(self, withListing=True)
Prints all minimal dominant choices:
    Result in self.domset.
showNeighborhoods(self)
Lists the gamma and the notGamma function of self.
showOrbits(self, InChoices, withListing=True)
Prints the orbits of Choices along the automorphisms of
the Digraph instance.
 
Example Python session for computing the non isomorphic MISs from the 12-cycle graph:
 
>>> from digraphs import *
>>> c12 = CirculantDigraph(order=12,circulants=[1,-1])
>>> c12.automorphismGenerators()
...
  Permutations
  {'1': '1', '2': '12', '3': '11', '4': '10', '5': 
   '9', '6': '8', '7': '7', '8': '6', '9': '5', '10': 
   '4', '11': '3', '12': '2'}
  {'1': '2', '2': '1', '3': '12', '4': '11', '5': '10', 
   '6': '9', '7': '8', '8': '7', '9': '6', '10': '5', 
   '11': '4', '12': '3'}
  Reflections {}
>>> print('grpsize = ', c12.automorphismGroupSize)
  grpsize = 24
>>> c12.showMIS(withListing=False)
  *---  Maximal independent choices ---*
  number of solutions:  29
  cardinality distribution
  card.:  [0, 1, 2, 3, 4,  5,  6, 7, 8, 9, 10, 11, 12]
  freq.:  [0, 0, 0, 0, 3, 24,  2, 0, 0, 0,  0,  0,  0]
  Results in c12.misset
>>> c12.showOrbits(c12.misset,withListing=False)
...
  *---- Global result ----
  Number of MIS:  29
  Number of orbits :  4
  Labelled representatives:
  1: ['2','4','6','8','10','12']
  2: ['2','5','8','11']
  3: ['2','4','6','9','11']
  4: ['1','4','7','9','11']
  Symmetry vector
  stabilizer size: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, ...]
  frequency      : [0, 2, 0, 0, 0, 0, 0, 1, 0,  0,  0,  1, ...]
 
*Figure*: The symmetry axes of the non isomorphic MISs of the 12-cycle:
 
.. image:: c12.png
   :width: 400 px
   :align: center
   :alt: The 4 non isomorphic MIS of the 12-cycle graph
 
*Reference*: R. Bisdorff and J.L. Marichal (2008). Counting non-isomorphic maximal independent sets of the n-cycle graph. *Journal of Integer Sequences*, Vol. 11 Article 08.5.7 (`openly accessible here <https://www.cs.uwaterloo.ca/journals/JIS/VOL11/Marichal/marichal.html>`_)
showOrbitsFromFile(self, InFile, withListing=True)
Prints the orbits of Choices along the automorphisms of
the digraph self by reading in the 0-1 misset file format.
See the :py:func:`digraphs.Digraph.readPerrinMisset` method.
showPreKernels(self, withListing=True)
Printing dominant and absorbent preKernels:
    Result in self.dompreKernels and self.abspreKernels
showRankingByBestChoosing(self, rankingByBestChoosing=None)
A show method for self.rankinByBestChoosing result.
 
.. warning::
 
     The self.computeRankingByBestChoosing(CoDual=False/True) method instantiating the self.rankingByBestChoosing slot is pre-required !
showRankingByChoosing(self, rankingByChoosing=None, WithCoverCredibility=False)
A show method for self.rankinByChoosing result.
 
When parameter *WithCoverCredibility* is set to True, the credibility of outranking, respectively being outranked is indicated at each selection step. 
 
.. warning::
 
     The self.computeRankingByChoosing(CoDual=False/True) method instantiating the self.rankingByChoosing slot is pre-required !
showRankingByLastChoosing(self, rankingByLastChoosing=None, Debug=None)
A show method for self.rankinByChoosing result.
 
.. warning::
 
     The self.computeRankingByLastChoosing(CoDual=False/True) method instantiating the self.rankingByChoosing slot is pre-required !
showRelation(self)
prints the relation valuation in ##.## format.
showRelationMap(self, symbols=None, rankingRule='Copeland', fromIndex=None, toIndex=None, actionsList=None)
Prints on the console, in text map format, the location of
certainly validated and certainly invalidated outranking situations.
 
By default, symbols = {'max':'┬','positive': '+', 'median': ' ',
                       'negative': '-', 'min': '┴'}
 
The default ordering of the output is following the Copeland ranking rule
from best to worst actions. Further available ranking rule is the 'NetFlows' net flows rule.
 
 
Example::
 
    >>> from outrankingDigraphs import *
    >>> t = RandomCBPerformanceTableau(numberOfActions=25,seed=1)
    >>> g = BipolarOutrankingDigraph(t,Normalized=True)
    >>> gcd = ~(-g)  # strict outranking relation
    >>> gcd.showRelationMap(rankingRule="NetFlows")
     -   ++++++++  +++++┬+┬┬+
    - -   + +++++ ++┬+┬+++┬++
    ┴+  ┴ + ++  ++++┬+┬┬++┬++
    -   ++ - ++++-++++++┬++┬+
       - - - ++- ┬- + -+┬+-┬┬
    -----  -      -┬┬┬-+  -┬┬
    ----    --+-+++++++++++++
    -- --+- --++ ++ +++-┬+-┬┬
    ----  -  -+-- ++--+++++ +
    ----- ++- --- +---++++┬ +
    -- -- ---+ -++-+++-+ +-++
    -- --┴---+  + +-++-+ -  +
    ---- ┴---+-- ++--++++ - +
      --┴┴--  --- -  --+ --┬┬
     ---------+--+ ----- +-┬┬
    -┴---┴- ---+- + ---+++┬ +
    -┴┴--┴---+--- ++ -++--+++
    -----┴--- ---+-+- ++---+ 
    -┴┴--------------- --++┬ 
    --┴---------------- --+┬ 
    ┴--┴┴ -┴--┴┴-┴ --++  ++-+
    ----┴┴--------------- -  
    ┴┴┴----+-┴+┴---┴-+---+ ┴+
    ┴┴-┴┴┴-┴- - -┴┴---┴┴+ ┬ -
    ----┴┴-┴-----┴┴---  - -- 
    Ranking rule: NetFlows
    >>>
showRelationTable(self, Sorted=True, rankingRule=None, IntegerValues=False, actionsSubset=None, relation=None, ndigits=2, ReflexiveTerms=True, fromIndex=None, toIndex=None)
Prints the relation valuation in actions X actions table format.
Copeland and NetFlows rankings my be used.
showRubisBestChoiceRecommendation(self, **kwargs)
Dummy for backward portable showBestChoiceRecommendation().
showRubyChoice(self, Verbose=False, Comments=True, _OldCoca=True)
Dummy for showBestChoiceRecommendation()
needed for older versions compatibility.
showShort(self)
concise presentation method for genuine digraphs.
showSingletonRanking(self, Comments=True, Debug=False)
Calls self.computeSingletonRanking(comments=True,Debug = False).
Renders and prints the sorted bipolar net determinatation of outrankingness
minus outrankedness credibilities of all singleton choices.
 
res = ((netdet,sigleton,dom,absorb)+)
showStatistics(self)
Computes digraph statistics like order, size and arc-density.
showdre(self)
Shows relation in nauty format.
singletons(self)
list of singletons and neighborhoods
[(singx1, +nx1, -nx1, not(+nx1 or -nx1)),.... ]
sizeSubGraph(self, choice)
Output: (size, undeterm,arcDensity).
Renders the arc density of the induced subgraph.
strongComponents(self, setPotential=False)
Renders the set of strong components of self.
symDegreesDistribution(self)
Renders the distribution of symmetric degrees.
topologicalSort(self, Debug=False)
If self is acyclic, adds topological sort number to each node of self
and renders ordered list of nodes. Otherwise renders None.
Source: M. Golumbic Algorithmic Graph heory and Perfect Graphs,
Annals Of Discrete Mathematics 57 2nd Ed. , Elsevier 2004, Algorithm 2.4 p.44.
weakAneighbors(self, node)
Renders the set of absorbed in-neighbors of a node.
weakCondorcetLosers(self)
Renders the set of decision actions x such that
self.relation[x][y] <= self.valuationdomain['med']
for all y != x.
weakCondorcetWinners(self)
Renders the set of decision actions x such that
self.relation[x][y] >= self.valuationdomain['med']
for all y != x.
weakDneighbors(self, node)
Renders the set of dominated out-neighbors of a node.
weakGammaSets(self)
Renders the dictionary of neighborhoods {node: (dx,ax)}
zoomValuation(self, zoomFactor=1.0)
Zooms in or out, depending on the value of the zoomFactor provided,
the bipolar valuation of a digraph.

Data descriptors inherited from Digraph:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class SymmetricPartialDigraph(Digraph)
    SymmetricPartialDigraph(digraph)
 
Renders the symmetric part of a Digraph instance.
 
.. note::
 
      - The not symmetric and the reflexive links are all put to the median indeterminate characteristics value!.
      - The constructor makes a deep copy of the given Digraph instance!
 
 
Method resolution order:
SymmetricPartialDigraph
Digraph
builtins.object

Methods defined here:
__init__(self, digraph)
Initialize self.  See help(type(self)) for accurate signature.

Methods inherited from Digraph:
MISgen(self, S, I)
generator of maximal independent choices (voir Byskov 2004):
    * S ::= remaining nodes;
    * I ::= current independent choice
 
.. note::
 
        Inititalize: self.MISgen(self.actions.copy(),set())
__invert__(self)
Make the inverting operator ~self available for Digraph instances. 
 
Returns a ConverseDigraph instance of self.
__neg__(self)
Make the negation operator -self available for Digraph instances. 
 
Returns a DualDigraph instance of self.
__repr__(self)
Default presentation method for Digraph instances.
absirred(self, choice)
Renders the crips -irredundance degree of a choice.
absirredundant(self, U)
Generates all -irredundant choices of a digraph.
absirredval(self, choice, relation)
Renders the valued -irredundance degree of a choice.
absirredx(self, choice, x)
Computes the crips -irredundance degree of node x in a choice.
abskernelrestrict(self, prekernel)
Parameter: prekernel
Renders absorbent prekernel restricted relation.
absorb(self, choice)
Renders the absorbency degree of a choice.
absorbentChoices(self, S)
Generates all minimal absorbent choices of a bipolar valued digraph.
addValuationAttribute(self)
Adds the numpy valuation attribute
agglomerationDistribution(self)
Output: aggloCoeffDistribution, meanCoeff
Renders the distribution of agglomeration coefficients.
aneighbors(self, node)
Renders the set of absorbed in-neighbors of a node.
automorphismGenerators(self)
Adds automorphism group generators to the digraph instance.
 
.. note::
 
    Dependency: Uses the dreadnaut command from the nauty software package. See https://www3.cs.stonybrook.edu/~algorith/implement/nauty/implement.shtml
 
    On Ubuntu Linux:
      ...$ sudo apt-get install nauty
averageCoveringIndex(self, choice, direction='out')
Renders the average covering index of a given choice in a set of objects,
ie the average number of choice members that cover each
non selected object.
bipolarKCorrelation(self, digraph, Debug=False)
Renders the bipolar Kendall correlation between two bipolar valued
digraphs computed from the average valuation of the
XORDigraph(self,digraph) instance.
 
.. warning::
 
     Obsolete! Is replaced by the self.computeBipolarCorrelation(other) Digraph method
bipolarKDistance(self, digraph, Debug=False)
Renders the bipolar crisp Kendall distance between two bipolar valued
digraphs.
 
.. warning::
 
     Obsolete! Is replaced by the self.computeBipolarCorrelation(other, MedianCut=True) Digraph method
chordlessPaths(self, Pk, n2, Odd=False, Comments=False, Debug=False)
New procedure from Agrum study April 2009
recursive chordless path extraction starting from path
Pk = [n2, ...., n1] and ending in node n2.
Optimized with marking of visited chordless P1s.
circuitAverageCredibility(self, circ)
Renders the average linking credibility of a Chordless Circuit.
circuitCredibilities(self, circuit, Debug=False)
Renders the average linking credibilities and the minimal link of a Chordless Circuit.
circuitMaxCredibility(self, circ)
Renders the maximal linking credibility of a Chordless Circuit.
circuitMinCredibility(self, circ)
Renders the minimal linking credibility of a Chordless Circuit.
closeSymmetric(self, InSite=True)
Produces the symmetric closure of self.relation.
closeTransitive(self, Reverse=False, InSite=True, Comments=False)
Produces the transitive closure of self.relation
 
*Parameters*:
 
    - If *Reverse* == True (False default) all transitive links are dropped, otherwise all transitive links are closed with min[r(x,y),r(y,z)];
    - If *Insite* == False (True by default) the methods return a modified copy of self.relation without altering the original self.relation, otherwise self.relation is modified.
components(self)
Renders the list of connected components.
computeAllDensities(self, choice=None)
parameter: choice in self
renders six densitiy parameters:
arc density, double arc density,
single arc density, strict single arc density,
absence arc density, strict absence arc densitiy.
computeArrowRaynaudOrder(self)
Renders a linear ordering from worst to best of the actions following Arrow&Raynaud's rule.
computeArrowRaynaudRanking(self)
renders a linear ranking from best to worst of the actions following Arrow&Raynaud's rule.
computeAverageValuation(self)
Computes the bipolar average correlation between
self and the crisp complete digraph of same order
of the irreflexive and determined arcs of the digraph
computeBadChoices(self, Comments=False)
Computes characteristic values for potentially bad choices.
 
.. note::
 
     Returns a tuple with following content:
 
     [(0)-determ,(1)degirred,(2)degi,(3)degd,(4)dega,(5)str(choice),(6)absvec]
computeBadPirlotChoices(self, Comments=False)
Characteristic values for potentially bad choices
using the Pirlot's fixpoint algorithm.
computeBestChoiceRecommendation(self, Verbose=False, Comments=False, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True)
Sets self.bestChoice, self.bestChoiceData, self.worstChoice and self.worstChoiceData
with the showBestChoiceRecommendation method.
 
First and last choices data is the following:
[(0)-determ,(1)degirred,(2)degi,(3)degd,(4)dega,(5)str(choice),(6)domvec,(7)cover]
 
self.bestChoice = self.bestChoiceData[5]
self.worstChoice = self.worstChoiceData[5]
computeBipolarCorrelation(self, other, MedianCut=False, filterRelation=None, Debug=False)
obsolete: dummy replacement for Digraph.computeOrdinalCorrelation method
computeChordlessCircuits(self, Odd=False, Comments=False, Debug=False)
Renders the set of all chordless circuits detected in a digraph.
Result is stored in <self.circuitsList>
holding a possibly empty list of tuples with at position 0 the
list of adjacent actions of the circuit and at position 1
the set of actions in the stored circuit.
 
When *Odd* is True, only chordless circuits with an odd length
are collected.
computeChordlessCircuitsMP(self, Odd=False, Threading=False, nbrOfCPUs=None, startMethod=None, Comments=False, Debug=False)
Multiprocessing version of computeChordlessCircuits().
 
Renders the set of all chordless odd circuits detected in a digraph.
Result (possible empty list) stored in <self.circuitsList>
holding a possibly empty list tuples with at position 0 the
list of adjacent actions of the circuit and at position 1
the set of actions in the stored circuit.
Inspired by Dias, Castonguay, Longo, Jradi, Algorithmica (2015).
 
Returns a possibly empty list of tuples (circuit,frozenset(circuit)).
 
If Odd == True, only circuits of odd length are retained in the result.
computeCoSize(self)
Renders the number of non validated non reflexive arcs
computeConcentrationIndex(self, X, N)
Renders the Gini concentration index of the X serie.
N contains the partial frequencies.
Based on the triangle summation formula.
computeConcentrationIndexTrapez(self, X, N)
Renders the Gini concentration index of the X serie.
N contains the partial frequencies.
Based on the triangles summation formula.
computeCondorcetLosers(self)
Wrapper for condorcetLosers().
computeCondorcetWinners(self)
Wrapper for condorcetWinners().
computeCopelandOrder(self)
renders a linear ordering from worst to best of the actions following Arrow&Raynaud's rule.
computeCopelandRanking(self)
renders a linear ranking from best to worst of the actions following Arrow&Raynaud's rule.
computeCutLevelDensities(self, choice, level)
parameter: choice in self, robustness level
renders three robust densitiy parameters:
robust double arc density,
robust single arc density,
robust absence arc densitiy.
computeDensities(self, choice)
parameter: choice in self
renders the four densitiy parameters:
arc density, double arc density, single arc density, absence arc density.
computeDeterminateness(self, InPercents=False)
Computes the Kendalll distance of self
with the all median-valued indeterminate digraph of order n.
 
Return the average determination of the irreflexive part of the digraph.
 
*determination* = sum_(x,y) { abs[ r(xRy) - Med ] } / n(n-1)
 
If *InPercents* is True, returns the average determination in percentage of
(Max - Med) difference.
 
>>> from outrankingDigraphs import BipolarOutrankingDigraph
>>> from randomPerfTabs import Random3ObjectivesPerformanceTableau
>>> t = Random3ObjectivesPerformanceTableau(numberOfActions=7,numberOfCriteria=7,seed=101)
>>> g = BipolarOutrankingDigraph(t,Normalized=True)
>>> g
*------- Object instance description ------*
Instance class      : BipolarOutrankingDigraph
Instance name       : rel_random3ObjectivesPerfTab
Actions             : 7
Criteria            : 7
Size                : 27
Determinateness (%) : 65.67
Valuation domain    : [-1.00;1.00]
>>> print(g.computeDeterminateness())
0.3134920634920634920634920638
>>> print(g.computeDeterminateness(InPercents=True))
65.67460317460317460317460320
>>> g.recodeValuation(0,1)
>>> g
*------- Object instance description ------*
Instance class      : BipolarOutrankingDigraph
Instance name       : rel_random3ObjectivesPerfTab
Actions             : 7
Criteria            : 7
Size                : 27
Determinateness (%) : 65.67
Valuation domain    : [0.00;1.00]
>>> print(g.computeDeterminateness())
0.1567460317460317460317460318
>>> print(g.computeDeterminateness(InPercents=True))
65.67460317460317460317460320
computeDiameter(self, Oriented=True)
Renders the (by default oriented) diameter of the digraph instance
computeDigraphCentres(self, WeakDistances=False, Comments=False)
The centers of a digraph are the nodes with finite minimal shortes path lengths.
 
The maximal neighborhood distances are stored in *self.maximalNeighborhoodDistances*.
 
The corresponding digraph radius and diameter are stored respectively  in *self.radius* and *self.diameter*.
 
With *Comments* = True, all these results are printed out.
 
*Source*: Claude Berge, *The Theory of Graphs*, Dover (2001) pp. 119, original in French Dunod (1958)
computeDynamicProgrammingStages(self, source, sink, Debug=False)
Renders the discrete stages of the optimal substructure for
dynamic pogramming digrahs from a given source node 
to a given sink sink node.
 
Returns a list of list of action identifyers.
computeGoodChoiceVector(self, ker, Comments=False)
| Computing Characteristic values for dominant pre-kernels
| using the von Neumann dual fixoint equation
computeGoodChoices(self, Comments=False)
Computes characteristic values for potentially good choices.
 
..note::
 
     Return a tuple with following content:
 
     [(0)-determ,(1)degirred,(2)degi,(3)degd,(4)dega,(5)str(choice),(6)domvec,(7)cover]
computeGoodPirlotChoices(self, Comments=False)
Characteristic values for potentially good choices
using the Pirlot fixpoint algorithm.
computeIncomparabilityDegree(self, InPercents=False, Comments=False)
Renders the incomparability degree (Decimal), i.e. the relative number of symmetric indeterminate relations of the irreflexive part of a digraph.
computeKemenyIndex(self, otherRelation)
renders the Kemeny index of the self.relation
compared with a given crisp valued relation of a compatible
other digraph (same nodes or actions).
computeKemenyOrder(self, orderLimit=7, Debug=False)
Renders a ordering from worst to best of the actions with maximal Kemeny index.
Return a tuple: kemenyOrder (from worst to best), kemenyIndex
computeKemenyRanking(self, orderLimit=7, seed=None, sampleSize=1000, Debug=False)
Renders a ranking from best to worst of the actions with maximal Kemeny index.
 
.. note::
 
     Returns a tuple: kemenyRanking (from best to worst), kemenyIndex.
computeKernelVector(self, kernel, Initial=True, Comments=False)
| Computing Characteristic values for dominant pre-kernels
| using the von Neumann dual fixpoint equation
computeKohlerOrder(self)
Renders an ordering (worst to best) of the actions following Kohler's rule.
computeKohlerRanking(self)
Renders a ranking (best to worst) of the actions following Kohler's rule.
computeMaxHoleSize(self, Comments=False)
Renders the length of the largest chordless cycle
in the corresponding disjunctive undirected graph.
computeMeanInDegree(self)
Renders the mean indegree of self.
!!! self.size must be set previously !!!
computeMeanOutDegree(self)
Renders the mean degree of self.
!!! self.size must be set previously !!!
computeMeanSymDegree(self)
Renders the mean degree of self.
!!! self.size must be set previously !!!
computeMedianOutDegree(self)
Renders the median outdegree of self.
!!! self.size must be set previously !!!
computeMedianSymDegree(self)
Renders the median symmetric degree of self.
!!! self.size must be set previously !!!
computeMoreOrLessUnrelatedPairs(self)
Renders a list of more or less unrelated pairs.
computeNetFlowsOrder(self)
Renders an ordered list (from best to worst) of the actions
following the net flows ranking rule.
computeNetFlowsOrderDict(self)
Renders an ordered list (from worst to best) of the actions
following the net flows ranking rule.
computeNetFlowsRanking(self)
Renders an ordered list (from best to worst) of the actions
following the net flows ranking rule.
computeNetFlowsRankingDict(self)
Renders an ordered list (from best to worst) of the actions
following the net flows ranking rule.
computeODistance(self, op2, comments=False)
renders the squared normalized distance of
two digraph valuations.
 
.. note::
 
     op2 = digraphs of same order as self.
computeOrbit(self, choice, withListing=False)
renders the set of isomorph copies of a choice following
the automorphism of the digraph self
computeOrderCorrelation(self, order, Debug=False)
Renders the ordinal correlation K of a digraph instance
when compared with a given linear order (from worst to best) of its actions
 
K = sum_{x != y} [ min( max(-self.relation(x,y)),other.relation(x,y), max(self.relation(x,y),-other.relation(x,y)) ]
 
K /= sum_{x!=y} [ min(abs(self.relation(x,y),abs(other.relation(x,y)) ]
 
.. note::
 
     Renders a dictionary with the key 'correlation' containing the actual bipolar correlation index and the key 'determination' containing the minimal determination level D of self and the other relation.
 
     D = sum_{x != y} min(abs(self.relation(x,y)),abs(other.relation(x,y)) / n(n-1)
 
     where n is the number of actions considered.
 
     The correlation index with a completely indeterminate relation
     is by convention 0.0 at determination level 0.0 .
 
.. warning::
 
     self must be a normalized outranking digraph instance !
computeOrdinalCorrelation(self, other, MedianCut=False, filterRelation=None, Debug=False)
Renders the bipolar correlation K of a
self.relation when compared
with a given compatible (same actions set)) digraph or
a [-1,1] valued compatible relation (same actions set).
 
If MedianCut=True, the correlation is computed on the median polarized relations.
 
If filterRelation is not None, the correlation is computed on the partial domain corresponding to the determined part of the filter relation.
 
.. warning::
 
     Notice that the 'other' relation and/or the 'filterRelation',
     the case given, must both be normalized, ie [-1,1]-valued !
 
K = sum_{x != y} [ min( max(-self.relation[x][y]),other.relation[x][y]), max(self.relation[x][y],-other.relation[x][y]) ]
 
K /= sum_{x!=y} [ min(abs(self.relation[x][y]),abs(other.relation[x][y])) ]
 
.. note::
 
     Renders a tuple with at position 0 the actual bipolar correlation index
     and in position 1 the minimal determination level D of self and
     the other relation.
 
     D = sum_{x != y} min(abs(self.relation[x][y]),abs(other.relation[x][y])) / n(n-1)
 
     where n is the number of actions considered.
 
     The correlation index with a completely indeterminate relation
     is by convention 0.0 at determination level 0.0 .
computeOrdinalCorrelationMP(self, other, MedianCut=False, Threading=False, nbrOfCPUs=None, startMethod=None, Comments=False, Debug=False)
Multi processing version of the digraphs.computeOrdinalCorrelation() method.
 
.. note::
     The relation filtering and the MedinaCut option are not implemented in the MP version.
computePairwiseClusterComparison(self, K1, K2, Debug=False)
Computes the pairwise cluster comparison credibility vector
from bipolar-valued digraph g. with K1 and K2 disjoint
lists of action keys from g actions disctionary.
Returns the dictionary
{'I': Decimal(),'P+':Decimal(),'P-':Decimal(),'R' :Decimal()}
where one and only one item is strictly positive.
computePreKernels(self)
computing dominant and absorbent preKernels:
    Result in self.dompreKernels and self.abspreKernels
computePreRankingRelation(self, preRanking, Normalized=True, Debug=False)
Renders the bipolar-valued relation obtained from
a given preRanking in decreasing levels (list of lists) result.
computePreorderRelation(self, preorder, Normalized=True, Debug=False)
Renders the bipolar-valued relation obtained from
a given preordering in increasing levels (list of lists) result.
computePrincipalOrder(self, Colwise=False, Comments=False)
Rendesr an ordering from wrost to best of the decision actions.
computePrincipalRanking(self, Colwise=False, Comments=False)
Rendesr a ranking from best to worst of the decision actions.
computePrincipalScores(self, plotFileName=None, Colwise=False, imageType=None, tempDir=None, bgcolor='cornsilk', Comments=False, Debug=False)
Renders a ordered list of the first principal eigenvector of the covariance of the valued outdegrees of self.
 
.. note::
 
   The method, relying on writing and reading temporary files by default in a temporary directory is threading and multiprocessing safe !
   (see Digraph.exportPrincipalImage method)
computePrudentBetaLevel(self, Debug=False)
computes alpha, ie the lowest valuation level, for which the
bipolarly polarised digraph doesn't contain a chordless circuit.
computeRankingByBestChoosing(self, CoDual=False, Debug=False)
Computes a weak preordering of the self.actions by recursive
best choice elagations.
 
Stores in self.rankingByBestChoosing['result'] a list of (P+,bestChoice) tuples
where P+ gives the best choice complement outranking
average valuation via the computePairwiseClusterComparison
method.
 
If self.rankingByBestChoosing['CoDual'] is True, 
the ranking-by-choosing was computed on the codual of self.
computeRankingByBestChoosingRelation(self, rankingByBestChoosing=None, Debug=False)
Renders the bipolar-valued relation obtained from
the self.rankingByBestChoosing result.
computeRankingByChoosing(self, actionsSubset=None, Debug=False, CoDual=False)
Computes a weak preordring of the self.actions by iterating
jointly first and last choice elagations.
 
Stores in self.rankingByChoosing['result'] a list of ((P+,bestChoice),(P-,worstChoice)) pairs
where P+ (resp. P-) gives the best (resp. worst) choice complement outranking
(resp. outranked) average valuation via the computePairwiseClusterComparison
method.
 
If self.rankingByChoosing['CoDual'] is True, the ranking-by-choosing was computed on the codual of self.
computeRankingByChoosingRelation(self, rankingByChoosing=None, actionsSubset=None, Debug=False)
Renders the bipolar-valued relation obtained from
the self.rankingByChoosing result.
computeRankingByLastChoosing(self, CoDual=False, Debug=False)
Computes a weak preordring of the self.actions by iterating
worst choice elagations.
 
Stores in self.rankingByLastChoosing['result'] a list of (P-,worstChoice) pairs
where P- gives the worst choice complement outranked
average valuation via the computePairwiseClusterComparison
method.
 
If self.rankingByChoosing['CoDual'] is True, the ranking-by-last-chossing 
was computed on the codual of self.
computeRankingByLastChoosingRelation(self, rankingByLastChoosing=None, Debug=False)
Renders the bipolar-valued relation obtained from
the self.rankingByLastChoosing result.
computeRankingCorrelation(self, ranking, Debug=False)
Renders the ordinal correlation K of a digraph instance
when compared with a given linear ranking of its actions
 
K = sum_{x != y} [ min( max(-self.relation(x,y)),other.relation(x,y), max(self.relation(x,y),-other.relation(x,y)) ]
 
K /= sum_{x!=y} [ min(abs(self.relation(x,y),abs(other.relation(x,y)) ]
 
.. note::
 
     Renders a tuple with at position 0 the actual bipolar correlation index
     and in position 1 the minimal determination level D of self and
     the other relation.
 
     D = sum_{x != y} min(abs(self.relation(x,y)),abs(other.relation(x,y)) / n(n-1)
 
     where n is the number of actions considered.
 
     The correlation index with a completely indeterminate relation
     is by convention 0.0 at determination level 0.0 .
computeRelationalStructure(self, Debug=False)
Renders the counted decomposition of the valued relations into
the following type of links:
gt '>', eq '=', lt '<', incomp '<>',
leq '<=', geq '>=', indeterm '?'
computeRubisChoice(self, Comments=False, _OldCoca=False, BrokenCocs=True, Threading=False, nbrOfCPUs=1)
Renders self.strictGoodChoices, self.nullChoices
self.strictBadChoices, self.nonRobustChoices.
 
.. warning::
    Changes in site the outranking digraph by
    adding or braking chordless odd outranking circuits.
computeRubyChoice(self, Comments=False, _OldCoca=False)
dummy for computeRubisChoice()
old versions compatibility.
computeShortestPathLengths(self, WeakPaths=False, Comments=False, Debug=False)
Renders a double dictionary with the directed distances, i.e. the shortest path lengths between all self.actions
 
Equals *None* if there does not exist a directed path between two actions.
 
*Source*: Claude Berge, *The Theory of Graphs*, Dover (2001) pp. 119, original in French Dunod (1958)
computeSingletonRanking(self, Comments=False, Debug=False)
Renders the sorted bipolar net determinatation of outrankingness
minus outrankedness credibilities of all singleton choices.
 
res = ((netdet,singleton,dom,absorb)+)
computeSize(self)
Renders the number of validated non reflexive arcs
computeSizeTransitiveClosure(self)
Renders the size of the transitive closure of a digraph.
computeSlaterOrder(self, isProbabilistic=False, seed=None, sampleSize=1000, Debug=False)
Reversed return from computeSlaterRanking method.
computeSlaterRanking(self, isProbabilistic=False, seed=None, sampleSize=1000, Debug=False)
Renders a ranking of the actions with minimal Slater index.
Return a tuple: slaterOrder, slaterIndex
computeSymmetryDegree(self, InPercents=False, Comments=False)
Renders the symmetry degree (Decimal) of the irreflexive part of a digraph.
 
.. note::
 
   Empty and indeterminate digraphs are considered to be symmetric.
computeTopologicalRanking(self, Debug=False)
Mimetic Wrapper of the topologicalSort() method.
computeTransitivityDegree(self, InPercents=False, Comments=False)
Renders the transitivity degree (Decimal) of a digraph.
 
.. note:: 
 
   An empty or indeterminate digraph is considered to be transitive.
computeUnrelatedPairs(self)
Renders a list of more or less unrelated pairs.
computeValuationLevels(self, choice=None, Debug=False)
renders the symmetric closure of the
apparent valuations levels of self
in an increasingly ordered list.
If parameter choice is given, the
computation is limited to the actions
of the choice.
computeValuationPercentages(self, choice, percentiles, withValues=False)
Parameters: choice and list of percentiles.
renders a series of percentages of the characteristics valuation of
the arcs in the digraph.
computeValuationPercentiles(self, choice, percentages, withValues=False)
Parameters: choice and list of percentages.
renders a series of quantiles of the characteristics valuation of
the arcs in the digraph.
computeValuationStatistics(self, Sampling=False, Comments=False)
Renders the mean and variance of the valuation
of the non reflexive pairs.
computeValuedRankingRelation(self, ranking)
Renders the valued relation characteristics compatible 
with the given linar ranking. Discordant charcateristics 
are set to the indeterminate value.
computeWeakCondorcetLosers(self)
Wrapper for weakCondorcetLosers().
computeWeakCondorcetWinners(self)
Wrapper for weakCondorcetWinners().
computeupdown1(self, s, S)
Help method for show_MIS_HB2 method.
fills self.newmisset, self.upmis, self.downmis.
computeupdown2(self, s, S)
Help method for show_MIS_HB1 method.
Fills self.newmisset, self.upmis, self.downmis.
computeupdown2irred(self, s, S)
Help method for show_MIS_HB1 method.
Fills self.newmisset, self.upmis, self.downmis.
condorcetLosers(self)
Renders the set of decision actions x such that
self.relation[x][y] < self.valuationdomain['med']
for all y != x.
condorcetWinners(self)
Renders the set of decision actions x such that
self.relation[x][y] > self.valuationdomain['med']
for all y != x.
contra(self, v)
Parameter: choice.
Renders the negation of a choice v characteristic's vector.
convertRelationToDecimal(self)
Converts the float valued self.relation in a decimal valued one.
convertValuation2Integer(self, InSite=True, Comments=False)
Converts the self.relation valuation to integer values by converting the Decimals to Fractions and multiply by the least commun multiple of the fraction denominators.
 
*Parameters*:
 
    - If *Insite* == False (True by default) the method returns a modified copy of self.relation without altering the original self.relation, otherwise self.relation and self.valuationdomain is modified.
convertValuationToDecimal(self)
Convert the float valuation limits to Decimals.
coveringIndex(self, choice, direction='out')
Renders the covering index of a given choice in a set of objects,
ie the minimum number of choice members that cover each
non selected object.
crispKDistance(self, digraph, Debug=False)
Renders the crisp Kendall distance between two bipolar valued
digraphs.
 
.. warning::
 
     Obsolete! Is replaced by the self.computeBipolarCorrelation(other, MedianCut=True) Digraph method
detectChordlessCircuits(self, Comments=False, Debug=False)
Detects a chordless circuit in a digraph.
Returns a Boolean
detectChordlessPath(self, Pk, n2, Comments=False, Debug=False)
New procedure from Agrum study April 2009
recursive chordless path extraction starting from path
Pk = [n2, ...., n1] and ending in node n2.
Optimized with marking of visited chordless P1s.
determinateness(self, vec, inPercent=True)
Renders the determinateness of a characteristic vector *vec* = 
[(r(x),x),(r(y),y), ...] of length *n* in valuationdomain [Min,Med,Max]:
 
*result* =  sum_x( abs(r(x)-Med) ) / ( n*(Max-Med) )
 
If inPercent, *result* shifted (+1) and reduced (/2) to [0,1] range.
digraph2Graph(self, valuationDomain={'min': -1, 'med': 0, 'max': 1}, Debug=False, ConjunctiveConversion=True)
Convert a Digraph instance to a Graph instance.
dneighbors(self, node)
Renders the set of dominated out-neighbors of a node.
domin(self, choice)
Renders the dominance degree of a choice.
dominantChoices(self, S)
Generates all minimal dominant choices of a bipolar valued digraph.
 
.. note::
 
     Initiate with S = self.actions.copy().
domirred(self, choice)
Renders the crips +irredundance degree of a choice.
domirredval(self, choice, relation)
Renders the valued +irredundance degree of a choice.
domirredx(self, choice, x)
Renders the crips +irredundance degree of node x in a choice.
domkernelrestrict(self, prekernel)
Parameter: dominant prekernel
Renders dominant prekernel restricted relation.
exportGraphViz(self, fileName=None, actionsSubset=None, bestChoice=set(), worstChoice=set(), firstChoice=set(), lastChoice=set(), Comments=True, graphType='png', pictureFormat=None, graphSize='7,7', relation=None, bgcolor='cornsilk')
export GraphViz dot file  for graph drawing filtering.
exportPrincipalImage(self, plotFileName=None, pictureFormat='pdf', bgcolor='cornsilk', fontcolor='red3', fontsize='0.75', Reduced=False, Colwise=False, tempDir='.', Comments=False)
Export as PDF (default) the principal projection of
the valued relation using the three principal eigen vectors.
 
Implemeted picture formats are: 
'pdf' (default), 'png', 'jpeg' and 'xfig'.
 
The background color is set by default to 'cornsilk'. 
 
Font size and color are set by default to 'red3', resp. '0.75'. 
 
When *Reduced==True*, the valued relation characeteristics are centered and reduced.
 
When *Colwise==True*, the column vectors of the adjacency table are used for the principal projection, otherwise the rows (default) are used. Has no incidence when the *Digraph* instance *self*  is symmetric. 
 
.. warning::
 
    The method, writing and reading temporary files: 
    tempCol.r and rotationCol.csv, resp. tempRow.r and rotationRow.csv,
    by default in the working directory (./),
    is hence not safe for multiprocessing programs, unless a
    temporary directory *tempDir* is provided.
flatChoice(self, ch, Debug=False)
Converts set or list ch recursively to a flat list of items.
forcedBestSingleChoice(self)
Renders the set of most determined outranking singletons in self.
gammaSets(self)
Renders the dictionary of neighborhoods {node: (dx,ax)}
with set *dx* gathering the dominated, and set *ax* gathering
the absorbed neighborhood.
generateAbsPreKernels(self)
Generate all absorbent prekernels from independent choices generator.
generateDomPreKernels(self)
Generate all dominant prekernels from independent choices generator.
htmlChoiceVector(self, ch, ChoiceVector=True, choiceType='good')
Show procedure for annotated bipolar choices.
inDegrees(self)
renders the median cut indegrees
inDegreesDistribution(self)
Renders the distribution of indegrees.
independentChoices(self, U)
Generator for all independent choices with neighborhoods of a bipolar valued digraph:
 
.. note::
 
       * Initiate with U = self.singletons().
       * Yields [(independent choice, domnb, absnb, indnb)].
inner_prod(self, v1, v2)
Parameters: two choice characteristic vectors
Renders the inner product of two characteristic vetors.
intstab(self, choice)
Computes the independence degree of a choice.
irreflex(self, mat)
Puts diagonal entries of mat to valuationdomain['min']
isAsymmetricIndeterminate(self, Debug=False)
Checks the self.relation for assymmetric indeterminateness!!
 
.. warning::
 
    The reflexive links are ignored !!
isComplete(self, Debug=False)
checks the completeness property of self.relation by checking
for the absence of a link between two actions!!
 
.. warning::
 
    The reflexive links are ignored !!
isCyclic(self, Debug=False)
checks the cyclicity of self.relation by checking
for a reflexive loop in its transitive closure-
 
.. warning::
 
     self.relation is supposed to be irreflexive !
isIntegerValued(self, Debug=False)
Checks whether the decimal valuation of self is integer-valued
be using the as_integer_ratio() method of a Decimal 
giving a tuple (numerator,denominator). If denominator == 1, the
number is an integer.
isOutrankingDigraph(self, Comments=True, Debug=False)
Checks the outranking digraph characteristic condition (3.3).
 
relation[x][y] + relation[y][x)[y] >= 0.0
 
.. warning::
 
    The reflexive links are ignored and the valuation must be bipolar !!
isStrictOutrankingDigraph(self, Comments=True, Debug=False)
Checks the strict outranking digraph characteristic condition (3.1).
 
-(relation[x][y] + relation[y][x]) <= 0.0 , x != y
 
.. warning::
 
    The reflexive links are ignored and the valuation must be bipolar !!
isSymmetric(self, Comments=False)
True if symmetry degree == 1.0.
isTransitive(self, Comments=False)
True if transitivity degree == 1.0.
isWeaklyComplete(self, Debug=False)
checks the weakly completeness property of self.relation by checking
for the absence of a link between two actions!!
 
.. warning::
 
    The reflexive links are ignored !!
iterateRankingByChoosing(self, Odd=False, CoDual=False, Comments=True, Debug=False, Limited=None)
Renders a ranking by choosing result when progressively eliminating
all chordless (odd only) circuits with rising valuation cut levels.
 
Parameters
    CoDual = False (default)/True
    Limited = proportion (in [0,1]) * (max - med) valuationdomain
kChoices(self, A, k)
Renders all choices of length k from set A
matmult2(self, m, v)
Parameters: digraph relation and choice characteristic vector
matrix multiply vector by inner production
meanDegree(self)
Renders the mean degree of self.
!!! self.size must be set previously !!!
meanLength(self, Oriented=False)
Renders the (by default non-oriented) mean neighbourhoor depth of self.
!!! self.order must be set previously !!!
minimalChoices(self, S)
Generates all dominant or absorbent choices of a bipolar
valued digraph.
 
.. note:
 
   * Initiate with S = (actions, dict of dominant or absorbent closed neighborhoods)
   * See showMinDom and showMinAbs methods.
minimalValuationLevelForCircuitsElimination(self, Odd=True, Debug=False, Comments=False)
renders the minimal valuation level <lambda> that eliminates all
self.circuitsList stored odd chordless circuits from self.
 
.. warning::
 
    The <lambda> level polarised may still contain newly appearing chordless odd circuits !
neighbourhoodCollection(self, Oriented=False, Potential=False)
Renders the neighbourhood.
neighbourhoodDepthDistribution(self, Oriented=False)
Renders the distribtion of neighbourhood depths.
notGammaSets(self)
Renders the dictionary of neighborhoods {node: (dx,ax)}
with set *dx* gathering the not dominated, and set *ax* gathering
the not absorbed neighborhood.
notaneighbors(self, node)
Renders the set of absorbed not in-neighbors of a node.
notdneighbors(self, node)
Renders the set of not dominated out-neighbors of a node.
outDegrees(self)
renders the median cut outdegrees
outDegreesDistribution(self)
Renders the distribution of outdegrees.
plusirredundant(self, U)
Generates all +irredundant choices of a digraph.
powerset(self, U)
Generates all subsets of a set.
readPerrinMisset(self, file='curd.dat')
read method for 0-1-char-coded MISs by default from the perrinMIS.c curd.dat result file.
readabsvector(self, x, relation)
Parameter: action x
absorbent in vector.
readdomvector(self, x, relation)
Parameter: action x
dominant out vector.
recodeValuation(self, newMin=-1.0, newMax=1.0, ndigits=4, Debug=False)
Recodes the characteristic valuation domain according
to the parameters given. 
 
*ndigits* indicates the number of decimal digits of the valuation.
relationFct(self, x, y)
wrapper for self.relation dictionary access to ensure interoperability
with the sparse and big outranking digraph implementation model.
save(self, fileName='tempdigraph', option=None, DecimalValuation=True, decDigits=2)
Persistent storage of a Digraph class instance in the form of
a python source code file
saveCSV(self, fileName='tempdigraph', Normalized=False, Dual=False, Converse=False, Diagonal=False, Debug=False)
Persistent storage of a Digraph class instance in the form of
a csv file.
saveXMCDA2(self, fileName='temp', fileExt='xmcda2', Comments=True, relationName='R', relationType='binary', category='random', subcategory='valued', author='digraphs Module (RB)', reference='saved from Python', valuationType='standard', digits=2, servingD3=False)
save digraph in XMCDA 2.0 format. Deprecated now.
savedre(self, fileName='temp')
save digraph in nauty format.
sharp(self, x, y)
Paramaters: choice characteristic values.
Renders the sharpest of two characteristic values x and y.
sharpvec(self, v, w)
Paramaters: choice characteristic vectors.
Renders the sharpest of two characteristic vectors v and w.
showActions(self)
presentation methods for digraphs actions
showAll(self)
Detailed show method for genuine digraphs.
showAttributes(self)
Prints out the attributes of self.
showAutomorphismGenerators(self)
Renders the generators of the automorphism group.
showBadChoices(self, Recompute=True)
Characteristic values for potentially bad choices.
showBestChoiceRecommendation(self, Verbose=False, Comments=True, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True)
Shows the RuBis best choice recommendation.
 
.. note::
 
    Computes by default the Rubis best choice recommendation on the corresponding strict (codual) outranking digraph.
 
    By default, with BrokenCocs=True, we brake all chordless circuits at their weakest determined ( abs(r(x>y)) + abs(r(y>x)) ) link.
 
    When BrokenCocs=False we proceed like follows:
 
    In case of chordless circuits, if supporting arcs are more credible
    than the reversed negating arcs, we collapse the circuits into hyper nodes.
    Inversely,  if supporting arcs are not more credible than the reversed negating arcs,
    we brake the circuits on their weakest arc.
 
Usage example:
 
>>> from outrankingDigraphs import *
>>> t = Random3ObjectivesPerformanceTableau(seed=5)
>>> g = BipolarOutrankingDigraph(t)
>>> g.showBestChoiceRecommendation()
***********************
RuBis Best Choice Recommendation (BCR)
(in decreasing order of determinateness)   
Credibility domain:  [-100.0, 100.0]
=== >> potential first choices
* choice              : ['a04', 'a14', 'a19', 'a20']
   independence        : 1.19
   dominance           : 4.76
   absorbency          : -59.52
   covering (%)        : 75.00
   determinateness (%) : 57.86
   - most credible action(s) = { 'a14': 23.81, 'a19': 11.90, 'a04': 2.38, 'a20': 1.19, }  
=== >> potential last choices 
* choice              : ['a03', 'a12', 'a17']
  independence        : 4.76
  dominance           : -76.19
  absorbency          : 4.76
  covering (%)        : 0.00
  determinateness (%) : 65.39
  - most credible action(s) = { 'a03': 38.10, 'a12': 13.10, 'a17': 4.76, }
Execution time: 0.024 seconds
*****************************
showChoiceVector(self, ch, choiceType='good', ChoiceVector=True)
Show procedure for annotated bipolar choices.
showChordlessCircuits(self, Recompute=False)
Show method for chordless circuits observed in a Digraph instance.
 
If previous computation is required, stores the detected circuits in self.circuitsList attribute.
showComponents(self)
Shows the list of connected components of the digraph instance.
showCorrelation(self, corr=None, ndigits=3)
Renders the valued ordinal correlation index, the crisp Kendall tau index and their epistemic determination degree.
showFirstChoiceRecommendation(self, Verbose=False, Comments=True, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True)
Shows the RuBis first choice recommendation.
 
.. note::
 
    Computes by default the Rubis first choice recommendation on the corresponding strict (codual) outranking digraph.
 
    By default, with BrokenCocs=True, we brake all chordless circuits at their weakest determined ( abs(r(x>y)) + abs(r(y>x)) ) link.
 
    When BrokenCocs=False we proceed like follows:
 
    In case of chordless circuits, if supporting arcs are more credible
    than the reversed negating arcs, we collapse the circuits into hyper nodes.
    Inversely,  if supporting arcs are not more credible than the reversed negating arcs,
    we brake the circuits on their weakest arc.
 
Usage example:
 
>>> from outrankingDigraphs import *
>>> t = Random3ObjectivesPerformanceTableau(seed=5)
>>> g = BipolarOutrankingDigraph(t)
>>> g.showFirstChoiceRecommendation()
***********************
RuBis First Choice Recommendation (BCR)
(in decreasing order of determinateness)   
Credibility domain:  [-100.0, 100.0]
=== >> potential first choices
* choice              : ['a04', 'a14', 'a19', 'a20']
   independence        : 1.19
   dominance           : 4.76
   absorbency          : -59.52
   covering (%)        : 75.00
   determinateness (%) : 57.86
   - most credible action(s) = { 'a14': 23.81, 'a19': 11.90, 'a04': 2.38, 'a20': 1.19, }  
=== >> potential last choices 
* choice              : ['a03', 'a12', 'a17']
  independence        : 4.76
  dominance           : -76.19
  absorbency          : 4.76
  covering (%)        : 0.00
  determinateness (%) : 65.39
  - most credible action(s) = { 'a03': 38.10, 'a12': 13.10, 'a17': 4.76, }
Execution time: 0.024 seconds
*****************************
showGoodChoices(self, Recompute=True)
Characteristic values for potentially good choices.
showHTMLBestChoiceRecommendation(self, pageTitle=None, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True, htmlFileName=None)
showHTMLRelationHeatmap(self, actionsList=None, rankingRule='NetFlows', colorLevels=7, tableTitle='Relation Heatmap', relationName='r(x S y)', ndigits=2, fromIndex=None, toIndex=None, htmlFileName=None)
Launches a browser window with the colored relation map of self.
 
See corresponding :py:class:`~digraphs.Digraph.showHTMLRelationMap` method.
 
The *colorLevels* parameter may be set to 3, 5, 7 (default) or 9.
 
When the *actionsList* parameter is *None* (default), the digraphs actions list may be ranked with the *rankingRule* parameter set to the 'Copeland' (default) or to the 'Netlows' ranking rule.
 
When the *htmlFileName* parameter is set to a string value 'xxx', a html file named 'xxx.html' will be generated in the current working directory. Otherwise, a temporary file named 'tmp*.html' will be generated there.
 
Example::
 
    >>> from outrankingDigraphs import *
    >>> t = RandomCBPerformanceTableau(numberOfActions=25,seed=1)
    >>> g = BipolarOutrankingDigraph(t,ndigits=2)
    >>> gcd = ~(-g)  # strict outranking relation
    >>> gcd.showHTMLRelationHeatmap(colorLevels=7,ndigits=2)
    
.. image:: relationHeatmap.png
   :alt: Browser view of a relation map
   :width: 600 px
   :align: center
showHTMLRelationMap(self, actionsList=None, rankingRule='Copeland', Colored=True, tableTitle='Relation Map', relationName='r(x S y)', symbols=['+', '&middot;', '&nbsp;', '&#150;', '&#151'], fromIndex=None, toIndex=None, htmlFileName=None)
Launches a browser window with the colored relation map of self.
See corresponding Digraph.showRelationMap() method.
 
When *htmlFileName* parameter is set to a string value, a html file
with that name will be stored in the current working directory.
 
By default, a temporary file named: tmp*.html will be generated
instead in the current working directory.
 
Example::
 
    >>> from outrankingDigraphs import *
    >>> t = RandomCBPerformanceTableau(numberOfActions=25,seed=1)
    >>> g = BipolarOutrankingDigraph(t,Normalized=True)
    >>> gcd = ~(-g)  # strict outranking relation
    >>> gcd.showHTMLRelationMap(rankingRule="NetFlows")
    
.. image:: relationMap.png
   :alt: Browser view of a relation map
   :width: 600 px
   :align: center
showHTMLRelationTable(self, actionsList=None, relation=None, IntegerValues=False, ndigits=2, Colored=True, tableTitle='Valued Adjacency Matrix', relationName='r(x S y)', ReflexiveTerms=False, htmlFileName=None, fromIndex=None, toIndex=None)
Launches a browser window with the colored relation table of self.
showMIS(self, withListing=True)
Prints all maximal independent choices:
    Result in self.misset.
showMIS_AH(self, withListing=True)
Prints all MIS using the Hertz method.
 
Result saved in self.hertzmisset.
showMIS_HB2(self, withListing=True)
Prints all MIS using the Hertz-Bisdorff method.
 
Result saved in self.newmisset.
showMIS_RB(self, withListing=True)
Prints all MIS using the Bisdorff method.
 
Result saved in self.newmisset.
showMIS_UD(self, withListing=True)
Prints all MIS using the Hertz-Bisdorff method.
 
Result saved in self.newmisset.
showMaxAbsIrred(self, withListing=True)
Computing maximal -irredundant choices:
    Result in self.absirset.
showMaxDomIrred(self, withListing=True)
Computing maximal +irredundant choices:
   Result in self.domirset.
showMinAbs(self, withListing=True)
Prints minimal absorbent choices:
    Result in self.absset.
showMinDom(self, withListing=True)
Prints all minimal dominant choices:
    Result in self.domset.
showNeighborhoods(self)
Lists the gamma and the notGamma function of self.
showOrbits(self, InChoices, withListing=True)
Prints the orbits of Choices along the automorphisms of
the Digraph instance.
 
Example Python session for computing the non isomorphic MISs from the 12-cycle graph:
 
>>> from digraphs import *
>>> c12 = CirculantDigraph(order=12,circulants=[1,-1])
>>> c12.automorphismGenerators()
...
  Permutations
  {'1': '1', '2': '12', '3': '11', '4': '10', '5': 
   '9', '6': '8', '7': '7', '8': '6', '9': '5', '10': 
   '4', '11': '3', '12': '2'}
  {'1': '2', '2': '1', '3': '12', '4': '11', '5': '10', 
   '6': '9', '7': '8', '8': '7', '9': '6', '10': '5', 
   '11': '4', '12': '3'}
  Reflections {}
>>> print('grpsize = ', c12.automorphismGroupSize)
  grpsize = 24
>>> c12.showMIS(withListing=False)
  *---  Maximal independent choices ---*
  number of solutions:  29
  cardinality distribution
  card.:  [0, 1, 2, 3, 4,  5,  6, 7, 8, 9, 10, 11, 12]
  freq.:  [0, 0, 0, 0, 3, 24,  2, 0, 0, 0,  0,  0,  0]
  Results in c12.misset
>>> c12.showOrbits(c12.misset,withListing=False)
...
  *---- Global result ----
  Number of MIS:  29
  Number of orbits :  4
  Labelled representatives:
  1: ['2','4','6','8','10','12']
  2: ['2','5','8','11']
  3: ['2','4','6','9','11']
  4: ['1','4','7','9','11']
  Symmetry vector
  stabilizer size: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, ...]
  frequency      : [0, 2, 0, 0, 0, 0, 0, 1, 0,  0,  0,  1, ...]
 
*Figure*: The symmetry axes of the non isomorphic MISs of the 12-cycle:
 
.. image:: c12.png
   :width: 400 px
   :align: center
   :alt: The 4 non isomorphic MIS of the 12-cycle graph
 
*Reference*: R. Bisdorff and J.L. Marichal (2008). Counting non-isomorphic maximal independent sets of the n-cycle graph. *Journal of Integer Sequences*, Vol. 11 Article 08.5.7 (`openly accessible here <https://www.cs.uwaterloo.ca/journals/JIS/VOL11/Marichal/marichal.html>`_)
showOrbitsFromFile(self, InFile, withListing=True)
Prints the orbits of Choices along the automorphisms of
the digraph self by reading in the 0-1 misset file format.
See the :py:func:`digraphs.Digraph.readPerrinMisset` method.
showPreKernels(self, withListing=True)
Printing dominant and absorbent preKernels:
    Result in self.dompreKernels and self.abspreKernels
showRankingByBestChoosing(self, rankingByBestChoosing=None)
A show method for self.rankinByBestChoosing result.
 
.. warning::
 
     The self.computeRankingByBestChoosing(CoDual=False/True) method instantiating the self.rankingByBestChoosing slot is pre-required !
showRankingByChoosing(self, rankingByChoosing=None, WithCoverCredibility=False)
A show method for self.rankinByChoosing result.
 
When parameter *WithCoverCredibility* is set to True, the credibility of outranking, respectively being outranked is indicated at each selection step. 
 
.. warning::
 
     The self.computeRankingByChoosing(CoDual=False/True) method instantiating the self.rankingByChoosing slot is pre-required !
showRankingByLastChoosing(self, rankingByLastChoosing=None, Debug=None)
A show method for self.rankinByChoosing result.
 
.. warning::
 
     The self.computeRankingByLastChoosing(CoDual=False/True) method instantiating the self.rankingByChoosing slot is pre-required !
showRelation(self)
prints the relation valuation in ##.## format.
showRelationMap(self, symbols=None, rankingRule='Copeland', fromIndex=None, toIndex=None, actionsList=None)
Prints on the console, in text map format, the location of
certainly validated and certainly invalidated outranking situations.
 
By default, symbols = {'max':'┬','positive': '+', 'median': ' ',
                       'negative': '-', 'min': '┴'}
 
The default ordering of the output is following the Copeland ranking rule
from best to worst actions. Further available ranking rule is the 'NetFlows' net flows rule.
 
 
Example::
 
    >>> from outrankingDigraphs import *
    >>> t = RandomCBPerformanceTableau(numberOfActions=25,seed=1)
    >>> g = BipolarOutrankingDigraph(t,Normalized=True)
    >>> gcd = ~(-g)  # strict outranking relation
    >>> gcd.showRelationMap(rankingRule="NetFlows")
     -   ++++++++  +++++┬+┬┬+
    - -   + +++++ ++┬+┬+++┬++
    ┴+  ┴ + ++  ++++┬+┬┬++┬++
    -   ++ - ++++-++++++┬++┬+
       - - - ++- ┬- + -+┬+-┬┬
    -----  -      -┬┬┬-+  -┬┬
    ----    --+-+++++++++++++
    -- --+- --++ ++ +++-┬+-┬┬
    ----  -  -+-- ++--+++++ +
    ----- ++- --- +---++++┬ +
    -- -- ---+ -++-+++-+ +-++
    -- --┴---+  + +-++-+ -  +
    ---- ┴---+-- ++--++++ - +
      --┴┴--  --- -  --+ --┬┬
     ---------+--+ ----- +-┬┬
    -┴---┴- ---+- + ---+++┬ +
    -┴┴--┴---+--- ++ -++--+++
    -----┴--- ---+-+- ++---+ 
    -┴┴--------------- --++┬ 
    --┴---------------- --+┬ 
    ┴--┴┴ -┴--┴┴-┴ --++  ++-+
    ----┴┴--------------- -  
    ┴┴┴----+-┴+┴---┴-+---+ ┴+
    ┴┴-┴┴┴-┴- - -┴┴---┴┴+ ┬ -
    ----┴┴-┴-----┴┴---  - -- 
    Ranking rule: NetFlows
    >>>
showRelationTable(self, Sorted=True, rankingRule=None, IntegerValues=False, actionsSubset=None, relation=None, ndigits=2, ReflexiveTerms=True, fromIndex=None, toIndex=None)
Prints the relation valuation in actions X actions table format.
Copeland and NetFlows rankings my be used.
showRubisBestChoiceRecommendation(self, **kwargs)
Dummy for backward portable showBestChoiceRecommendation().
showRubyChoice(self, Verbose=False, Comments=True, _OldCoca=True)
Dummy for showBestChoiceRecommendation()
needed for older versions compatibility.
showShort(self)
concise presentation method for genuine digraphs.
showSingletonRanking(self, Comments=True, Debug=False)
Calls self.computeSingletonRanking(comments=True,Debug = False).
Renders and prints the sorted bipolar net determinatation of outrankingness
minus outrankedness credibilities of all singleton choices.
 
res = ((netdet,sigleton,dom,absorb)+)
showStatistics(self)
Computes digraph statistics like order, size and arc-density.
showdre(self)
Shows relation in nauty format.
singletons(self)
list of singletons and neighborhoods
[(singx1, +nx1, -nx1, not(+nx1 or -nx1)),.... ]
sizeSubGraph(self, choice)
Output: (size, undeterm,arcDensity).
Renders the arc density of the induced subgraph.
strongComponents(self, setPotential=False)
Renders the set of strong components of self.
symDegreesDistribution(self)
Renders the distribution of symmetric degrees.
topologicalSort(self, Debug=False)
If self is acyclic, adds topological sort number to each node of self
and renders ordered list of nodes. Otherwise renders None.
Source: M. Golumbic Algorithmic Graph heory and Perfect Graphs,
Annals Of Discrete Mathematics 57 2nd Ed. , Elsevier 2004, Algorithm 2.4 p.44.
weakAneighbors(self, node)
Renders the set of absorbed in-neighbors of a node.
weakCondorcetLosers(self)
Renders the set of decision actions x such that
self.relation[x][y] <= self.valuationdomain['med']
for all y != x.
weakCondorcetWinners(self)
Renders the set of decision actions x such that
self.relation[x][y] >= self.valuationdomain['med']
for all y != x.
weakDneighbors(self, node)
Renders the set of dominated out-neighbors of a node.
weakGammaSets(self)
Renders the dictionary of neighborhoods {node: (dx,ax)}
zoomValuation(self, zoomFactor=1.0)
Zooms in or out, depending on the value of the zoomFactor provided,
the bipolar valuation of a digraph.

Data descriptors inherited from Digraph:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class XMCDA2Digraph(Digraph)
    XMCDA2Digraph(fileName='temp')
 
Specialization of the general Digraph class for reading
stored XMCDA-2.0 formatted digraphs. Using the inbuilt module
xml.etree (for Python 2.5+).
 
Param:
    fileName (without the extension .xmcda).
 
 
Method resolution order:
XMCDA2Digraph
Digraph
builtins.object

Methods defined here:
__init__(self, fileName='temp')
Initialize self.  See help(type(self)) for accurate signature.
showAll(self)
Detailed show method for genuine digraphs.

Methods inherited from Digraph:
MISgen(self, S, I)
generator of maximal independent choices (voir Byskov 2004):
    * S ::= remaining nodes;
    * I ::= current independent choice
 
.. note::
 
        Inititalize: self.MISgen(self.actions.copy(),set())
__invert__(self)
Make the inverting operator ~self available for Digraph instances. 
 
Returns a ConverseDigraph instance of self.
__neg__(self)
Make the negation operator -self available for Digraph instances. 
 
Returns a DualDigraph instance of self.
__repr__(self)
Default presentation method for Digraph instances.
absirred(self, choice)
Renders the crips -irredundance degree of a choice.
absirredundant(self, U)
Generates all -irredundant choices of a digraph.
absirredval(self, choice, relation)
Renders the valued -irredundance degree of a choice.
absirredx(self, choice, x)
Computes the crips -irredundance degree of node x in a choice.
abskernelrestrict(self, prekernel)
Parameter: prekernel
Renders absorbent prekernel restricted relation.
absorb(self, choice)
Renders the absorbency degree of a choice.
absorbentChoices(self, S)
Generates all minimal absorbent choices of a bipolar valued digraph.
addValuationAttribute(self)
Adds the numpy valuation attribute
agglomerationDistribution(self)
Output: aggloCoeffDistribution, meanCoeff
Renders the distribution of agglomeration coefficients.
aneighbors(self, node)
Renders the set of absorbed in-neighbors of a node.
automorphismGenerators(self)
Adds automorphism group generators to the digraph instance.
 
.. note::
 
    Dependency: Uses the dreadnaut command from the nauty software package. See https://www3.cs.stonybrook.edu/~algorith/implement/nauty/implement.shtml
 
    On Ubuntu Linux:
      ...$ sudo apt-get install nauty
averageCoveringIndex(self, choice, direction='out')
Renders the average covering index of a given choice in a set of objects,
ie the average number of choice members that cover each
non selected object.
bipolarKCorrelation(self, digraph, Debug=False)
Renders the bipolar Kendall correlation between two bipolar valued
digraphs computed from the average valuation of the
XORDigraph(self,digraph) instance.
 
.. warning::
 
     Obsolete! Is replaced by the self.computeBipolarCorrelation(other) Digraph method
bipolarKDistance(self, digraph, Debug=False)
Renders the bipolar crisp Kendall distance between two bipolar valued
digraphs.
 
.. warning::
 
     Obsolete! Is replaced by the self.computeBipolarCorrelation(other, MedianCut=True) Digraph method
chordlessPaths(self, Pk, n2, Odd=False, Comments=False, Debug=False)
New procedure from Agrum study April 2009
recursive chordless path extraction starting from path
Pk = [n2, ...., n1] and ending in node n2.
Optimized with marking of visited chordless P1s.
circuitAverageCredibility(self, circ)
Renders the average linking credibility of a Chordless Circuit.
circuitCredibilities(self, circuit, Debug=False)
Renders the average linking credibilities and the minimal link of a Chordless Circuit.
circuitMaxCredibility(self, circ)
Renders the maximal linking credibility of a Chordless Circuit.
circuitMinCredibility(self, circ)
Renders the minimal linking credibility of a Chordless Circuit.
closeSymmetric(self, InSite=True)
Produces the symmetric closure of self.relation.
closeTransitive(self, Reverse=False, InSite=True, Comments=False)
Produces the transitive closure of self.relation
 
*Parameters*:
 
    - If *Reverse* == True (False default) all transitive links are dropped, otherwise all transitive links are closed with min[r(x,y),r(y,z)];
    - If *Insite* == False (True by default) the methods return a modified copy of self.relation without altering the original self.relation, otherwise self.relation is modified.
components(self)
Renders the list of connected components.
computeAllDensities(self, choice=None)
parameter: choice in self
renders six densitiy parameters:
arc density, double arc density,
single arc density, strict single arc density,
absence arc density, strict absence arc densitiy.
computeArrowRaynaudOrder(self)
Renders a linear ordering from worst to best of the actions following Arrow&Raynaud's rule.
computeArrowRaynaudRanking(self)
renders a linear ranking from best to worst of the actions following Arrow&Raynaud's rule.
computeAverageValuation(self)
Computes the bipolar average correlation between
self and the crisp complete digraph of same order
of the irreflexive and determined arcs of the digraph
computeBadChoices(self, Comments=False)
Computes characteristic values for potentially bad choices.
 
.. note::
 
     Returns a tuple with following content:
 
     [(0)-determ,(1)degirred,(2)degi,(3)degd,(4)dega,(5)str(choice),(6)absvec]
computeBadPirlotChoices(self, Comments=False)
Characteristic values for potentially bad choices
using the Pirlot's fixpoint algorithm.
computeBestChoiceRecommendation(self, Verbose=False, Comments=False, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True)
Sets self.bestChoice, self.bestChoiceData, self.worstChoice and self.worstChoiceData
with the showBestChoiceRecommendation method.
 
First and last choices data is the following:
[(0)-determ,(1)degirred,(2)degi,(3)degd,(4)dega,(5)str(choice),(6)domvec,(7)cover]
 
self.bestChoice = self.bestChoiceData[5]
self.worstChoice = self.worstChoiceData[5]
computeBipolarCorrelation(self, other, MedianCut=False, filterRelation=None, Debug=False)
obsolete: dummy replacement for Digraph.computeOrdinalCorrelation method
computeChordlessCircuits(self, Odd=False, Comments=False, Debug=False)
Renders the set of all chordless circuits detected in a digraph.
Result is stored in <self.circuitsList>
holding a possibly empty list of tuples with at position 0 the
list of adjacent actions of the circuit and at position 1
the set of actions in the stored circuit.
 
When *Odd* is True, only chordless circuits with an odd length
are collected.
computeChordlessCircuitsMP(self, Odd=False, Threading=False, nbrOfCPUs=None, startMethod=None, Comments=False, Debug=False)
Multiprocessing version of computeChordlessCircuits().
 
Renders the set of all chordless odd circuits detected in a digraph.
Result (possible empty list) stored in <self.circuitsList>
holding a possibly empty list tuples with at position 0 the
list of adjacent actions of the circuit and at position 1
the set of actions in the stored circuit.
Inspired by Dias, Castonguay, Longo, Jradi, Algorithmica (2015).
 
Returns a possibly empty list of tuples (circuit,frozenset(circuit)).
 
If Odd == True, only circuits of odd length are retained in the result.
computeCoSize(self)
Renders the number of non validated non reflexive arcs
computeConcentrationIndex(self, X, N)
Renders the Gini concentration index of the X serie.
N contains the partial frequencies.
Based on the triangle summation formula.
computeConcentrationIndexTrapez(self, X, N)
Renders the Gini concentration index of the X serie.
N contains the partial frequencies.
Based on the triangles summation formula.
computeCondorcetLosers(self)
Wrapper for condorcetLosers().
computeCondorcetWinners(self)
Wrapper for condorcetWinners().
computeCopelandOrder(self)
renders a linear ordering from worst to best of the actions following Arrow&Raynaud's rule.
computeCopelandRanking(self)
renders a linear ranking from best to worst of the actions following Arrow&Raynaud's rule.
computeCutLevelDensities(self, choice, level)
parameter: choice in self, robustness level
renders three robust densitiy parameters:
robust double arc density,
robust single arc density,
robust absence arc densitiy.
computeDensities(self, choice)
parameter: choice in self
renders the four densitiy parameters:
arc density, double arc density, single arc density, absence arc density.
computeDeterminateness(self, InPercents=False)
Computes the Kendalll distance of self
with the all median-valued indeterminate digraph of order n.
 
Return the average determination of the irreflexive part of the digraph.
 
*determination* = sum_(x,y) { abs[ r(xRy) - Med ] } / n(n-1)
 
If *InPercents* is True, returns the average determination in percentage of
(Max - Med) difference.
 
>>> from outrankingDigraphs import BipolarOutrankingDigraph
>>> from randomPerfTabs import Random3ObjectivesPerformanceTableau
>>> t = Random3ObjectivesPerformanceTableau(numberOfActions=7,numberOfCriteria=7,seed=101)
>>> g = BipolarOutrankingDigraph(t,Normalized=True)
>>> g
*------- Object instance description ------*
Instance class      : BipolarOutrankingDigraph
Instance name       : rel_random3ObjectivesPerfTab
Actions             : 7
Criteria            : 7
Size                : 27
Determinateness (%) : 65.67
Valuation domain    : [-1.00;1.00]
>>> print(g.computeDeterminateness())
0.3134920634920634920634920638
>>> print(g.computeDeterminateness(InPercents=True))
65.67460317460317460317460320
>>> g.recodeValuation(0,1)
>>> g
*------- Object instance description ------*
Instance class      : BipolarOutrankingDigraph
Instance name       : rel_random3ObjectivesPerfTab
Actions             : 7
Criteria            : 7
Size                : 27
Determinateness (%) : 65.67
Valuation domain    : [0.00;1.00]
>>> print(g.computeDeterminateness())
0.1567460317460317460317460318
>>> print(g.computeDeterminateness(InPercents=True))
65.67460317460317460317460320
computeDiameter(self, Oriented=True)
Renders the (by default oriented) diameter of the digraph instance
computeDigraphCentres(self, WeakDistances=False, Comments=False)
The centers of a digraph are the nodes with finite minimal shortes path lengths.
 
The maximal neighborhood distances are stored in *self.maximalNeighborhoodDistances*.
 
The corresponding digraph radius and diameter are stored respectively  in *self.radius* and *self.diameter*.
 
With *Comments* = True, all these results are printed out.
 
*Source*: Claude Berge, *The Theory of Graphs*, Dover (2001) pp. 119, original in French Dunod (1958)
computeDynamicProgrammingStages(self, source, sink, Debug=False)
Renders the discrete stages of the optimal substructure for
dynamic pogramming digrahs from a given source node 
to a given sink sink node.
 
Returns a list of list of action identifyers.
computeGoodChoiceVector(self, ker, Comments=False)
| Computing Characteristic values for dominant pre-kernels
| using the von Neumann dual fixoint equation
computeGoodChoices(self, Comments=False)
Computes characteristic values for potentially good choices.
 
..note::
 
     Return a tuple with following content:
 
     [(0)-determ,(1)degirred,(2)degi,(3)degd,(4)dega,(5)str(choice),(6)domvec,(7)cover]
computeGoodPirlotChoices(self, Comments=False)
Characteristic values for potentially good choices
using the Pirlot fixpoint algorithm.
computeIncomparabilityDegree(self, InPercents=False, Comments=False)
Renders the incomparability degree (Decimal), i.e. the relative number of symmetric indeterminate relations of the irreflexive part of a digraph.
computeKemenyIndex(self, otherRelation)
renders the Kemeny index of the self.relation
compared with a given crisp valued relation of a compatible
other digraph (same nodes or actions).
computeKemenyOrder(self, orderLimit=7, Debug=False)
Renders a ordering from worst to best of the actions with maximal Kemeny index.
Return a tuple: kemenyOrder (from worst to best), kemenyIndex
computeKemenyRanking(self, orderLimit=7, seed=None, sampleSize=1000, Debug=False)
Renders a ranking from best to worst of the actions with maximal Kemeny index.
 
.. note::
 
     Returns a tuple: kemenyRanking (from best to worst), kemenyIndex.
computeKernelVector(self, kernel, Initial=True, Comments=False)
| Computing Characteristic values for dominant pre-kernels
| using the von Neumann dual fixpoint equation
computeKohlerOrder(self)
Renders an ordering (worst to best) of the actions following Kohler's rule.
computeKohlerRanking(self)
Renders a ranking (best to worst) of the actions following Kohler's rule.
computeMaxHoleSize(self, Comments=False)
Renders the length of the largest chordless cycle
in the corresponding disjunctive undirected graph.
computeMeanInDegree(self)
Renders the mean indegree of self.
!!! self.size must be set previously !!!
computeMeanOutDegree(self)
Renders the mean degree of self.
!!! self.size must be set previously !!!
computeMeanSymDegree(self)
Renders the mean degree of self.
!!! self.size must be set previously !!!
computeMedianOutDegree(self)
Renders the median outdegree of self.
!!! self.size must be set previously !!!
computeMedianSymDegree(self)
Renders the median symmetric degree of self.
!!! self.size must be set previously !!!
computeMoreOrLessUnrelatedPairs(self)
Renders a list of more or less unrelated pairs.
computeNetFlowsOrder(self)
Renders an ordered list (from best to worst) of the actions
following the net flows ranking rule.
computeNetFlowsOrderDict(self)
Renders an ordered list (from worst to best) of the actions
following the net flows ranking rule.
computeNetFlowsRanking(self)
Renders an ordered list (from best to worst) of the actions
following the net flows ranking rule.
computeNetFlowsRankingDict(self)
Renders an ordered list (from best to worst) of the actions
following the net flows ranking rule.
computeODistance(self, op2, comments=False)
renders the squared normalized distance of
two digraph valuations.
 
.. note::
 
     op2 = digraphs of same order as self.
computeOrbit(self, choice, withListing=False)
renders the set of isomorph copies of a choice following
the automorphism of the digraph self
computeOrderCorrelation(self, order, Debug=False)
Renders the ordinal correlation K of a digraph instance
when compared with a given linear order (from worst to best) of its actions
 
K = sum_{x != y} [ min( max(-self.relation(x,y)),other.relation(x,y), max(self.relation(x,y),-other.relation(x,y)) ]
 
K /= sum_{x!=y} [ min(abs(self.relation(x,y),abs(other.relation(x,y)) ]
 
.. note::
 
     Renders a dictionary with the key 'correlation' containing the actual bipolar correlation index and the key 'determination' containing the minimal determination level D of self and the other relation.
 
     D = sum_{x != y} min(abs(self.relation(x,y)),abs(other.relation(x,y)) / n(n-1)
 
     where n is the number of actions considered.
 
     The correlation index with a completely indeterminate relation
     is by convention 0.0 at determination level 0.0 .
 
.. warning::
 
     self must be a normalized outranking digraph instance !
computeOrdinalCorrelation(self, other, MedianCut=False, filterRelation=None, Debug=False)
Renders the bipolar correlation K of a
self.relation when compared
with a given compatible (same actions set)) digraph or
a [-1,1] valued compatible relation (same actions set).
 
If MedianCut=True, the correlation is computed on the median polarized relations.
 
If filterRelation is not None, the correlation is computed on the partial domain corresponding to the determined part of the filter relation.
 
.. warning::
 
     Notice that the 'other' relation and/or the 'filterRelation',
     the case given, must both be normalized, ie [-1,1]-valued !
 
K = sum_{x != y} [ min( max(-self.relation[x][y]),other.relation[x][y]), max(self.relation[x][y],-other.relation[x][y]) ]
 
K /= sum_{x!=y} [ min(abs(self.relation[x][y]),abs(other.relation[x][y])) ]
 
.. note::
 
     Renders a tuple with at position 0 the actual bipolar correlation index
     and in position 1 the minimal determination level D of self and
     the other relation.
 
     D = sum_{x != y} min(abs(self.relation[x][y]),abs(other.relation[x][y])) / n(n-1)
 
     where n is the number of actions considered.
 
     The correlation index with a completely indeterminate relation
     is by convention 0.0 at determination level 0.0 .
computeOrdinalCorrelationMP(self, other, MedianCut=False, Threading=False, nbrOfCPUs=None, startMethod=None, Comments=False, Debug=False)
Multi processing version of the digraphs.computeOrdinalCorrelation() method.
 
.. note::
     The relation filtering and the MedinaCut option are not implemented in the MP version.
computePairwiseClusterComparison(self, K1, K2, Debug=False)
Computes the pairwise cluster comparison credibility vector
from bipolar-valued digraph g. with K1 and K2 disjoint
lists of action keys from g actions disctionary.
Returns the dictionary
{'I': Decimal(),'P+':Decimal(),'P-':Decimal(),'R' :Decimal()}
where one and only one item is strictly positive.
computePreKernels(self)
computing dominant and absorbent preKernels:
    Result in self.dompreKernels and self.abspreKernels
computePreRankingRelation(self, preRanking, Normalized=True, Debug=False)
Renders the bipolar-valued relation obtained from
a given preRanking in decreasing levels (list of lists) result.
computePreorderRelation(self, preorder, Normalized=True, Debug=False)
Renders the bipolar-valued relation obtained from
a given preordering in increasing levels (list of lists) result.
computePrincipalOrder(self, Colwise=False, Comments=False)
Rendesr an ordering from wrost to best of the decision actions.
computePrincipalRanking(self, Colwise=False, Comments=False)
Rendesr a ranking from best to worst of the decision actions.
computePrincipalScores(self, plotFileName=None, Colwise=False, imageType=None, tempDir=None, bgcolor='cornsilk', Comments=False, Debug=False)
Renders a ordered list of the first principal eigenvector of the covariance of the valued outdegrees of self.
 
.. note::
 
   The method, relying on writing and reading temporary files by default in a temporary directory is threading and multiprocessing safe !
   (see Digraph.exportPrincipalImage method)
computePrudentBetaLevel(self, Debug=False)
computes alpha, ie the lowest valuation level, for which the
bipolarly polarised digraph doesn't contain a chordless circuit.
computeRankingByBestChoosing(self, CoDual=False, Debug=False)
Computes a weak preordering of the self.actions by recursive
best choice elagations.
 
Stores in self.rankingByBestChoosing['result'] a list of (P+,bestChoice) tuples
where P+ gives the best choice complement outranking
average valuation via the computePairwiseClusterComparison
method.
 
If self.rankingByBestChoosing['CoDual'] is True, 
the ranking-by-choosing was computed on the codual of self.
computeRankingByBestChoosingRelation(self, rankingByBestChoosing=None, Debug=False)
Renders the bipolar-valued relation obtained from
the self.rankingByBestChoosing result.
computeRankingByChoosing(self, actionsSubset=None, Debug=False, CoDual=False)
Computes a weak preordring of the self.actions by iterating
jointly first and last choice elagations.
 
Stores in self.rankingByChoosing['result'] a list of ((P+,bestChoice),(P-,worstChoice)) pairs
where P+ (resp. P-) gives the best (resp. worst) choice complement outranking
(resp. outranked) average valuation via the computePairwiseClusterComparison
method.
 
If self.rankingByChoosing['CoDual'] is True, the ranking-by-choosing was computed on the codual of self.
computeRankingByChoosingRelation(self, rankingByChoosing=None, actionsSubset=None, Debug=False)
Renders the bipolar-valued relation obtained from
the self.rankingByChoosing result.
computeRankingByLastChoosing(self, CoDual=False, Debug=False)
Computes a weak preordring of the self.actions by iterating
worst choice elagations.
 
Stores in self.rankingByLastChoosing['result'] a list of (P-,worstChoice) pairs
where P- gives the worst choice complement outranked
average valuation via the computePairwiseClusterComparison
method.
 
If self.rankingByChoosing['CoDual'] is True, the ranking-by-last-chossing 
was computed on the codual of self.
computeRankingByLastChoosingRelation(self, rankingByLastChoosing=None, Debug=False)
Renders the bipolar-valued relation obtained from
the self.rankingByLastChoosing result.
computeRankingCorrelation(self, ranking, Debug=False)
Renders the ordinal correlation K of a digraph instance
when compared with a given linear ranking of its actions
 
K = sum_{x != y} [ min( max(-self.relation(x,y)),other.relation(x,y), max(self.relation(x,y),-other.relation(x,y)) ]
 
K /= sum_{x!=y} [ min(abs(self.relation(x,y),abs(other.relation(x,y)) ]
 
.. note::
 
     Renders a tuple with at position 0 the actual bipolar correlation index
     and in position 1 the minimal determination level D of self and
     the other relation.
 
     D = sum_{x != y} min(abs(self.relation(x,y)),abs(other.relation(x,y)) / n(n-1)
 
     where n is the number of actions considered.
 
     The correlation index with a completely indeterminate relation
     is by convention 0.0 at determination level 0.0 .
computeRelationalStructure(self, Debug=False)
Renders the counted decomposition of the valued relations into
the following type of links:
gt '>', eq '=', lt '<', incomp '<>',
leq '<=', geq '>=', indeterm '?'
computeRubisChoice(self, Comments=False, _OldCoca=False, BrokenCocs=True, Threading=False, nbrOfCPUs=1)
Renders self.strictGoodChoices, self.nullChoices
self.strictBadChoices, self.nonRobustChoices.
 
.. warning::
    Changes in site the outranking digraph by
    adding or braking chordless odd outranking circuits.
computeRubyChoice(self, Comments=False, _OldCoca=False)
dummy for computeRubisChoice()
old versions compatibility.
computeShortestPathLengths(self, WeakPaths=False, Comments=False, Debug=False)
Renders a double dictionary with the directed distances, i.e. the shortest path lengths between all self.actions
 
Equals *None* if there does not exist a directed path between two actions.
 
*Source*: Claude Berge, *The Theory of Graphs*, Dover (2001) pp. 119, original in French Dunod (1958)
computeSingletonRanking(self, Comments=False, Debug=False)
Renders the sorted bipolar net determinatation of outrankingness
minus outrankedness credibilities of all singleton choices.
 
res = ((netdet,singleton,dom,absorb)+)
computeSize(self)
Renders the number of validated non reflexive arcs
computeSizeTransitiveClosure(self)
Renders the size of the transitive closure of a digraph.
computeSlaterOrder(self, isProbabilistic=False, seed=None, sampleSize=1000, Debug=False)
Reversed return from computeSlaterRanking method.
computeSlaterRanking(self, isProbabilistic=False, seed=None, sampleSize=1000, Debug=False)
Renders a ranking of the actions with minimal Slater index.
Return a tuple: slaterOrder, slaterIndex
computeSymmetryDegree(self, InPercents=False, Comments=False)
Renders the symmetry degree (Decimal) of the irreflexive part of a digraph.
 
.. note::
 
   Empty and indeterminate digraphs are considered to be symmetric.
computeTopologicalRanking(self, Debug=False)
Mimetic Wrapper of the topologicalSort() method.
computeTransitivityDegree(self, InPercents=False, Comments=False)
Renders the transitivity degree (Decimal) of a digraph.
 
.. note:: 
 
   An empty or indeterminate digraph is considered to be transitive.
computeUnrelatedPairs(self)
Renders a list of more or less unrelated pairs.
computeValuationLevels(self, choice=None, Debug=False)
renders the symmetric closure of the
apparent valuations levels of self
in an increasingly ordered list.
If parameter choice is given, the
computation is limited to the actions
of the choice.
computeValuationPercentages(self, choice, percentiles, withValues=False)
Parameters: choice and list of percentiles.
renders a series of percentages of the characteristics valuation of
the arcs in the digraph.
computeValuationPercentiles(self, choice, percentages, withValues=False)
Parameters: choice and list of percentages.
renders a series of quantiles of the characteristics valuation of
the arcs in the digraph.
computeValuationStatistics(self, Sampling=False, Comments=False)
Renders the mean and variance of the valuation
of the non reflexive pairs.
computeValuedRankingRelation(self, ranking)
Renders the valued relation characteristics compatible 
with the given linar ranking. Discordant charcateristics 
are set to the indeterminate value.
computeWeakCondorcetLosers(self)
Wrapper for weakCondorcetLosers().
computeWeakCondorcetWinners(self)
Wrapper for weakCondorcetWinners().
computeupdown1(self, s, S)
Help method for show_MIS_HB2 method.
fills self.newmisset, self.upmis, self.downmis.
computeupdown2(self, s, S)
Help method for show_MIS_HB1 method.
Fills self.newmisset, self.upmis, self.downmis.
computeupdown2irred(self, s, S)
Help method for show_MIS_HB1 method.
Fills self.newmisset, self.upmis, self.downmis.
condorcetLosers(self)
Renders the set of decision actions x such that
self.relation[x][y] < self.valuationdomain['med']
for all y != x.
condorcetWinners(self)
Renders the set of decision actions x such that
self.relation[x][y] > self.valuationdomain['med']
for all y != x.
contra(self, v)
Parameter: choice.
Renders the negation of a choice v characteristic's vector.
convertRelationToDecimal(self)
Converts the float valued self.relation in a decimal valued one.
convertValuation2Integer(self, InSite=True, Comments=False)
Converts the self.relation valuation to integer values by converting the Decimals to Fractions and multiply by the least commun multiple of the fraction denominators.
 
*Parameters*:
 
    - If *Insite* == False (True by default) the method returns a modified copy of self.relation without altering the original self.relation, otherwise self.relation and self.valuationdomain is modified.
convertValuationToDecimal(self)
Convert the float valuation limits to Decimals.
coveringIndex(self, choice, direction='out')
Renders the covering index of a given choice in a set of objects,
ie the minimum number of choice members that cover each
non selected object.
crispKDistance(self, digraph, Debug=False)
Renders the crisp Kendall distance between two bipolar valued
digraphs.
 
.. warning::
 
     Obsolete! Is replaced by the self.computeBipolarCorrelation(other, MedianCut=True) Digraph method
detectChordlessCircuits(self, Comments=False, Debug=False)
Detects a chordless circuit in a digraph.
Returns a Boolean
detectChordlessPath(self, Pk, n2, Comments=False, Debug=False)
New procedure from Agrum study April 2009
recursive chordless path extraction starting from path
Pk = [n2, ...., n1] and ending in node n2.
Optimized with marking of visited chordless P1s.
determinateness(self, vec, inPercent=True)
Renders the determinateness of a characteristic vector *vec* = 
[(r(x),x),(r(y),y), ...] of length *n* in valuationdomain [Min,Med,Max]:
 
*result* =  sum_x( abs(r(x)-Med) ) / ( n*(Max-Med) )
 
If inPercent, *result* shifted (+1) and reduced (/2) to [0,1] range.
digraph2Graph(self, valuationDomain={'min': -1, 'med': 0, 'max': 1}, Debug=False, ConjunctiveConversion=True)
Convert a Digraph instance to a Graph instance.
dneighbors(self, node)
Renders the set of dominated out-neighbors of a node.
domin(self, choice)
Renders the dominance degree of a choice.
dominantChoices(self, S)
Generates all minimal dominant choices of a bipolar valued digraph.
 
.. note::
 
     Initiate with S = self.actions.copy().
domirred(self, choice)
Renders the crips +irredundance degree of a choice.
domirredval(self, choice, relation)
Renders the valued +irredundance degree of a choice.
domirredx(self, choice, x)
Renders the crips +irredundance degree of node x in a choice.
domkernelrestrict(self, prekernel)
Parameter: dominant prekernel
Renders dominant prekernel restricted relation.
exportGraphViz(self, fileName=None, actionsSubset=None, bestChoice=set(), worstChoice=set(), firstChoice=set(), lastChoice=set(), Comments=True, graphType='png', pictureFormat=None, graphSize='7,7', relation=None, bgcolor='cornsilk')
export GraphViz dot file  for graph drawing filtering.
exportPrincipalImage(self, plotFileName=None, pictureFormat='pdf', bgcolor='cornsilk', fontcolor='red3', fontsize='0.75', Reduced=False, Colwise=False, tempDir='.', Comments=False)
Export as PDF (default) the principal projection of
the valued relation using the three principal eigen vectors.
 
Implemeted picture formats are: 
'pdf' (default), 'png', 'jpeg' and 'xfig'.
 
The background color is set by default to 'cornsilk'. 
 
Font size and color are set by default to 'red3', resp. '0.75'. 
 
When *Reduced==True*, the valued relation characeteristics are centered and reduced.
 
When *Colwise==True*, the column vectors of the adjacency table are used for the principal projection, otherwise the rows (default) are used. Has no incidence when the *Digraph* instance *self*  is symmetric. 
 
.. warning::
 
    The method, writing and reading temporary files: 
    tempCol.r and rotationCol.csv, resp. tempRow.r and rotationRow.csv,
    by default in the working directory (./),
    is hence not safe for multiprocessing programs, unless a
    temporary directory *tempDir* is provided.
flatChoice(self, ch, Debug=False)
Converts set or list ch recursively to a flat list of items.
forcedBestSingleChoice(self)
Renders the set of most determined outranking singletons in self.
gammaSets(self)
Renders the dictionary of neighborhoods {node: (dx,ax)}
with set *dx* gathering the dominated, and set *ax* gathering
the absorbed neighborhood.
generateAbsPreKernels(self)
Generate all absorbent prekernels from independent choices generator.
generateDomPreKernels(self)
Generate all dominant prekernels from independent choices generator.
htmlChoiceVector(self, ch, ChoiceVector=True, choiceType='good')
Show procedure for annotated bipolar choices.
inDegrees(self)
renders the median cut indegrees
inDegreesDistribution(self)
Renders the distribution of indegrees.
independentChoices(self, U)
Generator for all independent choices with neighborhoods of a bipolar valued digraph:
 
.. note::
 
       * Initiate with U = self.singletons().
       * Yields [(independent choice, domnb, absnb, indnb)].
inner_prod(self, v1, v2)
Parameters: two choice characteristic vectors
Renders the inner product of two characteristic vetors.
intstab(self, choice)
Computes the independence degree of a choice.
irreflex(self, mat)
Puts diagonal entries of mat to valuationdomain['min']
isAsymmetricIndeterminate(self, Debug=False)
Checks the self.relation for assymmetric indeterminateness!!
 
.. warning::
 
    The reflexive links are ignored !!
isComplete(self, Debug=False)
checks the completeness property of self.relation by checking
for the absence of a link between two actions!!
 
.. warning::
 
    The reflexive links are ignored !!
isCyclic(self, Debug=False)
checks the cyclicity of self.relation by checking
for a reflexive loop in its transitive closure-
 
.. warning::
 
     self.relation is supposed to be irreflexive !
isIntegerValued(self, Debug=False)
Checks whether the decimal valuation of self is integer-valued
be using the as_integer_ratio() method of a Decimal 
giving a tuple (numerator,denominator). If denominator == 1, the
number is an integer.
isOutrankingDigraph(self, Comments=True, Debug=False)
Checks the outranking digraph characteristic condition (3.3).
 
relation[x][y] + relation[y][x)[y] >= 0.0
 
.. warning::
 
    The reflexive links are ignored and the valuation must be bipolar !!
isStrictOutrankingDigraph(self, Comments=True, Debug=False)
Checks the strict outranking digraph characteristic condition (3.1).
 
-(relation[x][y] + relation[y][x]) <= 0.0 , x != y
 
.. warning::
 
    The reflexive links are ignored and the valuation must be bipolar !!
isSymmetric(self, Comments=False)
True if symmetry degree == 1.0.
isTransitive(self, Comments=False)
True if transitivity degree == 1.0.
isWeaklyComplete(self, Debug=False)
checks the weakly completeness property of self.relation by checking
for the absence of a link between two actions!!
 
.. warning::
 
    The reflexive links are ignored !!
iterateRankingByChoosing(self, Odd=False, CoDual=False, Comments=True, Debug=False, Limited=None)
Renders a ranking by choosing result when progressively eliminating
all chordless (odd only) circuits with rising valuation cut levels.
 
Parameters
    CoDual = False (default)/True
    Limited = proportion (in [0,1]) * (max - med) valuationdomain
kChoices(self, A, k)
Renders all choices of length k from set A
matmult2(self, m, v)
Parameters: digraph relation and choice characteristic vector
matrix multiply vector by inner production
meanDegree(self)
Renders the mean degree of self.
!!! self.size must be set previously !!!
meanLength(self, Oriented=False)
Renders the (by default non-oriented) mean neighbourhoor depth of self.
!!! self.order must be set previously !!!
minimalChoices(self, S)
Generates all dominant or absorbent choices of a bipolar
valued digraph.
 
.. note:
 
   * Initiate with S = (actions, dict of dominant or absorbent closed neighborhoods)
   * See showMinDom and showMinAbs methods.
minimalValuationLevelForCircuitsElimination(self, Odd=True, Debug=False, Comments=False)
renders the minimal valuation level <lambda> that eliminates all
self.circuitsList stored odd chordless circuits from self.
 
.. warning::
 
    The <lambda> level polarised may still contain newly appearing chordless odd circuits !
neighbourhoodCollection(self, Oriented=False, Potential=False)
Renders the neighbourhood.
neighbourhoodDepthDistribution(self, Oriented=False)
Renders the distribtion of neighbourhood depths.
notGammaSets(self)
Renders the dictionary of neighborhoods {node: (dx,ax)}
with set *dx* gathering the not dominated, and set *ax* gathering
the not absorbed neighborhood.
notaneighbors(self, node)
Renders the set of absorbed not in-neighbors of a node.
notdneighbors(self, node)
Renders the set of not dominated out-neighbors of a node.
outDegrees(self)
renders the median cut outdegrees
outDegreesDistribution(self)
Renders the distribution of outdegrees.
plusirredundant(self, U)
Generates all +irredundant choices of a digraph.
powerset(self, U)
Generates all subsets of a set.
readPerrinMisset(self, file='curd.dat')
read method for 0-1-char-coded MISs by default from the perrinMIS.c curd.dat result file.
readabsvector(self, x, relation)
Parameter: action x
absorbent in vector.
readdomvector(self, x, relation)
Parameter: action x
dominant out vector.
recodeValuation(self, newMin=-1.0, newMax=1.0, ndigits=4, Debug=False)
Recodes the characteristic valuation domain according
to the parameters given. 
 
*ndigits* indicates the number of decimal digits of the valuation.
relationFct(self, x, y)
wrapper for self.relation dictionary access to ensure interoperability
with the sparse and big outranking digraph implementation model.
save(self, fileName='tempdigraph', option=None, DecimalValuation=True, decDigits=2)
Persistent storage of a Digraph class instance in the form of
a python source code file
saveCSV(self, fileName='tempdigraph', Normalized=False, Dual=False, Converse=False, Diagonal=False, Debug=False)
Persistent storage of a Digraph class instance in the form of
a csv file.
saveXMCDA2(self, fileName='temp', fileExt='xmcda2', Comments=True, relationName='R', relationType='binary', category='random', subcategory='valued', author='digraphs Module (RB)', reference='saved from Python', valuationType='standard', digits=2, servingD3=False)
save digraph in XMCDA 2.0 format. Deprecated now.
savedre(self, fileName='temp')
save digraph in nauty format.
sharp(self, x, y)
Paramaters: choice characteristic values.
Renders the sharpest of two characteristic values x and y.
sharpvec(self, v, w)
Paramaters: choice characteristic vectors.
Renders the sharpest of two characteristic vectors v and w.
showActions(self)
presentation methods for digraphs actions
showAttributes(self)
Prints out the attributes of self.
showAutomorphismGenerators(self)
Renders the generators of the automorphism group.
showBadChoices(self, Recompute=True)
Characteristic values for potentially bad choices.
showBestChoiceRecommendation(self, Verbose=False, Comments=True, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True)
Shows the RuBis best choice recommendation.
 
.. note::
 
    Computes by default the Rubis best choice recommendation on the corresponding strict (codual) outranking digraph.
 
    By default, with BrokenCocs=True, we brake all chordless circuits at their weakest determined ( abs(r(x>y)) + abs(r(y>x)) ) link.
 
    When BrokenCocs=False we proceed like follows:
 
    In case of chordless circuits, if supporting arcs are more credible
    than the reversed negating arcs, we collapse the circuits into hyper nodes.
    Inversely,  if supporting arcs are not more credible than the reversed negating arcs,
    we brake the circuits on their weakest arc.
 
Usage example:
 
>>> from outrankingDigraphs import *
>>> t = Random3ObjectivesPerformanceTableau(seed=5)
>>> g = BipolarOutrankingDigraph(t)
>>> g.showBestChoiceRecommendation()
***********************
RuBis Best Choice Recommendation (BCR)
(in decreasing order of determinateness)   
Credibility domain:  [-100.0, 100.0]
=== >> potential first choices
* choice              : ['a04', 'a14', 'a19', 'a20']
   independence        : 1.19
   dominance           : 4.76
   absorbency          : -59.52
   covering (%)        : 75.00
   determinateness (%) : 57.86
   - most credible action(s) = { 'a14': 23.81, 'a19': 11.90, 'a04': 2.38, 'a20': 1.19, }  
=== >> potential last choices 
* choice              : ['a03', 'a12', 'a17']
  independence        : 4.76
  dominance           : -76.19
  absorbency          : 4.76
  covering (%)        : 0.00
  determinateness (%) : 65.39
  - most credible action(s) = { 'a03': 38.10, 'a12': 13.10, 'a17': 4.76, }
Execution time: 0.024 seconds
*****************************
showChoiceVector(self, ch, choiceType='good', ChoiceVector=True)
Show procedure for annotated bipolar choices.
showChordlessCircuits(self, Recompute=False)
Show method for chordless circuits observed in a Digraph instance.
 
If previous computation is required, stores the detected circuits in self.circuitsList attribute.
showComponents(self)
Shows the list of connected components of the digraph instance.
showCorrelation(self, corr=None, ndigits=3)
Renders the valued ordinal correlation index, the crisp Kendall tau index and their epistemic determination degree.
showFirstChoiceRecommendation(self, Verbose=False, Comments=True, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True)
Shows the RuBis first choice recommendation.
 
.. note::
 
    Computes by default the Rubis first choice recommendation on the corresponding strict (codual) outranking digraph.
 
    By default, with BrokenCocs=True, we brake all chordless circuits at their weakest determined ( abs(r(x>y)) + abs(r(y>x)) ) link.
 
    When BrokenCocs=False we proceed like follows:
 
    In case of chordless circuits, if supporting arcs are more credible
    than the reversed negating arcs, we collapse the circuits into hyper nodes.
    Inversely,  if supporting arcs are not more credible than the reversed negating arcs,
    we brake the circuits on their weakest arc.
 
Usage example:
 
>>> from outrankingDigraphs import *
>>> t = Random3ObjectivesPerformanceTableau(seed=5)
>>> g = BipolarOutrankingDigraph(t)
>>> g.showFirstChoiceRecommendation()
***********************
RuBis First Choice Recommendation (BCR)
(in decreasing order of determinateness)   
Credibility domain:  [-100.0, 100.0]
=== >> potential first choices
* choice              : ['a04', 'a14', 'a19', 'a20']
   independence        : 1.19
   dominance           : 4.76
   absorbency          : -59.52
   covering (%)        : 75.00
   determinateness (%) : 57.86
   - most credible action(s) = { 'a14': 23.81, 'a19': 11.90, 'a04': 2.38, 'a20': 1.19, }  
=== >> potential last choices 
* choice              : ['a03', 'a12', 'a17']
  independence        : 4.76
  dominance           : -76.19
  absorbency          : 4.76
  covering (%)        : 0.00
  determinateness (%) : 65.39
  - most credible action(s) = { 'a03': 38.10, 'a12': 13.10, 'a17': 4.76, }
Execution time: 0.024 seconds
*****************************
showGoodChoices(self, Recompute=True)
Characteristic values for potentially good choices.
showHTMLBestChoiceRecommendation(self, pageTitle=None, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True, htmlFileName=None)
showHTMLRelationHeatmap(self, actionsList=None, rankingRule='NetFlows', colorLevels=7, tableTitle='Relation Heatmap', relationName='r(x S y)', ndigits=2, fromIndex=None, toIndex=None, htmlFileName=None)
Launches a browser window with the colored relation map of self.
 
See corresponding :py:class:`~digraphs.Digraph.showHTMLRelationMap` method.
 
The *colorLevels* parameter may be set to 3, 5, 7 (default) or 9.
 
When the *actionsList* parameter is *None* (default), the digraphs actions list may be ranked with the *rankingRule* parameter set to the 'Copeland' (default) or to the 'Netlows' ranking rule.
 
When the *htmlFileName* parameter is set to a string value 'xxx', a html file named 'xxx.html' will be generated in the current working directory. Otherwise, a temporary file named 'tmp*.html' will be generated there.
 
Example::
 
    >>> from outrankingDigraphs import *
    >>> t = RandomCBPerformanceTableau(numberOfActions=25,seed=1)
    >>> g = BipolarOutrankingDigraph(t,ndigits=2)
    >>> gcd = ~(-g)  # strict outranking relation
    >>> gcd.showHTMLRelationHeatmap(colorLevels=7,ndigits=2)
    
.. image:: relationHeatmap.png
   :alt: Browser view of a relation map
   :width: 600 px
   :align: center
showHTMLRelationMap(self, actionsList=None, rankingRule='Copeland', Colored=True, tableTitle='Relation Map', relationName='r(x S y)', symbols=['+', '&middot;', '&nbsp;', '&#150;', '&#151'], fromIndex=None, toIndex=None, htmlFileName=None)
Launches a browser window with the colored relation map of self.
See corresponding Digraph.showRelationMap() method.
 
When *htmlFileName* parameter is set to a string value, a html file
with that name will be stored in the current working directory.
 
By default, a temporary file named: tmp*.html will be generated
instead in the current working directory.
 
Example::
 
    >>> from outrankingDigraphs import *
    >>> t = RandomCBPerformanceTableau(numberOfActions=25,seed=1)
    >>> g = BipolarOutrankingDigraph(t,Normalized=True)
    >>> gcd = ~(-g)  # strict outranking relation
    >>> gcd.showHTMLRelationMap(rankingRule="NetFlows")
    
.. image:: relationMap.png
   :alt: Browser view of a relation map
   :width: 600 px
   :align: center
showHTMLRelationTable(self, actionsList=None, relation=None, IntegerValues=False, ndigits=2, Colored=True, tableTitle='Valued Adjacency Matrix', relationName='r(x S y)', ReflexiveTerms=False, htmlFileName=None, fromIndex=None, toIndex=None)
Launches a browser window with the colored relation table of self.
showMIS(self, withListing=True)
Prints all maximal independent choices:
    Result in self.misset.
showMIS_AH(self, withListing=True)
Prints all MIS using the Hertz method.
 
Result saved in self.hertzmisset.
showMIS_HB2(self, withListing=True)
Prints all MIS using the Hertz-Bisdorff method.
 
Result saved in self.newmisset.
showMIS_RB(self, withListing=True)
Prints all MIS using the Bisdorff method.
 
Result saved in self.newmisset.
showMIS_UD(self, withListing=True)
Prints all MIS using the Hertz-Bisdorff method.
 
Result saved in self.newmisset.
showMaxAbsIrred(self, withListing=True)
Computing maximal -irredundant choices:
    Result in self.absirset.
showMaxDomIrred(self, withListing=True)
Computing maximal +irredundant choices:
   Result in self.domirset.
showMinAbs(self, withListing=True)
Prints minimal absorbent choices:
    Result in self.absset.
showMinDom(self, withListing=True)
Prints all minimal dominant choices:
    Result in self.domset.
showNeighborhoods(self)
Lists the gamma and the notGamma function of self.
showOrbits(self, InChoices, withListing=True)
Prints the orbits of Choices along the automorphisms of
the Digraph instance.
 
Example Python session for computing the non isomorphic MISs from the 12-cycle graph:
 
>>> from digraphs import *
>>> c12 = CirculantDigraph(order=12,circulants=[1,-1])
>>> c12.automorphismGenerators()
...
  Permutations
  {'1': '1', '2': '12', '3': '11', '4': '10', '5': 
   '9', '6': '8', '7': '7', '8': '6', '9': '5', '10': 
   '4', '11': '3', '12': '2'}
  {'1': '2', '2': '1', '3': '12', '4': '11', '5': '10', 
   '6': '9', '7': '8', '8': '7', '9': '6', '10': '5', 
   '11': '4', '12': '3'}
  Reflections {}
>>> print('grpsize = ', c12.automorphismGroupSize)
  grpsize = 24
>>> c12.showMIS(withListing=False)
  *---  Maximal independent choices ---*
  number of solutions:  29
  cardinality distribution
  card.:  [0, 1, 2, 3, 4,  5,  6, 7, 8, 9, 10, 11, 12]
  freq.:  [0, 0, 0, 0, 3, 24,  2, 0, 0, 0,  0,  0,  0]
  Results in c12.misset
>>> c12.showOrbits(c12.misset,withListing=False)
...
  *---- Global result ----
  Number of MIS:  29
  Number of orbits :  4
  Labelled representatives:
  1: ['2','4','6','8','10','12']
  2: ['2','5','8','11']
  3: ['2','4','6','9','11']
  4: ['1','4','7','9','11']
  Symmetry vector
  stabilizer size: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, ...]
  frequency      : [0, 2, 0, 0, 0, 0, 0, 1, 0,  0,  0,  1, ...]
 
*Figure*: The symmetry axes of the non isomorphic MISs of the 12-cycle:
 
.. image:: c12.png
   :width: 400 px
   :align: center
   :alt: The 4 non isomorphic MIS of the 12-cycle graph
 
*Reference*: R. Bisdorff and J.L. Marichal (2008). Counting non-isomorphic maximal independent sets of the n-cycle graph. *Journal of Integer Sequences*, Vol. 11 Article 08.5.7 (`openly accessible here <https://www.cs.uwaterloo.ca/journals/JIS/VOL11/Marichal/marichal.html>`_)
showOrbitsFromFile(self, InFile, withListing=True)
Prints the orbits of Choices along the automorphisms of
the digraph self by reading in the 0-1 misset file format.
See the :py:func:`digraphs.Digraph.readPerrinMisset` method.
showPreKernels(self, withListing=True)
Printing dominant and absorbent preKernels:
    Result in self.dompreKernels and self.abspreKernels
showRankingByBestChoosing(self, rankingByBestChoosing=None)
A show method for self.rankinByBestChoosing result.
 
.. warning::
 
     The self.computeRankingByBestChoosing(CoDual=False/True) method instantiating the self.rankingByBestChoosing slot is pre-required !
showRankingByChoosing(self, rankingByChoosing=None, WithCoverCredibility=False)
A show method for self.rankinByChoosing result.
 
When parameter *WithCoverCredibility* is set to True, the credibility of outranking, respectively being outranked is indicated at each selection step. 
 
.. warning::
 
     The self.computeRankingByChoosing(CoDual=False/True) method instantiating the self.rankingByChoosing slot is pre-required !
showRankingByLastChoosing(self, rankingByLastChoosing=None, Debug=None)
A show method for self.rankinByChoosing result.
 
.. warning::
 
     The self.computeRankingByLastChoosing(CoDual=False/True) method instantiating the self.rankingByChoosing slot is pre-required !
showRelation(self)
prints the relation valuation in ##.## format.
showRelationMap(self, symbols=None, rankingRule='Copeland', fromIndex=None, toIndex=None, actionsList=None)
Prints on the console, in text map format, the location of
certainly validated and certainly invalidated outranking situations.
 
By default, symbols = {'max':'┬','positive': '+', 'median': ' ',
                       'negative': '-', 'min': '┴'}
 
The default ordering of the output is following the Copeland ranking rule
from best to worst actions. Further available ranking rule is the 'NetFlows' net flows rule.
 
 
Example::
 
    >>> from outrankingDigraphs import *
    >>> t = RandomCBPerformanceTableau(numberOfActions=25,seed=1)
    >>> g = BipolarOutrankingDigraph(t,Normalized=True)
    >>> gcd = ~(-g)  # strict outranking relation
    >>> gcd.showRelationMap(rankingRule="NetFlows")
     -   ++++++++  +++++┬+┬┬+
    - -   + +++++ ++┬+┬+++┬++
    ┴+  ┴ + ++  ++++┬+┬┬++┬++
    -   ++ - ++++-++++++┬++┬+
       - - - ++- ┬- + -+┬+-┬┬
    -----  -      -┬┬┬-+  -┬┬
    ----    --+-+++++++++++++
    -- --+- --++ ++ +++-┬+-┬┬
    ----  -  -+-- ++--+++++ +
    ----- ++- --- +---++++┬ +
    -- -- ---+ -++-+++-+ +-++
    -- --┴---+  + +-++-+ -  +
    ---- ┴---+-- ++--++++ - +
      --┴┴--  --- -  --+ --┬┬
     ---------+--+ ----- +-┬┬
    -┴---┴- ---+- + ---+++┬ +
    -┴┴--┴---+--- ++ -++--+++
    -----┴--- ---+-+- ++---+ 
    -┴┴--------------- --++┬ 
    --┴---------------- --+┬ 
    ┴--┴┴ -┴--┴┴-┴ --++  ++-+
    ----┴┴--------------- -  
    ┴┴┴----+-┴+┴---┴-+---+ ┴+
    ┴┴-┴┴┴-┴- - -┴┴---┴┴+ ┬ -
    ----┴┴-┴-----┴┴---  - -- 
    Ranking rule: NetFlows
    >>>
showRelationTable(self, Sorted=True, rankingRule=None, IntegerValues=False, actionsSubset=None, relation=None, ndigits=2, ReflexiveTerms=True, fromIndex=None, toIndex=None)
Prints the relation valuation in actions X actions table format.
Copeland and NetFlows rankings my be used.
showRubisBestChoiceRecommendation(self, **kwargs)
Dummy for backward portable showBestChoiceRecommendation().
showRubyChoice(self, Verbose=False, Comments=True, _OldCoca=True)
Dummy for showBestChoiceRecommendation()
needed for older versions compatibility.
showShort(self)
concise presentation method for genuine digraphs.
showSingletonRanking(self, Comments=True, Debug=False)
Calls self.computeSingletonRanking(comments=True,Debug = False).
Renders and prints the sorted bipolar net determinatation of outrankingness
minus outrankedness credibilities of all singleton choices.
 
res = ((netdet,sigleton,dom,absorb)+)
showStatistics(self)
Computes digraph statistics like order, size and arc-density.
showdre(self)
Shows relation in nauty format.
singletons(self)
list of singletons and neighborhoods
[(singx1, +nx1, -nx1, not(+nx1 or -nx1)),.... ]
sizeSubGraph(self, choice)
Output: (size, undeterm,arcDensity).
Renders the arc density of the induced subgraph.
strongComponents(self, setPotential=False)
Renders the set of strong components of self.
symDegreesDistribution(self)
Renders the distribution of symmetric degrees.
topologicalSort(self, Debug=False)
If self is acyclic, adds topological sort number to each node of self
and renders ordered list of nodes. Otherwise renders None.
Source: M. Golumbic Algorithmic Graph heory and Perfect Graphs,
Annals Of Discrete Mathematics 57 2nd Ed. , Elsevier 2004, Algorithm 2.4 p.44.
weakAneighbors(self, node)
Renders the set of absorbed in-neighbors of a node.
weakCondorcetLosers(self)
Renders the set of decision actions x such that
self.relation[x][y] <= self.valuationdomain['med']
for all y != x.
weakCondorcetWinners(self)
Renders the set of decision actions x such that
self.relation[x][y] >= self.valuationdomain['med']
for all y != x.
weakDneighbors(self, node)
Renders the set of dominated out-neighbors of a node.
weakGammaSets(self)
Renders the dictionary of neighborhoods {node: (dx,ax)}
zoomValuation(self, zoomFactor=1.0)
Zooms in or out, depending on the value of the zoomFactor provided,
the bipolar valuation of a digraph.

Data descriptors inherited from Digraph:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class XORDigraph(Digraph)
    XORDigraph(d1, d2, Debug=False)
 
Instantiates the XOR digraph of two bipolar
digraphs d1 and d2 of same order.
 
 
Method resolution order:
XORDigraph
Digraph
builtins.object

Methods defined here:
__init__(self, d1, d2, Debug=False)
Initialize self.  See help(type(self)) for accurate signature.

Methods inherited from Digraph:
MISgen(self, S, I)
generator of maximal independent choices (voir Byskov 2004):
    * S ::= remaining nodes;
    * I ::= current independent choice
 
.. note::
 
        Inititalize: self.MISgen(self.actions.copy(),set())
__invert__(self)
Make the inverting operator ~self available for Digraph instances. 
 
Returns a ConverseDigraph instance of self.
__neg__(self)
Make the negation operator -self available for Digraph instances. 
 
Returns a DualDigraph instance of self.
__repr__(self)
Default presentation method for Digraph instances.
absirred(self, choice)
Renders the crips -irredundance degree of a choice.
absirredundant(self, U)
Generates all -irredundant choices of a digraph.
absirredval(self, choice, relation)
Renders the valued -irredundance degree of a choice.
absirredx(self, choice, x)
Computes the crips -irredundance degree of node x in a choice.
abskernelrestrict(self, prekernel)
Parameter: prekernel
Renders absorbent prekernel restricted relation.
absorb(self, choice)
Renders the absorbency degree of a choice.
absorbentChoices(self, S)
Generates all minimal absorbent choices of a bipolar valued digraph.
addValuationAttribute(self)
Adds the numpy valuation attribute
agglomerationDistribution(self)
Output: aggloCoeffDistribution, meanCoeff
Renders the distribution of agglomeration coefficients.
aneighbors(self, node)
Renders the set of absorbed in-neighbors of a node.
automorphismGenerators(self)
Adds automorphism group generators to the digraph instance.
 
.. note::
 
    Dependency: Uses the dreadnaut command from the nauty software package. See https://www3.cs.stonybrook.edu/~algorith/implement/nauty/implement.shtml
 
    On Ubuntu Linux:
      ...$ sudo apt-get install nauty
averageCoveringIndex(self, choice, direction='out')
Renders the average covering index of a given choice in a set of objects,
ie the average number of choice members that cover each
non selected object.
bipolarKCorrelation(self, digraph, Debug=False)
Renders the bipolar Kendall correlation between two bipolar valued
digraphs computed from the average valuation of the
XORDigraph(self,digraph) instance.
 
.. warning::
 
     Obsolete! Is replaced by the self.computeBipolarCorrelation(other) Digraph method
bipolarKDistance(self, digraph, Debug=False)
Renders the bipolar crisp Kendall distance between two bipolar valued
digraphs.
 
.. warning::
 
     Obsolete! Is replaced by the self.computeBipolarCorrelation(other, MedianCut=True) Digraph method
chordlessPaths(self, Pk, n2, Odd=False, Comments=False, Debug=False)
New procedure from Agrum study April 2009
recursive chordless path extraction starting from path
Pk = [n2, ...., n1] and ending in node n2.
Optimized with marking of visited chordless P1s.
circuitAverageCredibility(self, circ)
Renders the average linking credibility of a Chordless Circuit.
circuitCredibilities(self, circuit, Debug=False)
Renders the average linking credibilities and the minimal link of a Chordless Circuit.
circuitMaxCredibility(self, circ)
Renders the maximal linking credibility of a Chordless Circuit.
circuitMinCredibility(self, circ)
Renders the minimal linking credibility of a Chordless Circuit.
closeSymmetric(self, InSite=True)
Produces the symmetric closure of self.relation.
closeTransitive(self, Reverse=False, InSite=True, Comments=False)
Produces the transitive closure of self.relation
 
*Parameters*:
 
    - If *Reverse* == True (False default) all transitive links are dropped, otherwise all transitive links are closed with min[r(x,y),r(y,z)];
    - If *Insite* == False (True by default) the methods return a modified copy of self.relation without altering the original self.relation, otherwise self.relation is modified.
components(self)
Renders the list of connected components.
computeAllDensities(self, choice=None)
parameter: choice in self
renders six densitiy parameters:
arc density, double arc density,
single arc density, strict single arc density,
absence arc density, strict absence arc densitiy.
computeArrowRaynaudOrder(self)
Renders a linear ordering from worst to best of the actions following Arrow&Raynaud's rule.
computeArrowRaynaudRanking(self)
renders a linear ranking from best to worst of the actions following Arrow&Raynaud's rule.
computeAverageValuation(self)
Computes the bipolar average correlation between
self and the crisp complete digraph of same order
of the irreflexive and determined arcs of the digraph
computeBadChoices(self, Comments=False)
Computes characteristic values for potentially bad choices.
 
.. note::
 
     Returns a tuple with following content:
 
     [(0)-determ,(1)degirred,(2)degi,(3)degd,(4)dega,(5)str(choice),(6)absvec]
computeBadPirlotChoices(self, Comments=False)
Characteristic values for potentially bad choices
using the Pirlot's fixpoint algorithm.
computeBestChoiceRecommendation(self, Verbose=False, Comments=False, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True)
Sets self.bestChoice, self.bestChoiceData, self.worstChoice and self.worstChoiceData
with the showBestChoiceRecommendation method.
 
First and last choices data is the following:
[(0)-determ,(1)degirred,(2)degi,(3)degd,(4)dega,(5)str(choice),(6)domvec,(7)cover]
 
self.bestChoice = self.bestChoiceData[5]
self.worstChoice = self.worstChoiceData[5]
computeBipolarCorrelation(self, other, MedianCut=False, filterRelation=None, Debug=False)
obsolete: dummy replacement for Digraph.computeOrdinalCorrelation method
computeChordlessCircuits(self, Odd=False, Comments=False, Debug=False)
Renders the set of all chordless circuits detected in a digraph.
Result is stored in <self.circuitsList>
holding a possibly empty list of tuples with at position 0 the
list of adjacent actions of the circuit and at position 1
the set of actions in the stored circuit.
 
When *Odd* is True, only chordless circuits with an odd length
are collected.
computeChordlessCircuitsMP(self, Odd=False, Threading=False, nbrOfCPUs=None, startMethod=None, Comments=False, Debug=False)
Multiprocessing version of computeChordlessCircuits().
 
Renders the set of all chordless odd circuits detected in a digraph.
Result (possible empty list) stored in <self.circuitsList>
holding a possibly empty list tuples with at position 0 the
list of adjacent actions of the circuit and at position 1
the set of actions in the stored circuit.
Inspired by Dias, Castonguay, Longo, Jradi, Algorithmica (2015).
 
Returns a possibly empty list of tuples (circuit,frozenset(circuit)).
 
If Odd == True, only circuits of odd length are retained in the result.
computeCoSize(self)
Renders the number of non validated non reflexive arcs
computeConcentrationIndex(self, X, N)
Renders the Gini concentration index of the X serie.
N contains the partial frequencies.
Based on the triangle summation formula.
computeConcentrationIndexTrapez(self, X, N)
Renders the Gini concentration index of the X serie.
N contains the partial frequencies.
Based on the triangles summation formula.
computeCondorcetLosers(self)
Wrapper for condorcetLosers().
computeCondorcetWinners(self)
Wrapper for condorcetWinners().
computeCopelandOrder(self)
renders a linear ordering from worst to best of the actions following Arrow&Raynaud's rule.
computeCopelandRanking(self)
renders a linear ranking from best to worst of the actions following Arrow&Raynaud's rule.
computeCutLevelDensities(self, choice, level)
parameter: choice in self, robustness level
renders three robust densitiy parameters:
robust double arc density,
robust single arc density,
robust absence arc densitiy.
computeDensities(self, choice)
parameter: choice in self
renders the four densitiy parameters:
arc density, double arc density, single arc density, absence arc density.
computeDeterminateness(self, InPercents=False)
Computes the Kendalll distance of self
with the all median-valued indeterminate digraph of order n.
 
Return the average determination of the irreflexive part of the digraph.
 
*determination* = sum_(x,y) { abs[ r(xRy) - Med ] } / n(n-1)
 
If *InPercents* is True, returns the average determination in percentage of
(Max - Med) difference.
 
>>> from outrankingDigraphs import BipolarOutrankingDigraph
>>> from randomPerfTabs import Random3ObjectivesPerformanceTableau
>>> t = Random3ObjectivesPerformanceTableau(numberOfActions=7,numberOfCriteria=7,seed=101)
>>> g = BipolarOutrankingDigraph(t,Normalized=True)
>>> g
*------- Object instance description ------*
Instance class      : BipolarOutrankingDigraph
Instance name       : rel_random3ObjectivesPerfTab
Actions             : 7
Criteria            : 7
Size                : 27
Determinateness (%) : 65.67
Valuation domain    : [-1.00;1.00]
>>> print(g.computeDeterminateness())
0.3134920634920634920634920638
>>> print(g.computeDeterminateness(InPercents=True))
65.67460317460317460317460320
>>> g.recodeValuation(0,1)
>>> g
*------- Object instance description ------*
Instance class      : BipolarOutrankingDigraph
Instance name       : rel_random3ObjectivesPerfTab
Actions             : 7
Criteria            : 7
Size                : 27
Determinateness (%) : 65.67
Valuation domain    : [0.00;1.00]
>>> print(g.computeDeterminateness())
0.1567460317460317460317460318
>>> print(g.computeDeterminateness(InPercents=True))
65.67460317460317460317460320
computeDiameter(self, Oriented=True)
Renders the (by default oriented) diameter of the digraph instance
computeDigraphCentres(self, WeakDistances=False, Comments=False)
The centers of a digraph are the nodes with finite minimal shortes path lengths.
 
The maximal neighborhood distances are stored in *self.maximalNeighborhoodDistances*.
 
The corresponding digraph radius and diameter are stored respectively  in *self.radius* and *self.diameter*.
 
With *Comments* = True, all these results are printed out.
 
*Source*: Claude Berge, *The Theory of Graphs*, Dover (2001) pp. 119, original in French Dunod (1958)
computeDynamicProgrammingStages(self, source, sink, Debug=False)
Renders the discrete stages of the optimal substructure for
dynamic pogramming digrahs from a given source node 
to a given sink sink node.
 
Returns a list of list of action identifyers.
computeGoodChoiceVector(self, ker, Comments=False)
| Computing Characteristic values for dominant pre-kernels
| using the von Neumann dual fixoint equation
computeGoodChoices(self, Comments=False)
Computes characteristic values for potentially good choices.
 
..note::
 
     Return a tuple with following content:
 
     [(0)-determ,(1)degirred,(2)degi,(3)degd,(4)dega,(5)str(choice),(6)domvec,(7)cover]
computeGoodPirlotChoices(self, Comments=False)
Characteristic values for potentially good choices
using the Pirlot fixpoint algorithm.
computeIncomparabilityDegree(self, InPercents=False, Comments=False)
Renders the incomparability degree (Decimal), i.e. the relative number of symmetric indeterminate relations of the irreflexive part of a digraph.
computeKemenyIndex(self, otherRelation)
renders the Kemeny index of the self.relation
compared with a given crisp valued relation of a compatible
other digraph (same nodes or actions).
computeKemenyOrder(self, orderLimit=7, Debug=False)
Renders a ordering from worst to best of the actions with maximal Kemeny index.
Return a tuple: kemenyOrder (from worst to best), kemenyIndex
computeKemenyRanking(self, orderLimit=7, seed=None, sampleSize=1000, Debug=False)
Renders a ranking from best to worst of the actions with maximal Kemeny index.
 
.. note::
 
     Returns a tuple: kemenyRanking (from best to worst), kemenyIndex.
computeKernelVector(self, kernel, Initial=True, Comments=False)
| Computing Characteristic values for dominant pre-kernels
| using the von Neumann dual fixpoint equation
computeKohlerOrder(self)
Renders an ordering (worst to best) of the actions following Kohler's rule.
computeKohlerRanking(self)
Renders a ranking (best to worst) of the actions following Kohler's rule.
computeMaxHoleSize(self, Comments=False)
Renders the length of the largest chordless cycle
in the corresponding disjunctive undirected graph.
computeMeanInDegree(self)
Renders the mean indegree of self.
!!! self.size must be set previously !!!
computeMeanOutDegree(self)
Renders the mean degree of self.
!!! self.size must be set previously !!!
computeMeanSymDegree(self)
Renders the mean degree of self.
!!! self.size must be set previously !!!
computeMedianOutDegree(self)
Renders the median outdegree of self.
!!! self.size must be set previously !!!
computeMedianSymDegree(self)
Renders the median symmetric degree of self.
!!! self.size must be set previously !!!
computeMoreOrLessUnrelatedPairs(self)
Renders a list of more or less unrelated pairs.
computeNetFlowsOrder(self)
Renders an ordered list (from best to worst) of the actions
following the net flows ranking rule.
computeNetFlowsOrderDict(self)
Renders an ordered list (from worst to best) of the actions
following the net flows ranking rule.
computeNetFlowsRanking(self)
Renders an ordered list (from best to worst) of the actions
following the net flows ranking rule.
computeNetFlowsRankingDict(self)
Renders an ordered list (from best to worst) of the actions
following the net flows ranking rule.
computeODistance(self, op2, comments=False)
renders the squared normalized distance of
two digraph valuations.
 
.. note::
 
     op2 = digraphs of same order as self.
computeOrbit(self, choice, withListing=False)
renders the set of isomorph copies of a choice following
the automorphism of the digraph self
computeOrderCorrelation(self, order, Debug=False)
Renders the ordinal correlation K of a digraph instance
when compared with a given linear order (from worst to best) of its actions
 
K = sum_{x != y} [ min( max(-self.relation(x,y)),other.relation(x,y), max(self.relation(x,y),-other.relation(x,y)) ]
 
K /= sum_{x!=y} [ min(abs(self.relation(x,y),abs(other.relation(x,y)) ]
 
.. note::
 
     Renders a dictionary with the key 'correlation' containing the actual bipolar correlation index and the key 'determination' containing the minimal determination level D of self and the other relation.
 
     D = sum_{x != y} min(abs(self.relation(x,y)),abs(other.relation(x,y)) / n(n-1)
 
     where n is the number of actions considered.
 
     The correlation index with a completely indeterminate relation
     is by convention 0.0 at determination level 0.0 .
 
.. warning::
 
     self must be a normalized outranking digraph instance !
computeOrdinalCorrelation(self, other, MedianCut=False, filterRelation=None, Debug=False)
Renders the bipolar correlation K of a
self.relation when compared
with a given compatible (same actions set)) digraph or
a [-1,1] valued compatible relation (same actions set).
 
If MedianCut=True, the correlation is computed on the median polarized relations.
 
If filterRelation is not None, the correlation is computed on the partial domain corresponding to the determined part of the filter relation.
 
.. warning::
 
     Notice that the 'other' relation and/or the 'filterRelation',
     the case given, must both be normalized, ie [-1,1]-valued !
 
K = sum_{x != y} [ min( max(-self.relation[x][y]),other.relation[x][y]), max(self.relation[x][y],-other.relation[x][y]) ]
 
K /= sum_{x!=y} [ min(abs(self.relation[x][y]),abs(other.relation[x][y])) ]
 
.. note::
 
     Renders a tuple with at position 0 the actual bipolar correlation index
     and in position 1 the minimal determination level D of self and
     the other relation.
 
     D = sum_{x != y} min(abs(self.relation[x][y]),abs(other.relation[x][y])) / n(n-1)
 
     where n is the number of actions considered.
 
     The correlation index with a completely indeterminate relation
     is by convention 0.0 at determination level 0.0 .
computeOrdinalCorrelationMP(self, other, MedianCut=False, Threading=False, nbrOfCPUs=None, startMethod=None, Comments=False, Debug=False)
Multi processing version of the digraphs.computeOrdinalCorrelation() method.
 
.. note::
     The relation filtering and the MedinaCut option are not implemented in the MP version.
computePairwiseClusterComparison(self, K1, K2, Debug=False)
Computes the pairwise cluster comparison credibility vector
from bipolar-valued digraph g. with K1 and K2 disjoint
lists of action keys from g actions disctionary.
Returns the dictionary
{'I': Decimal(),'P+':Decimal(),'P-':Decimal(),'R' :Decimal()}
where one and only one item is strictly positive.
computePreKernels(self)
computing dominant and absorbent preKernels:
    Result in self.dompreKernels and self.abspreKernels
computePreRankingRelation(self, preRanking, Normalized=True, Debug=False)
Renders the bipolar-valued relation obtained from
a given preRanking in decreasing levels (list of lists) result.
computePreorderRelation(self, preorder, Normalized=True, Debug=False)
Renders the bipolar-valued relation obtained from
a given preordering in increasing levels (list of lists) result.
computePrincipalOrder(self, Colwise=False, Comments=False)
Rendesr an ordering from wrost to best of the decision actions.
computePrincipalRanking(self, Colwise=False, Comments=False)
Rendesr a ranking from best to worst of the decision actions.
computePrincipalScores(self, plotFileName=None, Colwise=False, imageType=None, tempDir=None, bgcolor='cornsilk', Comments=False, Debug=False)
Renders a ordered list of the first principal eigenvector of the covariance of the valued outdegrees of self.
 
.. note::
 
   The method, relying on writing and reading temporary files by default in a temporary directory is threading and multiprocessing safe !
   (see Digraph.exportPrincipalImage method)
computePrudentBetaLevel(self, Debug=False)
computes alpha, ie the lowest valuation level, for which the
bipolarly polarised digraph doesn't contain a chordless circuit.
computeRankingByBestChoosing(self, CoDual=False, Debug=False)
Computes a weak preordering of the self.actions by recursive
best choice elagations.
 
Stores in self.rankingByBestChoosing['result'] a list of (P+,bestChoice) tuples
where P+ gives the best choice complement outranking
average valuation via the computePairwiseClusterComparison
method.
 
If self.rankingByBestChoosing['CoDual'] is True, 
the ranking-by-choosing was computed on the codual of self.
computeRankingByBestChoosingRelation(self, rankingByBestChoosing=None, Debug=False)
Renders the bipolar-valued relation obtained from
the self.rankingByBestChoosing result.
computeRankingByChoosing(self, actionsSubset=None, Debug=False, CoDual=False)
Computes a weak preordring of the self.actions by iterating
jointly first and last choice elagations.
 
Stores in self.rankingByChoosing['result'] a list of ((P+,bestChoice),(P-,worstChoice)) pairs
where P+ (resp. P-) gives the best (resp. worst) choice complement outranking
(resp. outranked) average valuation via the computePairwiseClusterComparison
method.
 
If self.rankingByChoosing['CoDual'] is True, the ranking-by-choosing was computed on the codual of self.
computeRankingByChoosingRelation(self, rankingByChoosing=None, actionsSubset=None, Debug=False)
Renders the bipolar-valued relation obtained from
the self.rankingByChoosing result.
computeRankingByLastChoosing(self, CoDual=False, Debug=False)
Computes a weak preordring of the self.actions by iterating
worst choice elagations.
 
Stores in self.rankingByLastChoosing['result'] a list of (P-,worstChoice) pairs
where P- gives the worst choice complement outranked
average valuation via the computePairwiseClusterComparison
method.
 
If self.rankingByChoosing['CoDual'] is True, the ranking-by-last-chossing 
was computed on the codual of self.
computeRankingByLastChoosingRelation(self, rankingByLastChoosing=None, Debug=False)
Renders the bipolar-valued relation obtained from
the self.rankingByLastChoosing result.
computeRankingCorrelation(self, ranking, Debug=False)
Renders the ordinal correlation K of a digraph instance
when compared with a given linear ranking of its actions
 
K = sum_{x != y} [ min( max(-self.relation(x,y)),other.relation(x,y), max(self.relation(x,y),-other.relation(x,y)) ]
 
K /= sum_{x!=y} [ min(abs(self.relation(x,y),abs(other.relation(x,y)) ]
 
.. note::
 
     Renders a tuple with at position 0 the actual bipolar correlation index
     and in position 1 the minimal determination level D of self and
     the other relation.
 
     D = sum_{x != y} min(abs(self.relation(x,y)),abs(other.relation(x,y)) / n(n-1)
 
     where n is the number of actions considered.
 
     The correlation index with a completely indeterminate relation
     is by convention 0.0 at determination level 0.0 .
computeRelationalStructure(self, Debug=False)
Renders the counted decomposition of the valued relations into
the following type of links:
gt '>', eq '=', lt '<', incomp '<>',
leq '<=', geq '>=', indeterm '?'
computeRubisChoice(self, Comments=False, _OldCoca=False, BrokenCocs=True, Threading=False, nbrOfCPUs=1)
Renders self.strictGoodChoices, self.nullChoices
self.strictBadChoices, self.nonRobustChoices.
 
.. warning::
    Changes in site the outranking digraph by
    adding or braking chordless odd outranking circuits.
computeRubyChoice(self, Comments=False, _OldCoca=False)
dummy for computeRubisChoice()
old versions compatibility.
computeShortestPathLengths(self, WeakPaths=False, Comments=False, Debug=False)
Renders a double dictionary with the directed distances, i.e. the shortest path lengths between all self.actions
 
Equals *None* if there does not exist a directed path between two actions.
 
*Source*: Claude Berge, *The Theory of Graphs*, Dover (2001) pp. 119, original in French Dunod (1958)
computeSingletonRanking(self, Comments=False, Debug=False)
Renders the sorted bipolar net determinatation of outrankingness
minus outrankedness credibilities of all singleton choices.
 
res = ((netdet,singleton,dom,absorb)+)
computeSize(self)
Renders the number of validated non reflexive arcs
computeSizeTransitiveClosure(self)
Renders the size of the transitive closure of a digraph.
computeSlaterOrder(self, isProbabilistic=False, seed=None, sampleSize=1000, Debug=False)
Reversed return from computeSlaterRanking method.
computeSlaterRanking(self, isProbabilistic=False, seed=None, sampleSize=1000, Debug=False)
Renders a ranking of the actions with minimal Slater index.
Return a tuple: slaterOrder, slaterIndex
computeSymmetryDegree(self, InPercents=False, Comments=False)
Renders the symmetry degree (Decimal) of the irreflexive part of a digraph.
 
.. note::
 
   Empty and indeterminate digraphs are considered to be symmetric.
computeTopologicalRanking(self, Debug=False)
Mimetic Wrapper of the topologicalSort() method.
computeTransitivityDegree(self, InPercents=False, Comments=False)
Renders the transitivity degree (Decimal) of a digraph.
 
.. note:: 
 
   An empty or indeterminate digraph is considered to be transitive.
computeUnrelatedPairs(self)
Renders a list of more or less unrelated pairs.
computeValuationLevels(self, choice=None, Debug=False)
renders the symmetric closure of the
apparent valuations levels of self
in an increasingly ordered list.
If parameter choice is given, the
computation is limited to the actions
of the choice.
computeValuationPercentages(self, choice, percentiles, withValues=False)
Parameters: choice and list of percentiles.
renders a series of percentages of the characteristics valuation of
the arcs in the digraph.
computeValuationPercentiles(self, choice, percentages, withValues=False)
Parameters: choice and list of percentages.
renders a series of quantiles of the characteristics valuation of
the arcs in the digraph.
computeValuationStatistics(self, Sampling=False, Comments=False)
Renders the mean and variance of the valuation
of the non reflexive pairs.
computeValuedRankingRelation(self, ranking)
Renders the valued relation characteristics compatible 
with the given linar ranking. Discordant charcateristics 
are set to the indeterminate value.
computeWeakCondorcetLosers(self)
Wrapper for weakCondorcetLosers().
computeWeakCondorcetWinners(self)
Wrapper for weakCondorcetWinners().
computeupdown1(self, s, S)
Help method for show_MIS_HB2 method.
fills self.newmisset, self.upmis, self.downmis.
computeupdown2(self, s, S)
Help method for show_MIS_HB1 method.
Fills self.newmisset, self.upmis, self.downmis.
computeupdown2irred(self, s, S)
Help method for show_MIS_HB1 method.
Fills self.newmisset, self.upmis, self.downmis.
condorcetLosers(self)
Renders the set of decision actions x such that
self.relation[x][y] < self.valuationdomain['med']
for all y != x.
condorcetWinners(self)
Renders the set of decision actions x such that
self.relation[x][y] > self.valuationdomain['med']
for all y != x.
contra(self, v)
Parameter: choice.
Renders the negation of a choice v characteristic's vector.
convertRelationToDecimal(self)
Converts the float valued self.relation in a decimal valued one.
convertValuation2Integer(self, InSite=True, Comments=False)
Converts the self.relation valuation to integer values by converting the Decimals to Fractions and multiply by the least commun multiple of the fraction denominators.
 
*Parameters*:
 
    - If *Insite* == False (True by default) the method returns a modified copy of self.relation without altering the original self.relation, otherwise self.relation and self.valuationdomain is modified.
convertValuationToDecimal(self)
Convert the float valuation limits to Decimals.
coveringIndex(self, choice, direction='out')
Renders the covering index of a given choice in a set of objects,
ie the minimum number of choice members that cover each
non selected object.
crispKDistance(self, digraph, Debug=False)
Renders the crisp Kendall distance between two bipolar valued
digraphs.
 
.. warning::
 
     Obsolete! Is replaced by the self.computeBipolarCorrelation(other, MedianCut=True) Digraph method
detectChordlessCircuits(self, Comments=False, Debug=False)
Detects a chordless circuit in a digraph.
Returns a Boolean
detectChordlessPath(self, Pk, n2, Comments=False, Debug=False)
New procedure from Agrum study April 2009
recursive chordless path extraction starting from path
Pk = [n2, ...., n1] and ending in node n2.
Optimized with marking of visited chordless P1s.
determinateness(self, vec, inPercent=True)
Renders the determinateness of a characteristic vector *vec* = 
[(r(x),x),(r(y),y), ...] of length *n* in valuationdomain [Min,Med,Max]:
 
*result* =  sum_x( abs(r(x)-Med) ) / ( n*(Max-Med) )
 
If inPercent, *result* shifted (+1) and reduced (/2) to [0,1] range.
digraph2Graph(self, valuationDomain={'min': -1, 'med': 0, 'max': 1}, Debug=False, ConjunctiveConversion=True)
Convert a Digraph instance to a Graph instance.
dneighbors(self, node)
Renders the set of dominated out-neighbors of a node.
domin(self, choice)
Renders the dominance degree of a choice.
dominantChoices(self, S)
Generates all minimal dominant choices of a bipolar valued digraph.
 
.. note::
 
     Initiate with S = self.actions.copy().
domirred(self, choice)
Renders the crips +irredundance degree of a choice.
domirredval(self, choice, relation)
Renders the valued +irredundance degree of a choice.
domirredx(self, choice, x)
Renders the crips +irredundance degree of node x in a choice.
domkernelrestrict(self, prekernel)
Parameter: dominant prekernel
Renders dominant prekernel restricted relation.
exportGraphViz(self, fileName=None, actionsSubset=None, bestChoice=set(), worstChoice=set(), firstChoice=set(), lastChoice=set(), Comments=True, graphType='png', pictureFormat=None, graphSize='7,7', relation=None, bgcolor='cornsilk')
export GraphViz dot file  for graph drawing filtering.
exportPrincipalImage(self, plotFileName=None, pictureFormat='pdf', bgcolor='cornsilk', fontcolor='red3', fontsize='0.75', Reduced=False, Colwise=False, tempDir='.', Comments=False)
Export as PDF (default) the principal projection of
the valued relation using the three principal eigen vectors.
 
Implemeted picture formats are: 
'pdf' (default), 'png', 'jpeg' and 'xfig'.
 
The background color is set by default to 'cornsilk'. 
 
Font size and color are set by default to 'red3', resp. '0.75'. 
 
When *Reduced==True*, the valued relation characeteristics are centered and reduced.
 
When *Colwise==True*, the column vectors of the adjacency table are used for the principal projection, otherwise the rows (default) are used. Has no incidence when the *Digraph* instance *self*  is symmetric. 
 
.. warning::
 
    The method, writing and reading temporary files: 
    tempCol.r and rotationCol.csv, resp. tempRow.r and rotationRow.csv,
    by default in the working directory (./),
    is hence not safe for multiprocessing programs, unless a
    temporary directory *tempDir* is provided.
flatChoice(self, ch, Debug=False)
Converts set or list ch recursively to a flat list of items.
forcedBestSingleChoice(self)
Renders the set of most determined outranking singletons in self.
gammaSets(self)
Renders the dictionary of neighborhoods {node: (dx,ax)}
with set *dx* gathering the dominated, and set *ax* gathering
the absorbed neighborhood.
generateAbsPreKernels(self)
Generate all absorbent prekernels from independent choices generator.
generateDomPreKernels(self)
Generate all dominant prekernels from independent choices generator.
htmlChoiceVector(self, ch, ChoiceVector=True, choiceType='good')
Show procedure for annotated bipolar choices.
inDegrees(self)
renders the median cut indegrees
inDegreesDistribution(self)
Renders the distribution of indegrees.
independentChoices(self, U)
Generator for all independent choices with neighborhoods of a bipolar valued digraph:
 
.. note::
 
       * Initiate with U = self.singletons().
       * Yields [(independent choice, domnb, absnb, indnb)].
inner_prod(self, v1, v2)
Parameters: two choice characteristic vectors
Renders the inner product of two characteristic vetors.
intstab(self, choice)
Computes the independence degree of a choice.
irreflex(self, mat)
Puts diagonal entries of mat to valuationdomain['min']
isAsymmetricIndeterminate(self, Debug=False)
Checks the self.relation for assymmetric indeterminateness!!
 
.. warning::
 
    The reflexive links are ignored !!
isComplete(self, Debug=False)
checks the completeness property of self.relation by checking
for the absence of a link between two actions!!
 
.. warning::
 
    The reflexive links are ignored !!
isCyclic(self, Debug=False)
checks the cyclicity of self.relation by checking
for a reflexive loop in its transitive closure-
 
.. warning::
 
     self.relation is supposed to be irreflexive !
isIntegerValued(self, Debug=False)
Checks whether the decimal valuation of self is integer-valued
be using the as_integer_ratio() method of a Decimal 
giving a tuple (numerator,denominator). If denominator == 1, the
number is an integer.
isOutrankingDigraph(self, Comments=True, Debug=False)
Checks the outranking digraph characteristic condition (3.3).
 
relation[x][y] + relation[y][x)[y] >= 0.0
 
.. warning::
 
    The reflexive links are ignored and the valuation must be bipolar !!
isStrictOutrankingDigraph(self, Comments=True, Debug=False)
Checks the strict outranking digraph characteristic condition (3.1).
 
-(relation[x][y] + relation[y][x]) <= 0.0 , x != y
 
.. warning::
 
    The reflexive links are ignored and the valuation must be bipolar !!
isSymmetric(self, Comments=False)
True if symmetry degree == 1.0.
isTransitive(self, Comments=False)
True if transitivity degree == 1.0.
isWeaklyComplete(self, Debug=False)
checks the weakly completeness property of self.relation by checking
for the absence of a link between two actions!!
 
.. warning::
 
    The reflexive links are ignored !!
iterateRankingByChoosing(self, Odd=False, CoDual=False, Comments=True, Debug=False, Limited=None)
Renders a ranking by choosing result when progressively eliminating
all chordless (odd only) circuits with rising valuation cut levels.
 
Parameters
    CoDual = False (default)/True
    Limited = proportion (in [0,1]) * (max - med) valuationdomain
kChoices(self, A, k)
Renders all choices of length k from set A
matmult2(self, m, v)
Parameters: digraph relation and choice characteristic vector
matrix multiply vector by inner production
meanDegree(self)
Renders the mean degree of self.
!!! self.size must be set previously !!!
meanLength(self, Oriented=False)
Renders the (by default non-oriented) mean neighbourhoor depth of self.
!!! self.order must be set previously !!!
minimalChoices(self, S)
Generates all dominant or absorbent choices of a bipolar
valued digraph.
 
.. note:
 
   * Initiate with S = (actions, dict of dominant or absorbent closed neighborhoods)
   * See showMinDom and showMinAbs methods.
minimalValuationLevelForCircuitsElimination(self, Odd=True, Debug=False, Comments=False)
renders the minimal valuation level <lambda> that eliminates all
self.circuitsList stored odd chordless circuits from self.
 
.. warning::
 
    The <lambda> level polarised may still contain newly appearing chordless odd circuits !
neighbourhoodCollection(self, Oriented=False, Potential=False)
Renders the neighbourhood.
neighbourhoodDepthDistribution(self, Oriented=False)
Renders the distribtion of neighbourhood depths.
notGammaSets(self)
Renders the dictionary of neighborhoods {node: (dx,ax)}
with set *dx* gathering the not dominated, and set *ax* gathering
the not absorbed neighborhood.
notaneighbors(self, node)
Renders the set of absorbed not in-neighbors of a node.
notdneighbors(self, node)
Renders the set of not dominated out-neighbors of a node.
outDegrees(self)
renders the median cut outdegrees
outDegreesDistribution(self)
Renders the distribution of outdegrees.
plusirredundant(self, U)
Generates all +irredundant choices of a digraph.
powerset(self, U)
Generates all subsets of a set.
readPerrinMisset(self, file='curd.dat')
read method for 0-1-char-coded MISs by default from the perrinMIS.c curd.dat result file.
readabsvector(self, x, relation)
Parameter: action x
absorbent in vector.
readdomvector(self, x, relation)
Parameter: action x
dominant out vector.
recodeValuation(self, newMin=-1.0, newMax=1.0, ndigits=4, Debug=False)
Recodes the characteristic valuation domain according
to the parameters given. 
 
*ndigits* indicates the number of decimal digits of the valuation.
relationFct(self, x, y)
wrapper for self.relation dictionary access to ensure interoperability
with the sparse and big outranking digraph implementation model.
save(self, fileName='tempdigraph', option=None, DecimalValuation=True, decDigits=2)
Persistent storage of a Digraph class instance in the form of
a python source code file
saveCSV(self, fileName='tempdigraph', Normalized=False, Dual=False, Converse=False, Diagonal=False, Debug=False)
Persistent storage of a Digraph class instance in the form of
a csv file.
saveXMCDA2(self, fileName='temp', fileExt='xmcda2', Comments=True, relationName='R', relationType='binary', category='random', subcategory='valued', author='digraphs Module (RB)', reference='saved from Python', valuationType='standard', digits=2, servingD3=False)
save digraph in XMCDA 2.0 format. Deprecated now.
savedre(self, fileName='temp')
save digraph in nauty format.
sharp(self, x, y)
Paramaters: choice characteristic values.
Renders the sharpest of two characteristic values x and y.
sharpvec(self, v, w)
Paramaters: choice characteristic vectors.
Renders the sharpest of two characteristic vectors v and w.
showActions(self)
presentation methods for digraphs actions
showAll(self)
Detailed show method for genuine digraphs.
showAttributes(self)
Prints out the attributes of self.
showAutomorphismGenerators(self)
Renders the generators of the automorphism group.
showBadChoices(self, Recompute=True)
Characteristic values for potentially bad choices.
showBestChoiceRecommendation(self, Verbose=False, Comments=True, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True)
Shows the RuBis best choice recommendation.
 
.. note::
 
    Computes by default the Rubis best choice recommendation on the corresponding strict (codual) outranking digraph.
 
    By default, with BrokenCocs=True, we brake all chordless circuits at their weakest determined ( abs(r(x>y)) + abs(r(y>x)) ) link.
 
    When BrokenCocs=False we proceed like follows:
 
    In case of chordless circuits, if supporting arcs are more credible
    than the reversed negating arcs, we collapse the circuits into hyper nodes.
    Inversely,  if supporting arcs are not more credible than the reversed negating arcs,
    we brake the circuits on their weakest arc.
 
Usage example:
 
>>> from outrankingDigraphs import *
>>> t = Random3ObjectivesPerformanceTableau(seed=5)
>>> g = BipolarOutrankingDigraph(t)
>>> g.showBestChoiceRecommendation()
***********************
RuBis Best Choice Recommendation (BCR)
(in decreasing order of determinateness)   
Credibility domain:  [-100.0, 100.0]
=== >> potential first choices
* choice              : ['a04', 'a14', 'a19', 'a20']
   independence        : 1.19
   dominance           : 4.76
   absorbency          : -59.52
   covering (%)        : 75.00
   determinateness (%) : 57.86
   - most credible action(s) = { 'a14': 23.81, 'a19': 11.90, 'a04': 2.38, 'a20': 1.19, }  
=== >> potential last choices 
* choice              : ['a03', 'a12', 'a17']
  independence        : 4.76
  dominance           : -76.19
  absorbency          : 4.76
  covering (%)        : 0.00
  determinateness (%) : 65.39
  - most credible action(s) = { 'a03': 38.10, 'a12': 13.10, 'a17': 4.76, }
Execution time: 0.024 seconds
*****************************
showChoiceVector(self, ch, choiceType='good', ChoiceVector=True)
Show procedure for annotated bipolar choices.
showChordlessCircuits(self, Recompute=False)
Show method for chordless circuits observed in a Digraph instance.
 
If previous computation is required, stores the detected circuits in self.circuitsList attribute.
showComponents(self)
Shows the list of connected components of the digraph instance.
showCorrelation(self, corr=None, ndigits=3)
Renders the valued ordinal correlation index, the crisp Kendall tau index and their epistemic determination degree.
showFirstChoiceRecommendation(self, Verbose=False, Comments=True, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True)
Shows the RuBis first choice recommendation.
 
.. note::
 
    Computes by default the Rubis first choice recommendation on the corresponding strict (codual) outranking digraph.
 
    By default, with BrokenCocs=True, we brake all chordless circuits at their weakest determined ( abs(r(x>y)) + abs(r(y>x)) ) link.
 
    When BrokenCocs=False we proceed like follows:
 
    In case of chordless circuits, if supporting arcs are more credible
    than the reversed negating arcs, we collapse the circuits into hyper nodes.
    Inversely,  if supporting arcs are not more credible than the reversed negating arcs,
    we brake the circuits on their weakest arc.
 
Usage example:
 
>>> from outrankingDigraphs import *
>>> t = Random3ObjectivesPerformanceTableau(seed=5)
>>> g = BipolarOutrankingDigraph(t)
>>> g.showFirstChoiceRecommendation()
***********************
RuBis First Choice Recommendation (BCR)
(in decreasing order of determinateness)   
Credibility domain:  [-100.0, 100.0]
=== >> potential first choices
* choice              : ['a04', 'a14', 'a19', 'a20']
   independence        : 1.19
   dominance           : 4.76
   absorbency          : -59.52
   covering (%)        : 75.00
   determinateness (%) : 57.86
   - most credible action(s) = { 'a14': 23.81, 'a19': 11.90, 'a04': 2.38, 'a20': 1.19, }  
=== >> potential last choices 
* choice              : ['a03', 'a12', 'a17']
  independence        : 4.76
  dominance           : -76.19
  absorbency          : 4.76
  covering (%)        : 0.00
  determinateness (%) : 65.39
  - most credible action(s) = { 'a03': 38.10, 'a12': 13.10, 'a17': 4.76, }
Execution time: 0.024 seconds
*****************************
showGoodChoices(self, Recompute=True)
Characteristic values for potentially good choices.
showHTMLBestChoiceRecommendation(self, pageTitle=None, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True, htmlFileName=None)
showHTMLRelationHeatmap(self, actionsList=None, rankingRule='NetFlows', colorLevels=7, tableTitle='Relation Heatmap', relationName='r(x S y)', ndigits=2, fromIndex=None, toIndex=None, htmlFileName=None)
Launches a browser window with the colored relation map of self.
 
See corresponding :py:class:`~digraphs.Digraph.showHTMLRelationMap` method.
 
The *colorLevels* parameter may be set to 3, 5, 7 (default) or 9.
 
When the *actionsList* parameter is *None* (default), the digraphs actions list may be ranked with the *rankingRule* parameter set to the 'Copeland' (default) or to the 'Netlows' ranking rule.
 
When the *htmlFileName* parameter is set to a string value 'xxx', a html file named 'xxx.html' will be generated in the current working directory. Otherwise, a temporary file named 'tmp*.html' will be generated there.
 
Example::
 
    >>> from outrankingDigraphs import *
    >>> t = RandomCBPerformanceTableau(numberOfActions=25,seed=1)
    >>> g = BipolarOutrankingDigraph(t,ndigits=2)
    >>> gcd = ~(-g)  # strict outranking relation
    >>> gcd.showHTMLRelationHeatmap(colorLevels=7,ndigits=2)
    
.. image:: relationHeatmap.png
   :alt: Browser view of a relation map
   :width: 600 px
   :align: center
showHTMLRelationMap(self, actionsList=None, rankingRule='Copeland', Colored=True, tableTitle='Relation Map', relationName='r(x S y)', symbols=['+', '&middot;', '&nbsp;', '&#150;', '&#151'], fromIndex=None, toIndex=None, htmlFileName=None)
Launches a browser window with the colored relation map of self.
See corresponding Digraph.showRelationMap() method.
 
When *htmlFileName* parameter is set to a string value, a html file
with that name will be stored in the current working directory.
 
By default, a temporary file named: tmp*.html will be generated
instead in the current working directory.
 
Example::
 
    >>> from outrankingDigraphs import *
    >>> t = RandomCBPerformanceTableau(numberOfActions=25,seed=1)
    >>> g = BipolarOutrankingDigraph(t,Normalized=True)
    >>> gcd = ~(-g)  # strict outranking relation
    >>> gcd.showHTMLRelationMap(rankingRule="NetFlows")
    
.. image:: relationMap.png
   :alt: Browser view of a relation map
   :width: 600 px
   :align: center
showHTMLRelationTable(self, actionsList=None, relation=None, IntegerValues=False, ndigits=2, Colored=True, tableTitle='Valued Adjacency Matrix', relationName='r(x S y)', ReflexiveTerms=False, htmlFileName=None, fromIndex=None, toIndex=None)
Launches a browser window with the colored relation table of self.
showMIS(self, withListing=True)
Prints all maximal independent choices:
    Result in self.misset.
showMIS_AH(self, withListing=True)
Prints all MIS using the Hertz method.
 
Result saved in self.hertzmisset.
showMIS_HB2(self, withListing=True)
Prints all MIS using the Hertz-Bisdorff method.
 
Result saved in self.newmisset.
showMIS_RB(self, withListing=True)
Prints all MIS using the Bisdorff method.
 
Result saved in self.newmisset.
showMIS_UD(self, withListing=True)
Prints all MIS using the Hertz-Bisdorff method.
 
Result saved in self.newmisset.
showMaxAbsIrred(self, withListing=True)
Computing maximal -irredundant choices:
    Result in self.absirset.
showMaxDomIrred(self, withListing=True)
Computing maximal +irredundant choices:
   Result in self.domirset.
showMinAbs(self, withListing=True)
Prints minimal absorbent choices:
    Result in self.absset.
showMinDom(self, withListing=True)
Prints all minimal dominant choices:
    Result in self.domset.
showNeighborhoods(self)
Lists the gamma and the notGamma function of self.
showOrbits(self, InChoices, withListing=True)
Prints the orbits of Choices along the automorphisms of
the Digraph instance.
 
Example Python session for computing the non isomorphic MISs from the 12-cycle graph:
 
>>> from digraphs import *
>>> c12 = CirculantDigraph(order=12,circulants=[1,-1])
>>> c12.automorphismGenerators()
...
  Permutations
  {'1': '1', '2': '12', '3': '11', '4': '10', '5': 
   '9', '6': '8', '7': '7', '8': '6', '9': '5', '10': 
   '4', '11': '3', '12': '2'}
  {'1': '2', '2': '1', '3': '12', '4': '11', '5': '10', 
   '6': '9', '7': '8', '8': '7', '9': '6', '10': '5', 
   '11': '4', '12': '3'}
  Reflections {}
>>> print('grpsize = ', c12.automorphismGroupSize)
  grpsize = 24
>>> c12.showMIS(withListing=False)
  *---  Maximal independent choices ---*
  number of solutions:  29
  cardinality distribution
  card.:  [0, 1, 2, 3, 4,  5,  6, 7, 8, 9, 10, 11, 12]
  freq.:  [0, 0, 0, 0, 3, 24,  2, 0, 0, 0,  0,  0,  0]
  Results in c12.misset
>>> c12.showOrbits(c12.misset,withListing=False)
...
  *---- Global result ----
  Number of MIS:  29
  Number of orbits :  4
  Labelled representatives:
  1: ['2','4','6','8','10','12']
  2: ['2','5','8','11']
  3: ['2','4','6','9','11']
  4: ['1','4','7','9','11']
  Symmetry vector
  stabilizer size: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, ...]
  frequency      : [0, 2, 0, 0, 0, 0, 0, 1, 0,  0,  0,  1, ...]
 
*Figure*: The symmetry axes of the non isomorphic MISs of the 12-cycle:
 
.. image:: c12.png
   :width: 400 px
   :align: center
   :alt: The 4 non isomorphic MIS of the 12-cycle graph
 
*Reference*: R. Bisdorff and J.L. Marichal (2008). Counting non-isomorphic maximal independent sets of the n-cycle graph. *Journal of Integer Sequences*, Vol. 11 Article 08.5.7 (`openly accessible here <https://www.cs.uwaterloo.ca/journals/JIS/VOL11/Marichal/marichal.html>`_)
showOrbitsFromFile(self, InFile, withListing=True)
Prints the orbits of Choices along the automorphisms of
the digraph self by reading in the 0-1 misset file format.
See the :py:func:`digraphs.Digraph.readPerrinMisset` method.
showPreKernels(self, withListing=True)
Printing dominant and absorbent preKernels:
    Result in self.dompreKernels and self.abspreKernels
showRankingByBestChoosing(self, rankingByBestChoosing=None)
A show method for self.rankinByBestChoosing result.
 
.. warning::
 
     The self.computeRankingByBestChoosing(CoDual=False/True) method instantiating the self.rankingByBestChoosing slot is pre-required !
showRankingByChoosing(self, rankingByChoosing=None, WithCoverCredibility=False)
A show method for self.rankinByChoosing result.
 
When parameter *WithCoverCredibility* is set to True, the credibility of outranking, respectively being outranked is indicated at each selection step. 
 
.. warning::
 
     The self.computeRankingByChoosing(CoDual=False/True) method instantiating the self.rankingByChoosing slot is pre-required !
showRankingByLastChoosing(self, rankingByLastChoosing=None, Debug=None)
A show method for self.rankinByChoosing result.
 
.. warning::
 
     The self.computeRankingByLastChoosing(CoDual=False/True) method instantiating the self.rankingByChoosing slot is pre-required !
showRelation(self)
prints the relation valuation in ##.## format.
showRelationMap(self, symbols=None, rankingRule='Copeland', fromIndex=None, toIndex=None, actionsList=None)
Prints on the console, in text map format, the location of
certainly validated and certainly invalidated outranking situations.
 
By default, symbols = {'max':'┬','positive': '+', 'median': ' ',
                       'negative': '-', 'min': '┴'}
 
The default ordering of the output is following the Copeland ranking rule
from best to worst actions. Further available ranking rule is the 'NetFlows' net flows rule.
 
 
Example::
 
    >>> from outrankingDigraphs import *
    >>> t = RandomCBPerformanceTableau(numberOfActions=25,seed=1)
    >>> g = BipolarOutrankingDigraph(t,Normalized=True)
    >>> gcd = ~(-g)  # strict outranking relation
    >>> gcd.showRelationMap(rankingRule="NetFlows")
     -   ++++++++  +++++┬+┬┬+
    - -   + +++++ ++┬+┬+++┬++
    ┴+  ┴ + ++  ++++┬+┬┬++┬++
    -   ++ - ++++-++++++┬++┬+
       - - - ++- ┬- + -+┬+-┬┬
    -----  -      -┬┬┬-+  -┬┬
    ----    --+-+++++++++++++
    -- --+- --++ ++ +++-┬+-┬┬
    ----  -  -+-- ++--+++++ +
    ----- ++- --- +---++++┬ +
    -- -- ---+ -++-+++-+ +-++
    -- --┴---+  + +-++-+ -  +
    ---- ┴---+-- ++--++++ - +
      --┴┴--  --- -  --+ --┬┬
     ---------+--+ ----- +-┬┬
    -┴---┴- ---+- + ---+++┬ +
    -┴┴--┴---+--- ++ -++--+++
    -----┴--- ---+-+- ++---+ 
    -┴┴--------------- --++┬ 
    --┴---------------- --+┬ 
    ┴--┴┴ -┴--┴┴-┴ --++  ++-+
    ----┴┴--------------- -  
    ┴┴┴----+-┴+┴---┴-+---+ ┴+
    ┴┴-┴┴┴-┴- - -┴┴---┴┴+ ┬ -
    ----┴┴-┴-----┴┴---  - -- 
    Ranking rule: NetFlows
    >>>
showRelationTable(self, Sorted=True, rankingRule=None, IntegerValues=False, actionsSubset=None, relation=None, ndigits=2, ReflexiveTerms=True, fromIndex=None, toIndex=None)
Prints the relation valuation in actions X actions table format.
Copeland and NetFlows rankings my be used.
showRubisBestChoiceRecommendation(self, **kwargs)
Dummy for backward portable showBestChoiceRecommendation().
showRubyChoice(self, Verbose=False, Comments=True, _OldCoca=True)
Dummy for showBestChoiceRecommendation()
needed for older versions compatibility.
showShort(self)
concise presentation method for genuine digraphs.
showSingletonRanking(self, Comments=True, Debug=False)
Calls self.computeSingletonRanking(comments=True,Debug = False).
Renders and prints the sorted bipolar net determinatation of outrankingness
minus outrankedness credibilities of all singleton choices.
 
res = ((netdet,sigleton,dom,absorb)+)
showStatistics(self)
Computes digraph statistics like order, size and arc-density.
showdre(self)
Shows relation in nauty format.
singletons(self)
list of singletons and neighborhoods
[(singx1, +nx1, -nx1, not(+nx1 or -nx1)),.... ]
sizeSubGraph(self, choice)
Output: (size, undeterm,arcDensity).
Renders the arc density of the induced subgraph.
strongComponents(self, setPotential=False)
Renders the set of strong components of self.
symDegreesDistribution(self)
Renders the distribution of symmetric degrees.
topologicalSort(self, Debug=False)
If self is acyclic, adds topological sort number to each node of self
and renders ordered list of nodes. Otherwise renders None.
Source: M. Golumbic Algorithmic Graph heory and Perfect Graphs,
Annals Of Discrete Mathematics 57 2nd Ed. , Elsevier 2004, Algorithm 2.4 p.44.
weakAneighbors(self, node)
Renders the set of absorbed in-neighbors of a node.
weakCondorcetLosers(self)
Renders the set of decision actions x such that
self.relation[x][y] <= self.valuationdomain['med']
for all y != x.
weakCondorcetWinners(self)
Renders the set of decision actions x such that
self.relation[x][y] >= self.valuationdomain['med']
for all y != x.
weakDneighbors(self, node)
Renders the set of dominated out-neighbors of a node.
weakGammaSets(self)
Renders the dictionary of neighborhoods {node: (dx,ax)}
zoomValuation(self, zoomFactor=1.0)
Zooms in or out, depending on the value of the zoomFactor provided,
the bipolar valuation of a digraph.

Data descriptors inherited from Digraph:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class kChoicesDigraph(Digraph)
    kChoicesDigraph(digraph=None, k=3)
 
Specialization of general Digraph class for instantiation
a digraph of all k-choices collapsed actions.
 
Parameters:
    | digraph := Stored or memory resident digraph instance
    | k := cardinality of the choices
 
 
Method resolution order:
kChoicesDigraph
Digraph
builtins.object

Methods defined here:
__init__(self, digraph=None, k=3)
Initialize self.  See help(type(self)) for accurate signature.

Methods inherited from Digraph:
MISgen(self, S, I)
generator of maximal independent choices (voir Byskov 2004):
    * S ::= remaining nodes;
    * I ::= current independent choice
 
.. note::
 
        Inititalize: self.MISgen(self.actions.copy(),set())
__invert__(self)
Make the inverting operator ~self available for Digraph instances. 
 
Returns a ConverseDigraph instance of self.
__neg__(self)
Make the negation operator -self available for Digraph instances. 
 
Returns a DualDigraph instance of self.
__repr__(self)
Default presentation method for Digraph instances.
absirred(self, choice)
Renders the crips -irredundance degree of a choice.
absirredundant(self, U)
Generates all -irredundant choices of a digraph.
absirredval(self, choice, relation)
Renders the valued -irredundance degree of a choice.
absirredx(self, choice, x)
Computes the crips -irredundance degree of node x in a choice.
abskernelrestrict(self, prekernel)
Parameter: prekernel
Renders absorbent prekernel restricted relation.
absorb(self, choice)
Renders the absorbency degree of a choice.
absorbentChoices(self, S)
Generates all minimal absorbent choices of a bipolar valued digraph.
addValuationAttribute(self)
Adds the numpy valuation attribute
agglomerationDistribution(self)
Output: aggloCoeffDistribution, meanCoeff
Renders the distribution of agglomeration coefficients.
aneighbors(self, node)
Renders the set of absorbed in-neighbors of a node.
automorphismGenerators(self)
Adds automorphism group generators to the digraph instance.
 
.. note::
 
    Dependency: Uses the dreadnaut command from the nauty software package. See https://www3.cs.stonybrook.edu/~algorith/implement/nauty/implement.shtml
 
    On Ubuntu Linux:
      ...$ sudo apt-get install nauty
averageCoveringIndex(self, choice, direction='out')
Renders the average covering index of a given choice in a set of objects,
ie the average number of choice members that cover each
non selected object.
bipolarKCorrelation(self, digraph, Debug=False)
Renders the bipolar Kendall correlation between two bipolar valued
digraphs computed from the average valuation of the
XORDigraph(self,digraph) instance.
 
.. warning::
 
     Obsolete! Is replaced by the self.computeBipolarCorrelation(other) Digraph method
bipolarKDistance(self, digraph, Debug=False)
Renders the bipolar crisp Kendall distance between two bipolar valued
digraphs.
 
.. warning::
 
     Obsolete! Is replaced by the self.computeBipolarCorrelation(other, MedianCut=True) Digraph method
chordlessPaths(self, Pk, n2, Odd=False, Comments=False, Debug=False)
New procedure from Agrum study April 2009
recursive chordless path extraction starting from path
Pk = [n2, ...., n1] and ending in node n2.
Optimized with marking of visited chordless P1s.
circuitAverageCredibility(self, circ)
Renders the average linking credibility of a Chordless Circuit.
circuitCredibilities(self, circuit, Debug=False)
Renders the average linking credibilities and the minimal link of a Chordless Circuit.
circuitMaxCredibility(self, circ)
Renders the maximal linking credibility of a Chordless Circuit.
circuitMinCredibility(self, circ)
Renders the minimal linking credibility of a Chordless Circuit.
closeSymmetric(self, InSite=True)
Produces the symmetric closure of self.relation.
closeTransitive(self, Reverse=False, InSite=True, Comments=False)
Produces the transitive closure of self.relation
 
*Parameters*:
 
    - If *Reverse* == True (False default) all transitive links are dropped, otherwise all transitive links are closed with min[r(x,y),r(y,z)];
    - If *Insite* == False (True by default) the methods return a modified copy of self.relation without altering the original self.relation, otherwise self.relation is modified.
components(self)
Renders the list of connected components.
computeAllDensities(self, choice=None)
parameter: choice in self
renders six densitiy parameters:
arc density, double arc density,
single arc density, strict single arc density,
absence arc density, strict absence arc densitiy.
computeArrowRaynaudOrder(self)
Renders a linear ordering from worst to best of the actions following Arrow&Raynaud's rule.
computeArrowRaynaudRanking(self)
renders a linear ranking from best to worst of the actions following Arrow&Raynaud's rule.
computeAverageValuation(self)
Computes the bipolar average correlation between
self and the crisp complete digraph of same order
of the irreflexive and determined arcs of the digraph
computeBadChoices(self, Comments=False)
Computes characteristic values for potentially bad choices.
 
.. note::
 
     Returns a tuple with following content:
 
     [(0)-determ,(1)degirred,(2)degi,(3)degd,(4)dega,(5)str(choice),(6)absvec]
computeBadPirlotChoices(self, Comments=False)
Characteristic values for potentially bad choices
using the Pirlot's fixpoint algorithm.
computeBestChoiceRecommendation(self, Verbose=False, Comments=False, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True)
Sets self.bestChoice, self.bestChoiceData, self.worstChoice and self.worstChoiceData
with the showBestChoiceRecommendation method.
 
First and last choices data is the following:
[(0)-determ,(1)degirred,(2)degi,(3)degd,(4)dega,(5)str(choice),(6)domvec,(7)cover]
 
self.bestChoice = self.bestChoiceData[5]
self.worstChoice = self.worstChoiceData[5]
computeBipolarCorrelation(self, other, MedianCut=False, filterRelation=None, Debug=False)
obsolete: dummy replacement for Digraph.computeOrdinalCorrelation method
computeChordlessCircuits(self, Odd=False, Comments=False, Debug=False)
Renders the set of all chordless circuits detected in a digraph.
Result is stored in <self.circuitsList>
holding a possibly empty list of tuples with at position 0 the
list of adjacent actions of the circuit and at position 1
the set of actions in the stored circuit.
 
When *Odd* is True, only chordless circuits with an odd length
are collected.
computeChordlessCircuitsMP(self, Odd=False, Threading=False, nbrOfCPUs=None, startMethod=None, Comments=False, Debug=False)
Multiprocessing version of computeChordlessCircuits().
 
Renders the set of all chordless odd circuits detected in a digraph.
Result (possible empty list) stored in <self.circuitsList>
holding a possibly empty list tuples with at position 0 the
list of adjacent actions of the circuit and at position 1
the set of actions in the stored circuit.
Inspired by Dias, Castonguay, Longo, Jradi, Algorithmica (2015).
 
Returns a possibly empty list of tuples (circuit,frozenset(circuit)).
 
If Odd == True, only circuits of odd length are retained in the result.
computeCoSize(self)
Renders the number of non validated non reflexive arcs
computeConcentrationIndex(self, X, N)
Renders the Gini concentration index of the X serie.
N contains the partial frequencies.
Based on the triangle summation formula.
computeConcentrationIndexTrapez(self, X, N)
Renders the Gini concentration index of the X serie.
N contains the partial frequencies.
Based on the triangles summation formula.
computeCondorcetLosers(self)
Wrapper for condorcetLosers().
computeCondorcetWinners(self)
Wrapper for condorcetWinners().
computeCopelandOrder(self)
renders a linear ordering from worst to best of the actions following Arrow&Raynaud's rule.
computeCopelandRanking(self)
renders a linear ranking from best to worst of the actions following Arrow&Raynaud's rule.
computeCutLevelDensities(self, choice, level)
parameter: choice in self, robustness level
renders three robust densitiy parameters:
robust double arc density,
robust single arc density,
robust absence arc densitiy.
computeDensities(self, choice)
parameter: choice in self
renders the four densitiy parameters:
arc density, double arc density, single arc density, absence arc density.
computeDeterminateness(self, InPercents=False)
Computes the Kendalll distance of self
with the all median-valued indeterminate digraph of order n.
 
Return the average determination of the irreflexive part of the digraph.
 
*determination* = sum_(x,y) { abs[ r(xRy) - Med ] } / n(n-1)
 
If *InPercents* is True, returns the average determination in percentage of
(Max - Med) difference.
 
>>> from outrankingDigraphs import BipolarOutrankingDigraph
>>> from randomPerfTabs import Random3ObjectivesPerformanceTableau
>>> t = Random3ObjectivesPerformanceTableau(numberOfActions=7,numberOfCriteria=7,seed=101)
>>> g = BipolarOutrankingDigraph(t,Normalized=True)
>>> g
*------- Object instance description ------*
Instance class      : BipolarOutrankingDigraph
Instance name       : rel_random3ObjectivesPerfTab
Actions             : 7
Criteria            : 7
Size                : 27
Determinateness (%) : 65.67
Valuation domain    : [-1.00;1.00]
>>> print(g.computeDeterminateness())
0.3134920634920634920634920638
>>> print(g.computeDeterminateness(InPercents=True))
65.67460317460317460317460320
>>> g.recodeValuation(0,1)
>>> g
*------- Object instance description ------*
Instance class      : BipolarOutrankingDigraph
Instance name       : rel_random3ObjectivesPerfTab
Actions             : 7
Criteria            : 7
Size                : 27
Determinateness (%) : 65.67
Valuation domain    : [0.00;1.00]
>>> print(g.computeDeterminateness())
0.1567460317460317460317460318
>>> print(g.computeDeterminateness(InPercents=True))
65.67460317460317460317460320
computeDiameter(self, Oriented=True)
Renders the (by default oriented) diameter of the digraph instance
computeDigraphCentres(self, WeakDistances=False, Comments=False)
The centers of a digraph are the nodes with finite minimal shortes path lengths.
 
The maximal neighborhood distances are stored in *self.maximalNeighborhoodDistances*.
 
The corresponding digraph radius and diameter are stored respectively  in *self.radius* and *self.diameter*.
 
With *Comments* = True, all these results are printed out.
 
*Source*: Claude Berge, *The Theory of Graphs*, Dover (2001) pp. 119, original in French Dunod (1958)
computeDynamicProgrammingStages(self, source, sink, Debug=False)
Renders the discrete stages of the optimal substructure for
dynamic pogramming digrahs from a given source node 
to a given sink sink node.
 
Returns a list of list of action identifyers.
computeGoodChoiceVector(self, ker, Comments=False)
| Computing Characteristic values for dominant pre-kernels
| using the von Neumann dual fixoint equation
computeGoodChoices(self, Comments=False)
Computes characteristic values for potentially good choices.
 
..note::
 
     Return a tuple with following content:
 
     [(0)-determ,(1)degirred,(2)degi,(3)degd,(4)dega,(5)str(choice),(6)domvec,(7)cover]
computeGoodPirlotChoices(self, Comments=False)
Characteristic values for potentially good choices
using the Pirlot fixpoint algorithm.
computeIncomparabilityDegree(self, InPercents=False, Comments=False)
Renders the incomparability degree (Decimal), i.e. the relative number of symmetric indeterminate relations of the irreflexive part of a digraph.
computeKemenyIndex(self, otherRelation)
renders the Kemeny index of the self.relation
compared with a given crisp valued relation of a compatible
other digraph (same nodes or actions).
computeKemenyOrder(self, orderLimit=7, Debug=False)
Renders a ordering from worst to best of the actions with maximal Kemeny index.
Return a tuple: kemenyOrder (from worst to best), kemenyIndex
computeKemenyRanking(self, orderLimit=7, seed=None, sampleSize=1000, Debug=False)
Renders a ranking from best to worst of the actions with maximal Kemeny index.
 
.. note::
 
     Returns a tuple: kemenyRanking (from best to worst), kemenyIndex.
computeKernelVector(self, kernel, Initial=True, Comments=False)
| Computing Characteristic values for dominant pre-kernels
| using the von Neumann dual fixpoint equation
computeKohlerOrder(self)
Renders an ordering (worst to best) of the actions following Kohler's rule.
computeKohlerRanking(self)
Renders a ranking (best to worst) of the actions following Kohler's rule.
computeMaxHoleSize(self, Comments=False)
Renders the length of the largest chordless cycle
in the corresponding disjunctive undirected graph.
computeMeanInDegree(self)
Renders the mean indegree of self.
!!! self.size must be set previously !!!
computeMeanOutDegree(self)
Renders the mean degree of self.
!!! self.size must be set previously !!!
computeMeanSymDegree(self)
Renders the mean degree of self.
!!! self.size must be set previously !!!
computeMedianOutDegree(self)
Renders the median outdegree of self.
!!! self.size must be set previously !!!
computeMedianSymDegree(self)
Renders the median symmetric degree of self.
!!! self.size must be set previously !!!
computeMoreOrLessUnrelatedPairs(self)
Renders a list of more or less unrelated pairs.
computeNetFlowsOrder(self)
Renders an ordered list (from best to worst) of the actions
following the net flows ranking rule.
computeNetFlowsOrderDict(self)
Renders an ordered list (from worst to best) of the actions
following the net flows ranking rule.
computeNetFlowsRanking(self)
Renders an ordered list (from best to worst) of the actions
following the net flows ranking rule.
computeNetFlowsRankingDict(self)
Renders an ordered list (from best to worst) of the actions
following the net flows ranking rule.
computeODistance(self, op2, comments=False)
renders the squared normalized distance of
two digraph valuations.
 
.. note::
 
     op2 = digraphs of same order as self.
computeOrbit(self, choice, withListing=False)
renders the set of isomorph copies of a choice following
the automorphism of the digraph self
computeOrderCorrelation(self, order, Debug=False)
Renders the ordinal correlation K of a digraph instance
when compared with a given linear order (from worst to best) of its actions
 
K = sum_{x != y} [ min( max(-self.relation(x,y)),other.relation(x,y), max(self.relation(x,y),-other.relation(x,y)) ]
 
K /= sum_{x!=y} [ min(abs(self.relation(x,y),abs(other.relation(x,y)) ]
 
.. note::
 
     Renders a dictionary with the key 'correlation' containing the actual bipolar correlation index and the key 'determination' containing the minimal determination level D of self and the other relation.
 
     D = sum_{x != y} min(abs(self.relation(x,y)),abs(other.relation(x,y)) / n(n-1)
 
     where n is the number of actions considered.
 
     The correlation index with a completely indeterminate relation
     is by convention 0.0 at determination level 0.0 .
 
.. warning::
 
     self must be a normalized outranking digraph instance !
computeOrdinalCorrelation(self, other, MedianCut=False, filterRelation=None, Debug=False)
Renders the bipolar correlation K of a
self.relation when compared
with a given compatible (same actions set)) digraph or
a [-1,1] valued compatible relation (same actions set).
 
If MedianCut=True, the correlation is computed on the median polarized relations.
 
If filterRelation is not None, the correlation is computed on the partial domain corresponding to the determined part of the filter relation.
 
.. warning::
 
     Notice that the 'other' relation and/or the 'filterRelation',
     the case given, must both be normalized, ie [-1,1]-valued !
 
K = sum_{x != y} [ min( max(-self.relation[x][y]),other.relation[x][y]), max(self.relation[x][y],-other.relation[x][y]) ]
 
K /= sum_{x!=y} [ min(abs(self.relation[x][y]),abs(other.relation[x][y])) ]
 
.. note::
 
     Renders a tuple with at position 0 the actual bipolar correlation index
     and in position 1 the minimal determination level D of self and
     the other relation.
 
     D = sum_{x != y} min(abs(self.relation[x][y]),abs(other.relation[x][y])) / n(n-1)
 
     where n is the number of actions considered.
 
     The correlation index with a completely indeterminate relation
     is by convention 0.0 at determination level 0.0 .
computeOrdinalCorrelationMP(self, other, MedianCut=False, Threading=False, nbrOfCPUs=None, startMethod=None, Comments=False, Debug=False)
Multi processing version of the digraphs.computeOrdinalCorrelation() method.
 
.. note::
     The relation filtering and the MedinaCut option are not implemented in the MP version.
computePairwiseClusterComparison(self, K1, K2, Debug=False)
Computes the pairwise cluster comparison credibility vector
from bipolar-valued digraph g. with K1 and K2 disjoint
lists of action keys from g actions disctionary.
Returns the dictionary
{'I': Decimal(),'P+':Decimal(),'P-':Decimal(),'R' :Decimal()}
where one and only one item is strictly positive.
computePreKernels(self)
computing dominant and absorbent preKernels:
    Result in self.dompreKernels and self.abspreKernels
computePreRankingRelation(self, preRanking, Normalized=True, Debug=False)
Renders the bipolar-valued relation obtained from
a given preRanking in decreasing levels (list of lists) result.
computePreorderRelation(self, preorder, Normalized=True, Debug=False)
Renders the bipolar-valued relation obtained from
a given preordering in increasing levels (list of lists) result.
computePrincipalOrder(self, Colwise=False, Comments=False)
Rendesr an ordering from wrost to best of the decision actions.
computePrincipalRanking(self, Colwise=False, Comments=False)
Rendesr a ranking from best to worst of the decision actions.
computePrincipalScores(self, plotFileName=None, Colwise=False, imageType=None, tempDir=None, bgcolor='cornsilk', Comments=False, Debug=False)
Renders a ordered list of the first principal eigenvector of the covariance of the valued outdegrees of self.
 
.. note::
 
   The method, relying on writing and reading temporary files by default in a temporary directory is threading and multiprocessing safe !
   (see Digraph.exportPrincipalImage method)
computePrudentBetaLevel(self, Debug=False)
computes alpha, ie the lowest valuation level, for which the
bipolarly polarised digraph doesn't contain a chordless circuit.
computeRankingByBestChoosing(self, CoDual=False, Debug=False)
Computes a weak preordering of the self.actions by recursive
best choice elagations.
 
Stores in self.rankingByBestChoosing['result'] a list of (P+,bestChoice) tuples
where P+ gives the best choice complement outranking
average valuation via the computePairwiseClusterComparison
method.
 
If self.rankingByBestChoosing['CoDual'] is True, 
the ranking-by-choosing was computed on the codual of self.
computeRankingByBestChoosingRelation(self, rankingByBestChoosing=None, Debug=False)
Renders the bipolar-valued relation obtained from
the self.rankingByBestChoosing result.
computeRankingByChoosing(self, actionsSubset=None, Debug=False, CoDual=False)
Computes a weak preordring of the self.actions by iterating
jointly first and last choice elagations.
 
Stores in self.rankingByChoosing['result'] a list of ((P+,bestChoice),(P-,worstChoice)) pairs
where P+ (resp. P-) gives the best (resp. worst) choice complement outranking
(resp. outranked) average valuation via the computePairwiseClusterComparison
method.
 
If self.rankingByChoosing['CoDual'] is True, the ranking-by-choosing was computed on the codual of self.
computeRankingByChoosingRelation(self, rankingByChoosing=None, actionsSubset=None, Debug=False)
Renders the bipolar-valued relation obtained from
the self.rankingByChoosing result.
computeRankingByLastChoosing(self, CoDual=False, Debug=False)
Computes a weak preordring of the self.actions by iterating
worst choice elagations.
 
Stores in self.rankingByLastChoosing['result'] a list of (P-,worstChoice) pairs
where P- gives the worst choice complement outranked
average valuation via the computePairwiseClusterComparison
method.
 
If self.rankingByChoosing['CoDual'] is True, the ranking-by-last-chossing 
was computed on the codual of self.
computeRankingByLastChoosingRelation(self, rankingByLastChoosing=None, Debug=False)
Renders the bipolar-valued relation obtained from
the self.rankingByLastChoosing result.
computeRankingCorrelation(self, ranking, Debug=False)
Renders the ordinal correlation K of a digraph instance
when compared with a given linear ranking of its actions
 
K = sum_{x != y} [ min( max(-self.relation(x,y)),other.relation(x,y), max(self.relation(x,y),-other.relation(x,y)) ]
 
K /= sum_{x!=y} [ min(abs(self.relation(x,y),abs(other.relation(x,y)) ]
 
.. note::
 
     Renders a tuple with at position 0 the actual bipolar correlation index
     and in position 1 the minimal determination level D of self and
     the other relation.
 
     D = sum_{x != y} min(abs(self.relation(x,y)),abs(other.relation(x,y)) / n(n-1)
 
     where n is the number of actions considered.
 
     The correlation index with a completely indeterminate relation
     is by convention 0.0 at determination level 0.0 .
computeRelationalStructure(self, Debug=False)
Renders the counted decomposition of the valued relations into
the following type of links:
gt '>', eq '=', lt '<', incomp '<>',
leq '<=', geq '>=', indeterm '?'
computeRubisChoice(self, Comments=False, _OldCoca=False, BrokenCocs=True, Threading=False, nbrOfCPUs=1)
Renders self.strictGoodChoices, self.nullChoices
self.strictBadChoices, self.nonRobustChoices.
 
.. warning::
    Changes in site the outranking digraph by
    adding or braking chordless odd outranking circuits.
computeRubyChoice(self, Comments=False, _OldCoca=False)
dummy for computeRubisChoice()
old versions compatibility.
computeShortestPathLengths(self, WeakPaths=False, Comments=False, Debug=False)
Renders a double dictionary with the directed distances, i.e. the shortest path lengths between all self.actions
 
Equals *None* if there does not exist a directed path between two actions.
 
*Source*: Claude Berge, *The Theory of Graphs*, Dover (2001) pp. 119, original in French Dunod (1958)
computeSingletonRanking(self, Comments=False, Debug=False)
Renders the sorted bipolar net determinatation of outrankingness
minus outrankedness credibilities of all singleton choices.
 
res = ((netdet,singleton,dom,absorb)+)
computeSize(self)
Renders the number of validated non reflexive arcs
computeSizeTransitiveClosure(self)
Renders the size of the transitive closure of a digraph.
computeSlaterOrder(self, isProbabilistic=False, seed=None, sampleSize=1000, Debug=False)
Reversed return from computeSlaterRanking method.
computeSlaterRanking(self, isProbabilistic=False, seed=None, sampleSize=1000, Debug=False)
Renders a ranking of the actions with minimal Slater index.
Return a tuple: slaterOrder, slaterIndex
computeSymmetryDegree(self, InPercents=False, Comments=False)
Renders the symmetry degree (Decimal) of the irreflexive part of a digraph.
 
.. note::
 
   Empty and indeterminate digraphs are considered to be symmetric.
computeTopologicalRanking(self, Debug=False)
Mimetic Wrapper of the topologicalSort() method.
computeTransitivityDegree(self, InPercents=False, Comments=False)
Renders the transitivity degree (Decimal) of a digraph.
 
.. note:: 
 
   An empty or indeterminate digraph is considered to be transitive.
computeUnrelatedPairs(self)
Renders a list of more or less unrelated pairs.
computeValuationLevels(self, choice=None, Debug=False)
renders the symmetric closure of the
apparent valuations levels of self
in an increasingly ordered list.
If parameter choice is given, the
computation is limited to the actions
of the choice.
computeValuationPercentages(self, choice, percentiles, withValues=False)
Parameters: choice and list of percentiles.
renders a series of percentages of the characteristics valuation of
the arcs in the digraph.
computeValuationPercentiles(self, choice, percentages, withValues=False)
Parameters: choice and list of percentages.
renders a series of quantiles of the characteristics valuation of
the arcs in the digraph.
computeValuationStatistics(self, Sampling=False, Comments=False)
Renders the mean and variance of the valuation
of the non reflexive pairs.
computeValuedRankingRelation(self, ranking)
Renders the valued relation characteristics compatible 
with the given linar ranking. Discordant charcateristics 
are set to the indeterminate value.
computeWeakCondorcetLosers(self)
Wrapper for weakCondorcetLosers().
computeWeakCondorcetWinners(self)
Wrapper for weakCondorcetWinners().
computeupdown1(self, s, S)
Help method for show_MIS_HB2 method.
fills self.newmisset, self.upmis, self.downmis.
computeupdown2(self, s, S)
Help method for show_MIS_HB1 method.
Fills self.newmisset, self.upmis, self.downmis.
computeupdown2irred(self, s, S)
Help method for show_MIS_HB1 method.
Fills self.newmisset, self.upmis, self.downmis.
condorcetLosers(self)
Renders the set of decision actions x such that
self.relation[x][y] < self.valuationdomain['med']
for all y != x.
condorcetWinners(self)
Renders the set of decision actions x such that
self.relation[x][y] > self.valuationdomain['med']
for all y != x.
contra(self, v)
Parameter: choice.
Renders the negation of a choice v characteristic's vector.
convertRelationToDecimal(self)
Converts the float valued self.relation in a decimal valued one.
convertValuation2Integer(self, InSite=True, Comments=False)
Converts the self.relation valuation to integer values by converting the Decimals to Fractions and multiply by the least commun multiple of the fraction denominators.
 
*Parameters*:
 
    - If *Insite* == False (True by default) the method returns a modified copy of self.relation without altering the original self.relation, otherwise self.relation and self.valuationdomain is modified.
convertValuationToDecimal(self)
Convert the float valuation limits to Decimals.
coveringIndex(self, choice, direction='out')
Renders the covering index of a given choice in a set of objects,
ie the minimum number of choice members that cover each
non selected object.
crispKDistance(self, digraph, Debug=False)
Renders the crisp Kendall distance between two bipolar valued
digraphs.
 
.. warning::
 
     Obsolete! Is replaced by the self.computeBipolarCorrelation(other, MedianCut=True) Digraph method
detectChordlessCircuits(self, Comments=False, Debug=False)
Detects a chordless circuit in a digraph.
Returns a Boolean
detectChordlessPath(self, Pk, n2, Comments=False, Debug=False)
New procedure from Agrum study April 2009
recursive chordless path extraction starting from path
Pk = [n2, ...., n1] and ending in node n2.
Optimized with marking of visited chordless P1s.
determinateness(self, vec, inPercent=True)
Renders the determinateness of a characteristic vector *vec* = 
[(r(x),x),(r(y),y), ...] of length *n* in valuationdomain [Min,Med,Max]:
 
*result* =  sum_x( abs(r(x)-Med) ) / ( n*(Max-Med) )
 
If inPercent, *result* shifted (+1) and reduced (/2) to [0,1] range.
digraph2Graph(self, valuationDomain={'min': -1, 'med': 0, 'max': 1}, Debug=False, ConjunctiveConversion=True)
Convert a Digraph instance to a Graph instance.
dneighbors(self, node)
Renders the set of dominated out-neighbors of a node.
domin(self, choice)
Renders the dominance degree of a choice.
dominantChoices(self, S)
Generates all minimal dominant choices of a bipolar valued digraph.
 
.. note::
 
     Initiate with S = self.actions.copy().
domirred(self, choice)
Renders the crips +irredundance degree of a choice.
domirredval(self, choice, relation)
Renders the valued +irredundance degree of a choice.
domirredx(self, choice, x)
Renders the crips +irredundance degree of node x in a choice.
domkernelrestrict(self, prekernel)
Parameter: dominant prekernel
Renders dominant prekernel restricted relation.
exportGraphViz(self, fileName=None, actionsSubset=None, bestChoice=set(), worstChoice=set(), firstChoice=set(), lastChoice=set(), Comments=True, graphType='png', pictureFormat=None, graphSize='7,7', relation=None, bgcolor='cornsilk')
export GraphViz dot file  for graph drawing filtering.
exportPrincipalImage(self, plotFileName=None, pictureFormat='pdf', bgcolor='cornsilk', fontcolor='red3', fontsize='0.75', Reduced=False, Colwise=False, tempDir='.', Comments=False)
Export as PDF (default) the principal projection of
the valued relation using the three principal eigen vectors.
 
Implemeted picture formats are: 
'pdf' (default), 'png', 'jpeg' and 'xfig'.
 
The background color is set by default to 'cornsilk'. 
 
Font size and color are set by default to 'red3', resp. '0.75'. 
 
When *Reduced==True*, the valued relation characeteristics are centered and reduced.
 
When *Colwise==True*, the column vectors of the adjacency table are used for the principal projection, otherwise the rows (default) are used. Has no incidence when the *Digraph* instance *self*  is symmetric. 
 
.. warning::
 
    The method, writing and reading temporary files: 
    tempCol.r and rotationCol.csv, resp. tempRow.r and rotationRow.csv,
    by default in the working directory (./),
    is hence not safe for multiprocessing programs, unless a
    temporary directory *tempDir* is provided.
flatChoice(self, ch, Debug=False)
Converts set or list ch recursively to a flat list of items.
forcedBestSingleChoice(self)
Renders the set of most determined outranking singletons in self.
gammaSets(self)
Renders the dictionary of neighborhoods {node: (dx,ax)}
with set *dx* gathering the dominated, and set *ax* gathering
the absorbed neighborhood.
generateAbsPreKernels(self)
Generate all absorbent prekernels from independent choices generator.
generateDomPreKernels(self)
Generate all dominant prekernels from independent choices generator.
htmlChoiceVector(self, ch, ChoiceVector=True, choiceType='good')
Show procedure for annotated bipolar choices.
inDegrees(self)
renders the median cut indegrees
inDegreesDistribution(self)
Renders the distribution of indegrees.
independentChoices(self, U)
Generator for all independent choices with neighborhoods of a bipolar valued digraph:
 
.. note::
 
       * Initiate with U = self.singletons().
       * Yields [(independent choice, domnb, absnb, indnb)].
inner_prod(self, v1, v2)
Parameters: two choice characteristic vectors
Renders the inner product of two characteristic vetors.
intstab(self, choice)
Computes the independence degree of a choice.
irreflex(self, mat)
Puts diagonal entries of mat to valuationdomain['min']
isAsymmetricIndeterminate(self, Debug=False)
Checks the self.relation for assymmetric indeterminateness!!
 
.. warning::
 
    The reflexive links are ignored !!
isComplete(self, Debug=False)
checks the completeness property of self.relation by checking
for the absence of a link between two actions!!
 
.. warning::
 
    The reflexive links are ignored !!
isCyclic(self, Debug=False)
checks the cyclicity of self.relation by checking
for a reflexive loop in its transitive closure-
 
.. warning::
 
     self.relation is supposed to be irreflexive !
isIntegerValued(self, Debug=False)
Checks whether the decimal valuation of self is integer-valued
be using the as_integer_ratio() method of a Decimal 
giving a tuple (numerator,denominator). If denominator == 1, the
number is an integer.
isOutrankingDigraph(self, Comments=True, Debug=False)
Checks the outranking digraph characteristic condition (3.3).
 
relation[x][y] + relation[y][x)[y] >= 0.0
 
.. warning::
 
    The reflexive links are ignored and the valuation must be bipolar !!
isStrictOutrankingDigraph(self, Comments=True, Debug=False)
Checks the strict outranking digraph characteristic condition (3.1).
 
-(relation[x][y] + relation[y][x]) <= 0.0 , x != y
 
.. warning::
 
    The reflexive links are ignored and the valuation must be bipolar !!
isSymmetric(self, Comments=False)
True if symmetry degree == 1.0.
isTransitive(self, Comments=False)
True if transitivity degree == 1.0.
isWeaklyComplete(self, Debug=False)
checks the weakly completeness property of self.relation by checking
for the absence of a link between two actions!!
 
.. warning::
 
    The reflexive links are ignored !!
iterateRankingByChoosing(self, Odd=False, CoDual=False, Comments=True, Debug=False, Limited=None)
Renders a ranking by choosing result when progressively eliminating
all chordless (odd only) circuits with rising valuation cut levels.
 
Parameters
    CoDual = False (default)/True
    Limited = proportion (in [0,1]) * (max - med) valuationdomain
kChoices(self, A, k)
Renders all choices of length k from set A
matmult2(self, m, v)
Parameters: digraph relation and choice characteristic vector
matrix multiply vector by inner production
meanDegree(self)
Renders the mean degree of self.
!!! self.size must be set previously !!!
meanLength(self, Oriented=False)
Renders the (by default non-oriented) mean neighbourhoor depth of self.
!!! self.order must be set previously !!!
minimalChoices(self, S)
Generates all dominant or absorbent choices of a bipolar
valued digraph.
 
.. note:
 
   * Initiate with S = (actions, dict of dominant or absorbent closed neighborhoods)
   * See showMinDom and showMinAbs methods.
minimalValuationLevelForCircuitsElimination(self, Odd=True, Debug=False, Comments=False)
renders the minimal valuation level <lambda> that eliminates all
self.circuitsList stored odd chordless circuits from self.
 
.. warning::
 
    The <lambda> level polarised may still contain newly appearing chordless odd circuits !
neighbourhoodCollection(self, Oriented=False, Potential=False)
Renders the neighbourhood.
neighbourhoodDepthDistribution(self, Oriented=False)
Renders the distribtion of neighbourhood depths.
notGammaSets(self)
Renders the dictionary of neighborhoods {node: (dx,ax)}
with set *dx* gathering the not dominated, and set *ax* gathering
the not absorbed neighborhood.
notaneighbors(self, node)
Renders the set of absorbed not in-neighbors of a node.
notdneighbors(self, node)
Renders the set of not dominated out-neighbors of a node.
outDegrees(self)
renders the median cut outdegrees
outDegreesDistribution(self)
Renders the distribution of outdegrees.
plusirredundant(self, U)
Generates all +irredundant choices of a digraph.
powerset(self, U)
Generates all subsets of a set.
readPerrinMisset(self, file='curd.dat')
read method for 0-1-char-coded MISs by default from the perrinMIS.c curd.dat result file.
readabsvector(self, x, relation)
Parameter: action x
absorbent in vector.
readdomvector(self, x, relation)
Parameter: action x
dominant out vector.
recodeValuation(self, newMin=-1.0, newMax=1.0, ndigits=4, Debug=False)
Recodes the characteristic valuation domain according
to the parameters given. 
 
*ndigits* indicates the number of decimal digits of the valuation.
relationFct(self, x, y)
wrapper for self.relation dictionary access to ensure interoperability
with the sparse and big outranking digraph implementation model.
save(self, fileName='tempdigraph', option=None, DecimalValuation=True, decDigits=2)
Persistent storage of a Digraph class instance in the form of
a python source code file
saveCSV(self, fileName='tempdigraph', Normalized=False, Dual=False, Converse=False, Diagonal=False, Debug=False)
Persistent storage of a Digraph class instance in the form of
a csv file.
saveXMCDA2(self, fileName='temp', fileExt='xmcda2', Comments=True, relationName='R', relationType='binary', category='random', subcategory='valued', author='digraphs Module (RB)', reference='saved from Python', valuationType='standard', digits=2, servingD3=False)
save digraph in XMCDA 2.0 format. Deprecated now.
savedre(self, fileName='temp')
save digraph in nauty format.
sharp(self, x, y)
Paramaters: choice characteristic values.
Renders the sharpest of two characteristic values x and y.
sharpvec(self, v, w)
Paramaters: choice characteristic vectors.
Renders the sharpest of two characteristic vectors v and w.
showActions(self)
presentation methods for digraphs actions
showAll(self)
Detailed show method for genuine digraphs.
showAttributes(self)
Prints out the attributes of self.
showAutomorphismGenerators(self)
Renders the generators of the automorphism group.
showBadChoices(self, Recompute=True)
Characteristic values for potentially bad choices.
showBestChoiceRecommendation(self, Verbose=False, Comments=True, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True)
Shows the RuBis best choice recommendation.
 
.. note::
 
    Computes by default the Rubis best choice recommendation on the corresponding strict (codual) outranking digraph.
 
    By default, with BrokenCocs=True, we brake all chordless circuits at their weakest determined ( abs(r(x>y)) + abs(r(y>x)) ) link.
 
    When BrokenCocs=False we proceed like follows:
 
    In case of chordless circuits, if supporting arcs are more credible
    than the reversed negating arcs, we collapse the circuits into hyper nodes.
    Inversely,  if supporting arcs are not more credible than the reversed negating arcs,
    we brake the circuits on their weakest arc.
 
Usage example:
 
>>> from outrankingDigraphs import *
>>> t = Random3ObjectivesPerformanceTableau(seed=5)
>>> g = BipolarOutrankingDigraph(t)
>>> g.showBestChoiceRecommendation()
***********************
RuBis Best Choice Recommendation (BCR)
(in decreasing order of determinateness)   
Credibility domain:  [-100.0, 100.0]
=== >> potential first choices
* choice              : ['a04', 'a14', 'a19', 'a20']
   independence        : 1.19
   dominance           : 4.76
   absorbency          : -59.52
   covering (%)        : 75.00
   determinateness (%) : 57.86
   - most credible action(s) = { 'a14': 23.81, 'a19': 11.90, 'a04': 2.38, 'a20': 1.19, }  
=== >> potential last choices 
* choice              : ['a03', 'a12', 'a17']
  independence        : 4.76
  dominance           : -76.19
  absorbency          : 4.76
  covering (%)        : 0.00
  determinateness (%) : 65.39
  - most credible action(s) = { 'a03': 38.10, 'a12': 13.10, 'a17': 4.76, }
Execution time: 0.024 seconds
*****************************
showChoiceVector(self, ch, choiceType='good', ChoiceVector=True)
Show procedure for annotated bipolar choices.
showChordlessCircuits(self, Recompute=False)
Show method for chordless circuits observed in a Digraph instance.
 
If previous computation is required, stores the detected circuits in self.circuitsList attribute.
showComponents(self)
Shows the list of connected components of the digraph instance.
showCorrelation(self, corr=None, ndigits=3)
Renders the valued ordinal correlation index, the crisp Kendall tau index and their epistemic determination degree.
showFirstChoiceRecommendation(self, Verbose=False, Comments=True, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True)
Shows the RuBis first choice recommendation.
 
.. note::
 
    Computes by default the Rubis first choice recommendation on the corresponding strict (codual) outranking digraph.
 
    By default, with BrokenCocs=True, we brake all chordless circuits at their weakest determined ( abs(r(x>y)) + abs(r(y>x)) ) link.
 
    When BrokenCocs=False we proceed like follows:
 
    In case of chordless circuits, if supporting arcs are more credible
    than the reversed negating arcs, we collapse the circuits into hyper nodes.
    Inversely,  if supporting arcs are not more credible than the reversed negating arcs,
    we brake the circuits on their weakest arc.
 
Usage example:
 
>>> from outrankingDigraphs import *
>>> t = Random3ObjectivesPerformanceTableau(seed=5)
>>> g = BipolarOutrankingDigraph(t)
>>> g.showFirstChoiceRecommendation()
***********************
RuBis First Choice Recommendation (BCR)
(in decreasing order of determinateness)   
Credibility domain:  [-100.0, 100.0]
=== >> potential first choices
* choice              : ['a04', 'a14', 'a19', 'a20']
   independence        : 1.19
   dominance           : 4.76
   absorbency          : -59.52
   covering (%)        : 75.00
   determinateness (%) : 57.86
   - most credible action(s) = { 'a14': 23.81, 'a19': 11.90, 'a04': 2.38, 'a20': 1.19, }  
=== >> potential last choices 
* choice              : ['a03', 'a12', 'a17']
  independence        : 4.76
  dominance           : -76.19
  absorbency          : 4.76
  covering (%)        : 0.00
  determinateness (%) : 65.39
  - most credible action(s) = { 'a03': 38.10, 'a12': 13.10, 'a17': 4.76, }
Execution time: 0.024 seconds
*****************************
showGoodChoices(self, Recompute=True)
Characteristic values for potentially good choices.
showHTMLBestChoiceRecommendation(self, pageTitle=None, ChoiceVector=False, CoDual=True, Debug=False, _OldCoca=False, BrokenCocs=True, htmlFileName=None)
showHTMLRelationHeatmap(self, actionsList=None, rankingRule='NetFlows', colorLevels=7, tableTitle='Relation Heatmap', relationName='r(x S y)', ndigits=2, fromIndex=None, toIndex=None, htmlFileName=None)
Launches a browser window with the colored relation map of self.
 
See corresponding :py:class:`~digraphs.Digraph.showHTMLRelationMap` method.
 
The *colorLevels* parameter may be set to 3, 5, 7 (default) or 9.
 
When the *actionsList* parameter is *None* (default), the digraphs actions list may be ranked with the *rankingRule* parameter set to the 'Copeland' (default) or to the 'Netlows' ranking rule.
 
When the *htmlFileName* parameter is set to a string value 'xxx', a html file named 'xxx.html' will be generated in the current working directory. Otherwise, a temporary file named 'tmp*.html' will be generated there.
 
Example::
 
    >>> from outrankingDigraphs import *
    >>> t = RandomCBPerformanceTableau(numberOfActions=25,seed=1)
    >>> g = BipolarOutrankingDigraph(t,ndigits=2)
    >>> gcd = ~(-g)  # strict outranking relation
    >>> gcd.showHTMLRelationHeatmap(colorLevels=7,ndigits=2)
    
.. image:: relationHeatmap.png
   :alt: Browser view of a relation map
   :width: 600 px
   :align: center
showHTMLRelationMap(self, actionsList=None, rankingRule='Copeland', Colored=True, tableTitle='Relation Map', relationName='r(x S y)', symbols=['+', '&middot;', '&nbsp;', '&#150;', '&#151'], fromIndex=None, toIndex=None, htmlFileName=None)
Launches a browser window with the colored relation map of self.
See corresponding Digraph.showRelationMap() method.
 
When *htmlFileName* parameter is set to a string value, a html file
with that name will be stored in the current working directory.
 
By default, a temporary file named: tmp*.html will be generated
instead in the current working directory.
 
Example::
 
    >>> from outrankingDigraphs import *
    >>> t = RandomCBPerformanceTableau(numberOfActions=25,seed=1)
    >>> g = BipolarOutrankingDigraph(t,Normalized=True)
    >>> gcd = ~(-g)  # strict outranking relation
    >>> gcd.showHTMLRelationMap(rankingRule="NetFlows")
    
.. image:: relationMap.png
   :alt: Browser view of a relation map
   :width: 600 px
   :align: center
showHTMLRelationTable(self, actionsList=None, relation=None, IntegerValues=False, ndigits=2, Colored=True, tableTitle='Valued Adjacency Matrix', relationName='r(x S y)', ReflexiveTerms=False, htmlFileName=None, fromIndex=None, toIndex=None)
Launches a browser window with the colored relation table of self.
showMIS(self, withListing=True)
Prints all maximal independent choices:
    Result in self.misset.
showMIS_AH(self, withListing=True)
Prints all MIS using the Hertz method.
 
Result saved in self.hertzmisset.
showMIS_HB2(self, withListing=True)
Prints all MIS using the Hertz-Bisdorff method.
 
Result saved in self.newmisset.
showMIS_RB(self, withListing=True)
Prints all MIS using the Bisdorff method.
 
Result saved in self.newmisset.
showMIS_UD(self, withListing=True)
Prints all MIS using the Hertz-Bisdorff method.
 
Result saved in self.newmisset.
showMaxAbsIrred(self, withListing=True)
Computing maximal -irredundant choices:
    Result in self.absirset.
showMaxDomIrred(self, withListing=True)
Computing maximal +irredundant choices:
   Result in self.domirset.
showMinAbs(self, withListing=True)
Prints minimal absorbent choices:
    Result in self.absset.
showMinDom(self, withListing=True)
Prints all minimal dominant choices:
    Result in self.domset.
showNeighborhoods(self)
Lists the gamma and the notGamma function of self.
showOrbits(self, InChoices, withListing=True)
Prints the orbits of Choices along the automorphisms of
the Digraph instance.
 
Example Python session for computing the non isomorphic MISs from the 12-cycle graph:
 
>>> from digraphs import *
>>> c12 = CirculantDigraph(order=12,circulants=[1,-1])
>>> c12.automorphismGenerators()
...
  Permutations
  {'1': '1', '2': '12', '3': '11', '4': '10', '5': 
   '9', '6': '8', '7': '7', '8': '6', '9': '5', '10': 
   '4', '11': '3', '12': '2'}
  {'1': '2', '2': '1', '3': '12', '4': '11', '5': '10', 
   '6': '9', '7': '8', '8': '7', '9': '6', '10': '5', 
   '11': '4', '12': '3'}
  Reflections {}
>>> print('grpsize = ', c12.automorphismGroupSize)
  grpsize = 24
>>> c12.showMIS(withListing=False)
  *---  Maximal independent choices ---*
  number of solutions:  29
  cardinality distribution
  card.:  [0, 1, 2, 3, 4,  5,  6, 7, 8, 9, 10, 11, 12]
  freq.:  [0, 0, 0, 0, 3, 24,  2, 0, 0, 0,  0,  0,  0]
  Results in c12.misset
>>> c12.showOrbits(c12.misset,withListing=False)
...
  *---- Global result ----
  Number of MIS:  29
  Number of orbits :  4
  Labelled representatives:
  1: ['2','4','6','8','10','12']
  2: ['2','5','8','11']
  3: ['2','4','6','9','11']
  4: ['1','4','7','9','11']
  Symmetry vector
  stabilizer size: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, ...]
  frequency      : [0, 2, 0, 0, 0, 0, 0, 1, 0,  0,  0,  1, ...]
 
*Figure*: The symmetry axes of the non isomorphic MISs of the 12-cycle:
 
.. image:: c12.png
   :width: 400 px
   :align: center
   :alt: The 4 non isomorphic MIS of the 12-cycle graph
 
*Reference*: R. Bisdorff and J.L. Marichal (2008). Counting non-isomorphic maximal independent sets of the n-cycle graph. *Journal of Integer Sequences*, Vol. 11 Article 08.5.7 (`openly accessible here <https://www.cs.uwaterloo.ca/journals/JIS/VOL11/Marichal/marichal.html>`_)
showOrbitsFromFile(self, InFile, withListing=True)
Prints the orbits of Choices along the automorphisms of
the digraph self by reading in the 0-1 misset file format.
See the :py:func:`digraphs.Digraph.readPerrinMisset` method.
showPreKernels(self, withListing=True)
Printing dominant and absorbent preKernels:
    Result in self.dompreKernels and self.abspreKernels
showRankingByBestChoosing(self, rankingByBestChoosing=None)
A show method for self.rankinByBestChoosing result.
 
.. warning::
 
     The self.computeRankingByBestChoosing(CoDual=False/True) method instantiating the self.rankingByBestChoosing slot is pre-required !
showRankingByChoosing(self, rankingByChoosing=None, WithCoverCredibility=False)
A show method for self.rankinByChoosing result.
 
When parameter *WithCoverCredibility* is set to True, the credibility of outranking, respectively being outranked is indicated at each selection step. 
 
.. warning::
 
     The self.computeRankingByChoosing(CoDual=False/True) method instantiating the self.rankingByChoosing slot is pre-required !
showRankingByLastChoosing(self, rankingByLastChoosing=None, Debug=None)
A show method for self.rankinByChoosing result.
 
.. warning::
 
     The self.computeRankingByLastChoosing(CoDual=False/True) method instantiating the self.rankingByChoosing slot is pre-required !
showRelation(self)
prints the relation valuation in ##.## format.
showRelationMap(self, symbols=None, rankingRule='Copeland', fromIndex=None, toIndex=None, actionsList=None)
Prints on the console, in text map format, the location of
certainly validated and certainly invalidated outranking situations.
 
By default, symbols = {'max':'┬','positive': '+', 'median': ' ',
                       'negative': '-', 'min': '┴'}
 
The default ordering of the output is following the Copeland ranking rule
from best to worst actions. Further available ranking rule is the 'NetFlows' net flows rule.
 
 
Example::
 
    >>> from outrankingDigraphs import *
    >>> t = RandomCBPerformanceTableau(numberOfActions=25,seed=1)
    >>> g = BipolarOutrankingDigraph(t,Normalized=True)
    >>> gcd = ~(-g)  # strict outranking relation
    >>> gcd.showRelationMap(rankingRule="NetFlows")
     -   ++++++++  +++++┬+┬┬+
    - -   + +++++ ++┬+┬+++┬++
    ┴+  ┴ + ++  ++++┬+┬┬++┬++
    -   ++ - ++++-++++++┬++┬+
       - - - ++- ┬- + -+┬+-┬┬
    -----  -      -┬┬┬-+  -┬┬
    ----    --+-+++++++++++++
    -- --+- --++ ++ +++-┬+-┬┬
    ----  -  -+-- ++--+++++ +
    ----- ++- --- +---++++┬ +
    -- -- ---+ -++-+++-+ +-++
    -- --┴---+  + +-++-+ -  +
    ---- ┴---+-- ++--++++ - +
      --┴┴--  --- -  --+ --┬┬
     ---------+--+ ----- +-┬┬
    -┴---┴- ---+- + ---+++┬ +
    -┴┴--┴---+--- ++ -++--+++
    -----┴--- ---+-+- ++---+ 
    -┴┴--------------- --++┬ 
    --┴---------------- --+┬ 
    ┴--┴┴ -┴--┴┴-┴ --++  ++-+
    ----┴┴--------------- -  
    ┴┴┴----+-┴+┴---┴-+---+ ┴+
    ┴┴-┴┴┴-┴- - -┴┴---┴┴+ ┬ -
    ----┴┴-┴-----┴┴---  - -- 
    Ranking rule: NetFlows
    >>>
showRelationTable(self, Sorted=True, rankingRule=None, IntegerValues=False, actionsSubset=None, relation=None, ndigits=2, ReflexiveTerms=True, fromIndex=None, toIndex=None)
Prints the relation valuation in actions X actions table format.
Copeland and NetFlows rankings my be used.
showRubisBestChoiceRecommendation(self, **kwargs)
Dummy for backward portable showBestChoiceRecommendation().
showRubyChoice(self, Verbose=False, Comments=True, _OldCoca=True)
Dummy for showBestChoiceRecommendation()
needed for older versions compatibility.
showShort(self)
concise presentation method for genuine digraphs.
showSingletonRanking(self, Comments=True, Debug=False)
Calls self.computeSingletonRanking(comments=True,Debug = False).
Renders and prints the sorted bipolar net determinatation of outrankingness
minus outrankedness credibilities of all singleton choices.
 
res = ((netdet,sigleton,dom,absorb)+)
showStatistics(self)
Computes digraph statistics like order, size and arc-density.
showdre(self)
Shows relation in nauty format.
singletons(self)
list of singletons and neighborhoods
[(singx1, +nx1, -nx1, not(+nx1 or -nx1)),.... ]
sizeSubGraph(self, choice)
Output: (size, undeterm,arcDensity).
Renders the arc density of the induced subgraph.
strongComponents(self, setPotential=False)
Renders the set of strong components of self.
symDegreesDistribution(self)
Renders the distribution of symmetric degrees.
topologicalSort(self, Debug=False)
If self is acyclic, adds topological sort number to each node of self
and renders ordered list of nodes. Otherwise renders None.
Source: M. Golumbic Algorithmic Graph heory and Perfect Graphs,
Annals Of Discrete Mathematics 57 2nd Ed. , Elsevier 2004, Algorithm 2.4 p.44.
weakAneighbors(self, node)
Renders the set of absorbed in-neighbors of a node.
weakCondorcetLosers(self)
Renders the set of decision actions x such that
self.relation[x][y] <= self.valuationdomain['med']
for all y != x.
weakCondorcetWinners(self)
Renders the set of decision actions x such that
self.relation[x][y] >= self.valuationdomain['med']
for all y != x.
weakDneighbors(self, node)
Renders the set of dominated out-neighbors of a node.
weakGammaSets(self)
Renders the dictionary of neighborhoods {node: (dx,ax)}
zoomValuation(self, zoomFactor=1.0)
Zooms in or out, depending on the value of the zoomFactor provided,
the bipolar valuation of a digraph.

Data descriptors inherited from Digraph:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
Functions
       
time(...)
time() -> floating point number
 
Return the current time in seconds since the Epoch.
Fractions of a second may be present if the system clock provides them.

 
Data
        colorPalettes = {1: ['none', '#EA2027', '#006266', '#1B1464', '#5758BB', '#6F1E51', '#EE5A24', '#009432', '#0652DD', '#9980FA', '#833471', '#F79F1F', '#A3CB38', '#1289A7', '#D980FA', '#B53471', '#FFC312', '#C4E538', '#12CBC4', '#FDA7DF', ...], 2: ['black', 'blue', 'coral', 'gold', 'gray', 'black', 'pink', 'green', 'orange', 'skyblue', 'wheat', 'salmon'], 3: ['none', 'black', 'red', 'cyan', 'green', 'brown', 'blue', 'gold', 'orange', 'grey', 'green2']}