• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 22:50
CEST 04:50
KST 11:50
  • 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
[ASL22] Ro4 Preview: Mirror Mirror6[ASL22] Ro8 Preview: Within Reach5[ASL22] Ro8 Preview: In A Tizzy11[ASL22] Ro16 Preview: Holy Diver5[ASL22] Ro16 Preview: Rough Waters10
Community News
Rollback Netcode in Brood War715.0.17 Patch Notes - October 7, 202621Weekly Cups Results (Sep 28-Oct 4)0SC4ALL: II SC2 Complete Invited Player Lineup10StarCraft II 5.0.17 PTR Patch Notes (Sept 30, 2026)78
StarCraft 2
General
ESL Pro Tour for SC2 discontinued [Old] StarCraft 3 Reportedly in Development 5.0.17 Patch Notes - October 7, 2026 StarCraft II 5.0.17 PTR Patch Notes (Sept 30, 2026) How do you feel about the mass reverts in the 5.0.17 PTR?
Tourneys
RSL 2026 Offline Finals LCQ Sign-Ups $3,500 WardiTV Not-Summer Championship ScienceCraft (October 24-25) - Live Event Stellar Fest TWO the Moon (Dec 16-20) ISSL (IntoTheTV x SOOP SC2 League): Premier
Strategy
[H] ZvP Mid-Late Game: Stalkers Collossi HT
Custom Maps
[M] (2) Sweltering Sands [M] (2) Frigid Storage
External Content
Mutation # 547 Temple Of Terror Mutation # 546 Catch the Train The PondCast: SC2 News & Results Mutation # 545 And Drops and Rifts
Brood War
General
Rollback Netcode in Brood War BGH Auto Balance -> http://bghmmr.eu/ BW General Discussion Ziemie's Starcraft 1 Prequel Campaign Mineral Boosting (2 workers/patch)
Tourneys
[Megathread] Daily Proleagues [ASL22] Semifinal A [ASL22] Semifinal B [ASL22] Ro8 Day 4
Strategy
Simple Questions, Simple Answers Cliff Jump Revisited (1 in a 1000 strategy) Replay Review Process - What do you do?
Other Games
General Games
Stormgate/Frost Giant Megathread Nintendo Switch Thread General RTS Discussion Thread Warcraft III: The Frozen Throne Total Annihilation Zero
Dota 2
Dota 2 Champions League Season 3 Begins April 25!
League of Legends
[TL LoL EUW IHs] Teemo shall perish
Heroes of the Storm
Heroes of the Storm 2.0
Hearthstone
Deck construction bug
TL Mafia
TL Mafia Community Thread
Community
General
Things Aren’t Peaceful in Palestine US Politics Mega-thread Canadian Politics Mega-thread Russo-Ukrainian War Thread Artificial Intelligence Thread
Fan Clubs
Serral Fan Club
Media & Entertainment
[Manga] One Piece Movie Discussion! Diablo Animated Series on Netflix
Sports
Football (Soccer) Thread TeamLiquid Health and Fitness Initiative For 2023 MLB/Baseball 2023
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
Recent Gifted Posts
Blogs
The Link Between Gaming and …
TrAiDoS
[ASL22] Ro4 Day1 Ticket Giv…
bITt.mAN
38 yo Retired SWE loo…
PurE)Rabbit-SF
Can Bots Beat Pros?? Starcr…
namkraft
[meme] I finally understa…
LUCKY_NOOB
Customize Sidebar...

Website Feedback

Closed Threads



Active: 12086 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
Switzerland3700 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
Replay Cast
08:00
The QMC Showmatch 1
CranKy Ducklings32
OSC
08:00
Masters Cup #151: Group A
davetesta39
Liquipedia
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
RuFF_SC2 133
StarCraft: Brood War
Rain 2118
GuemChi 1259
Artosis 737
Dota 2
NeuroSwarm216
League of Legends
Doublelift5644
JimRising 628
Counter-Strike
minikerr20
Other Games
Maynarde150
ArmadaUGS40
Organizations
Other Games
gamesdonequick780
[ Show 12 non-featured ]
StarCraft 2
• CranKy Ducklings SOOP70
• Letter147
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• Migwel
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
League of Legends
• Rush844
• Lourlo501
Upcoming Events
OSC
9h 11m
WardiTV Weekly
1d 8h
PiGosaur Cup
1d 21h
Kung Fu Cup
2 days
The PondCast
3 days
Online Event
4 days
Korean StarCraft League
5 days
Afreeca Starleague
5 days
Rush vs Soulkey
CranKy Ducklings
5 days
BSL Open Qualifier
5 days
[ Show More ]
Sparkling Tuna Cup
6 days
BSL Open Qualifier
6 days
Liquipedia Results

Completed

Acropolis #5 - GSB
Blizzard Classic Cup 2026
Copium Cup

Ongoing

ASL Season 22
Super Anchor Qualifying S3
Acropolis #5
HCC Season 3

Upcoming

Acropolis #5 - GSC
BSL Season 23
SC4ALL II: Brood War
BSL 23: Non-Korean Championship
HSC XXX
Stellar Fest 2: Lunar Cup
SC4ALL II: StarCraft II
Kung Fu Cup 2026 Grand Finals
RSL Offline Finals
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 © 2026 TLnet. All Rights Reserved.