• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 19:14
CET 01:14
KST 09:14
  • Home
  • Forum
  • Calendar
  • Streams
  • Liquipedia
  • Features
  • Store
  • EPT
  • TL+
  • StarCraft 2
  • Brood War
  • Smash
  • Heroes
  • Counter-Strike
  • Overwatch
  • Liquibet
  • Fantasy StarCraft
  • TLPD
  • StarCraft 2
  • Brood War
  • Blogs
Forum Sidebar
Events/Features
News
Featured News
RSL Revival - 2025 Season Finals Preview8RSL Season 3 - Playoffs Preview0RSL Season 3 - RO16 Groups C & D Preview0RSL Season 3 - RO16 Groups A & B Preview2TL.net Map Contest #21: Winners12
Community News
ComeBackTV's documentary on Byun's Career !6Weekly Cups (Dec 8-14): MaxPax, Clem, Cure win4Weekly Cups (Dec 1-7): Clem doubles, Solar gets over the hump1Weekly Cups (Nov 24-30): MaxPax, Clem, herO win2BGE Stara Zagora 2026 announced15
StarCraft 2
General
ComeBackTV's documentary on Byun's Career ! When will we find out if there are more tournament Weekly Cups (Dec 8-14): MaxPax, Clem, Cure win Did they add GM to 2v2? RSL Revival - 2025 Season Finals Preview
Tourneys
RSL Offline Finals Info - Dec 13 and 14! Master Swan Open (Global Bronze-Master 2) Winter Warp Gate Amateur Showdown #1: Sparkling Tuna Cup - Weekly Open Tournament $5,000+ WardiTV 2025 Championship
Strategy
Custom Maps
Map Editor closed ?
External Content
Mutation # 504 Retribution Mutation # 503 Fowl Play Mutation # 502 Negative Reinforcement Mutation # 501 Price of Progress
Brood War
General
FlaSh on: Biggest Problem With SnOw's Playstyle How Rain Became ProGamer in Just 3 Months BGH Auto Balance -> http://bghmmr.eu/ [BSL21] RO8 Bracket & Prediction Contest BW General Discussion
Tourneys
Small VOD Thread 2.0 [Megathread] Daily Proleagues [BSL21] WB SEMIFINALS - Saturday 21:00 CET [BSL21] RO8 - Day 2 - Sunday 21:00 CET
Strategy
Game Theory for Starcraft Current Meta Simple Questions, Simple Answers Fighting Spirit mining rates
Other Games
General Games
Stormgate/Frost Giant Megathread Path of Exile Nintendo Switch Thread General RTS Discussion Thread Dawn of War IV
Dota 2
Official 'what is Dota anymore' discussion
League of Legends
Heroes of the Storm
Simple Questions, Simple Answers Heroes of the Storm 2.0
Hearthstone
Deck construction bug Heroes of StarCraft mini-set
TL Mafia
Mafia Game Mode Feedback/Ideas Survivor II: The Amazon Sengoku Mafia TL Mafia Community Thread
Community
General
US Politics Mega-thread Things Aren’t Peaceful in Palestine The Games Industry And ATVI Russo-Ukrainian War Thread YouTube Thread
Fan Clubs
White-Ra Fan Club
Media & Entertainment
Anime Discussion Thread [Manga] One Piece Movie Discussion!
Sports
2024 - 2026 Football Thread Formula 1 Discussion
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
TL+ Announced Where to ask questions and add stream?
Blogs
The (Hidden) Drug Problem in…
TrAiDoS
I decided to write a webnov…
DjKniteX
James Bond movies ranking - pa…
Topin
Thanks for the RSL
Hildegard
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1542 users

SC2 beta key contest

Blogs > forti
Post a Reply
forti
Profile Blog Joined April 2010
Singapore9 Posts
Last Edited: 2010-05-04 16:13:12
May 04 2010 15:42 GMT
#1
CONTEST OVER
vesperia won it!

Hello everyone, I got my beta key off one of these contests on TL and recently got my friend invites. I figured I should give it back to TL

The contest will be similar to the one I had to solve (mathematical) and you can either PM me or post in this thread the solution. First person (by time) to give me an acceptable solution will receive the key!

