Sphericalmoments

15 Reputation

One Badge

2 years, 127 days

MaplePrimes Activity


These are replies submitted by Sphericalmoments

@mmcdara @dharr 3952  There seems to be some gap in understanding because i mentioned the function Cyclebasis. The given input is a Directed graph D and the output is the number of Directed cycles. For instance, in the tournament X1, there are two directed cycles of length 3, namely v1-v2-v3-v1 and v1-v4-v3-v1 and one directed cycle of length 4, namely v1-v4-v2-v3-v1.

To be clear, there may be two (or more) different directed cycles in the same set of vertices. For eg in D1, the directed cycles u1-u2-u3-u4-u5-u1 and u1-u3-u5-u2-u4-u1 are counted as Two directed cycles of length 5.

Hope this clarifies. Thanks

@Carl Love Yes you are right that I am just trying to see if there is a formula or nice pattern for the maximum count before proving it.

I also written a code for GenerateBipartiteTournament, but not as short as yours. Could you please explain the line 

GraphTheory:-Graph({seq}(seq(`if`(r()=0, [i,j], [j,i]), i= 1..n), j= n+1..n+m))

  I would like to modify the above line in future for other multipartite tournament, say tripartite tournaments, i.e., with 3 partite sets. 

My code as below.

with(RandomTools):
with(GraphTheory):
with(RandomGraphs):
with(MTM):

do
    G:=Digraph([1,2,3,4,5,6,7,8],{}):
    L := Generate(list(integer(range = 1 .. 10), 16)):

    i:=1:
    j:=5:
    for l in L do
        if type(l, even) then 
            AddArc(G,[i,j]):
        else
            AddArc(G,[j,i]):
        end if;

        j:=j+1:
        if j=9 then 
            j:=5:
            i:=i+1:
        end if;
    end do;

    A:=AdjacencyMatrix(G):

    count:=0;
    for s from 2 to 8 do
        for t from 1 to s-1 do
            for k from 1 to 8 do
                if (A(s,k)=1 and A(t,k)=1) then
                    count:=count+1;
                    break;
                end if;
            end do;
        end do; 
    end do;
    %DrawGraph(G):
until count>10;
print("competing pairs=", count);
A:=AdjacencyMatrix(G);

@acer lol i saw it somewhere before. So, is there one?

@Carl Love Actually i dont need to print all of them, I am looking for the bipartite tournament(s) with the maximum count of pairs of vertices which share some out-neighbour.

@Carl Love Dear Carl, thank you very much.

1. Bipartite tournament is a digraph with two partite set of vertices and two vertices have exactly one arc if and only if they are from distinct partite sets.

2a. I thought "GenerateBipartiteTournaments" is an available package in Maple. I didn't write any procedure for it. All you see is all that is written. Is there a package that runs through all bipartite tournaments with given sizes of partite sets, say each partite set is of size 4?

2b. I saw the function "RandomTournament". Is there an analoguous function "RandomBipartiteTournament"?

3. I didn't save the worksheet :( But I retyped it below.

with(GraphTheory);

V1:={1,2,3,4};
V2:={5,6,7,8};
BTList:=GenerateBipartiteTournaments(V1,V2);

for G in BTList do
WeightMatrix(G);
count:=0;
for v in V1 do
    for u in V1 do
        if u>v then
            if nops(CommonNeighbors(G,v,u))>0 then
                count:=count+1;
            end if;
        end if;
    end do;
end do;

for v in V2 do
    for u in V2 do
        if u>v then
            if nops(CommonNeighbors(G,v,u))>0 then
                count:=count+1;
            end if;
        end if;
    end do;
end do;
print("Bipartite tournament:", WeightMatrix(G), "Number of pairs =", count);
end do;

This is the mentioned code

Page 1 of 1