The question is:

Show that determining whether a directed graph G with vertice set V and edge set E contains a universal sink - a vertex with in-degree |V| -1 and out-degree 0 - can be determined in time O(V ), given an adjacency matrix for G.

You will require some basic graph theory and algorithm knowledge to solve this question

edit: Your answer just needs to describe a method/algorithm to obtain the answer and explain why it works, no actual code needed


Here are some useful links

+ Show Spoiler +

http://en.wikipedia.org/wiki/Adjacency_matrix
http://en.wikipedia.org/wiki/Graph_(mathematics)
http://en.wikipedia.org/wiki/Directed_graph#Indegree_and_outdegree
http://en.wikipedia.org/wiki/Asymptotic_upper_bound


Terranlisk
Profile Blog Joined February 2007
Singapore1404 Posts
May 04 2010 15:48 GMT
#2
damnit maths
aka myheronoob
Scorch
Profile Blog Joined March 2008
Austria3371 Posts
May 04 2010 15:51 GMT
#3
Do you mean O(E) or really O(V)?
forti
Profile Blog Joined April 2010
Singapore9 Posts
May 04 2010 15:54 GMT
#4
O(V), O(E) is too easy ^^
Vesperia
Profile Joined April 2010
Canada30 Posts
May 04 2010 16:01 GMT
#5
Is this it?

Let Vij be an adjacency matrix (containing integers 0 and 1)
int hold = 0; // first vertex with vertices number 0..n-1
for (int i = 1; i < n; i++) {
if (V[hold][i] == 1) // hold not a sink
hold = i; //make vertex i the new candidate
//else vertex i does not have in-degree |V| -1 and hold still a sink candidate
i++;
}
// check to see if candidate is a universal sink – it is the only possibility
boolean flag = true;
for (int j = 0; j < n; j++) {
if (j != hold && (V[j][hold] == 0 || V[hold][j] == 1) {
flag == false;
break;
}
}
if (flag)
System.out.println(“Vertex “, hold, “ is universal sink”);
else
System.out.println(“Graph contains no universal sink.”);
//both for-loops execute in O(|V|)
bITt.mAN
Profile Blog Joined March 2009
Switzerland3693 Posts
May 04 2010 16:06 GMT
#6
Damm, why couldn't it be something simpler
BW4LYF . . . . . . PM me, I LOVE PMs. . . . . . Long live "NaDa's Body" . . . . . . Fantasy | Bisu/Best | Jaedong . . . . .
forti
Profile Blog Joined April 2010
Singapore9 Posts
May 04 2010 16:12 GMT
#7
On May 05 2010 01:01 Vesperia wrote:
Is this it?

Let Vij be an adjacency matrix (containing integers 0 and 1)
int hold = 0; // first vertex with vertices number 0..n-1
for (int i = 1; i < n; i++) {
if (V[hold][i] == 1) // hold not a sink
hold = i; //make vertex i the new candidate
//else vertex i does not have in-degree |V| -1 and hold still a sink candidate
i++;
}
// check to see if candidate is a universal sink – it is the only possibility
boolean flag = true;
for (int j = 0; j < n; j++) {
if (j != hold && (V[j][hold] == 0 || V[hold][j] == 1) {
flag == false;
break;
}
}
if (flag)
System.out.println(“Vertex “, hold, “ is universal sink”);
else
System.out.println(“Graph contains no universal sink.”);
//both for-loops execute in O(|V|)


yup that's the solution i had in mind ^^ i'll PM you the key
Vesperia
Profile Joined April 2010
Canada30 Posts
May 04 2010 16:15 GMT
#8
YESSSSS! I finally got one!

Thanks so much forti!!!
forti
Profile Blog Joined April 2010
Singapore9 Posts
May 04 2010 16:33 GMT
#9
btw

for (int i = 1; i < n; i++) {
if (V[hold][i] == 1) // hold not a sink
hold = i; //make vertex i the new candidate
//else vertex i does not have in-degree |V| -1 and hold still a sink candidate
i++;
}

the 2nd i++ is wrong but the general method is correct ^^
yh8c4
Profile Blog Joined July 2009
108 Posts
May 04 2010 18:27 GMT
#10
nice to see that the key i gave to you spawned to another user
Please log in or register to reply.
Live Events Refresh
Next event in 10h 46m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
PiGStarcraft449
ProTech60
CosmosSc2 54
StarCraft: Brood War
Artosis 552
NaDa 23
Mong 4
Dota 2
syndereN839
Counter-Strike
Foxcn150
adren_tv86
Super Smash Bros
PPMD67
Liquid`Ken24
Other Games
summit1g7175
Day[9].tv284
C9.Mang0181
RotterdaM122
ViBE109
Maynarde83
Trikslyr54
Mew2King34
nookyyy 29
Organizations
Other Games
BasetradeTV50
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 19 non-featured ]
StarCraft 2
• Hupsaiya 101
• RyuSc2 38
• davetesta18
• Kozan
• LaughNgamezSOOP
• sooper7s
• AfreecaTV YouTube
• intothetv
• Migwel
• IndyKCrew
StarCraft: Brood War
• Pr0nogo 2
• STPLYoutube
• ZZZeroYoutube
• BSLYoutube
Dota 2
• masondota22666
League of Legends
• Doublelift3691
Other Games
• imaqtpie2124
• Scarra752
• Day9tv284
Upcoming Events
WardiTV 2025
10h 46m
ByuN vs Creator
Clem vs Rogue
Scarlett vs Spirit
ShoWTimE vs Cure
OSC
13h 46m
Big Brain Bouts
16h 46m
YoungYakov vs Jumy
TriGGeR vs Spirit
CranKy Ducklings
1d 9h
WardiTV 2025
1d 10h
Reynor vs MaxPax
SHIN vs TBD
Solar vs herO
Classic vs TBD
SC Evo League
1d 12h
Ladder Legends
1d 18h
BSL 21
1d 19h
Sziky vs Dewalt
eOnzErG vs Cross
Sparkling Tuna Cup
2 days
Ladder Legends
2 days
[ Show More ]
BSL 21
2 days
StRyKeR vs TBD
Bonyth vs TBD
Replay Cast
3 days
Wardi Open
3 days
Monday Night Weeklies
3 days
WardiTV Invitational
5 days
Replay Cast
6 days
WardiTV Invitational
6 days
ByuN vs Solar
Clem vs Classic
Cure vs herO
Reynor vs MaxPax
Liquipedia Results

Completed

Acropolis #4 - TS3
RSL Offline Finals
Kuram Kup

Ongoing

C-Race Season 1
IPSL Winter 2025-26
KCM Race Survival 2025 Season 4
YSL S2
BSL Season 21
Slon Tour Season 2
CSL Season 19: Qualifier 1
WardiTV 2025
META Madness #9
eXTREMESLAND 2025
SL Budapest Major 2025
ESL Impact League Season 8
BLAST Rivals Fall 2025
IEM Chengdu 2025
PGL Masters Bucharest 2025
Thunderpick World Champ.
CS Asia Championships 2025
ESL Pro League S22

Upcoming

CSL Season 19: Qualifier 2
CSL 2025 WINTER (S19)
BSL 21 Non-Korean Championship
Acropolis #4
IPSL Spring 2026
Bellum Gens Elite Stara Zagora 2026
HSC XXVIII
Big Gabe Cup #3
OSC Championship Season 13
ESL Pro League Season 23
PGL Cluj-Napoca 2026
IEM Kraków 2026
BLAST Bounty Winter 2026
BLAST Bounty Winter Qual
TLPD

1. ByuN
2. TY
3. Dark
4. Solar
5. Stats
6. Nerchio
7. sOs
8. soO
9. INnoVation
10. Elazer
1. Rain
2. Flash
3. EffOrt
4. Last
5. Bisu
6. Soulkey
7. Mini
8. Sharp
Sidebar Settings...

Advertising | Privacy Policy | Terms Of Use | Contact Us

Original banner artwork: Jim Warren
The contents of this webpage are copyright © 2025 TLnet. All Rights Reserved.